~ubuntu-branches/ubuntu/maverick/bluedevil/maverick-proposed

« back to all changes in this revision

Viewing changes to src/actionplugins/sendfile/helper/sendfilesjob.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2010-08-07 09:04:19 UTC
  • Revision ID: james.westby@ubuntu.com-20100807090419-68k54ucso2htcf5z
Tags: upstream-1.0~rc2
ImportĀ upstreamĀ versionĀ 1.0~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   This file is part of the KDE project                                  *
 
3
 *                                                                         *
 
4
 *   Copyright (C) 2010 Alejandro Fiestas Olivares <alex@ufocoders.com>    *
 
5
 *   Copyright (C) 2010 UFO Coders <info@ufocoders.com>                    *
 
6
 *                                                                         *
 
7
 *   This program is free software; you can redistribute it and/or modify  *
 
8
 *   it under the terms of the GNU General Public License as published by  *
 
9
 *   the Free Software Foundation; either version 2 of the License, or     *
 
10
 *   (at your option) any later version.                                   *
 
11
 *                                                                         *
 
12
 *   This program is distributed in the hope that it will be useful,       *
 
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
14
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
15
 *   GNU General Public License for more details.                          *
 
16
 *                                                                         *
 
17
 *   You should have received a copy of the GNU General Public License     *
 
18
 *   along with this program; if not, write to the                         *
 
19
 *   Free Software Foundation, Inc.,                                       *
 
20
 *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
 
21
 ***************************************************************************/
 
22
 
 
23
#ifndef SENDFILESJOB_H
 
24
#define SENDFILESJOB_H
 
25
 
 
26
#include <obex_transfer.h>
 
27
 
 
28
#include <QStringList>
 
29
#include <QList>
 
30
#include <QDBusObjectPath>
 
31
 
 
32
#include <kcompositejob.h>
 
33
#include <KFileItemList>
 
34
 
 
35
namespace BlueDevil
 
36
{
 
37
    class Device;
 
38
}
 
39
class ObexAgent;
 
40
using namespace BlueDevil;
 
41
 
 
42
class SendFilesJob : public KJob
 
43
{
 
44
Q_OBJECT
 
45
public:
 
46
    SendFilesJob(KFileItemList list, BlueDevil::Device* device, ObexAgent* agent, QObject* parent = 0);
 
47
 
 
48
    virtual void start();
 
49
    virtual bool doKill();
 
50
 
 
51
private Q_SLOTS:
 
52
    void nextJob(OrgOpenobexTransferInterface *transferObj);
 
53
    void jobDone(QDBusObjectPath transfer);
 
54
    void progress(QDBusObjectPath transfer, quint64 transferBytes);
 
55
    void error(QDBusObjectPath transfer, const QString& error);
 
56
 
 
57
private:
 
58
    ObexAgent       *m_agent;
 
59
    QStringList     m_filesToSend;
 
60
    QList <quint64> m_filesToSendSize;
 
61
    Device          *m_device;
 
62
    QString         m_currentFile;
 
63
    QDBusObjectPath m_currentFileDBusPath;
 
64
    quint64         m_totalSize;
 
65
    quint64         m_progress;
 
66
    quint64         m_currentFileProgress;
 
67
    quint64         m_currentFileSize;
 
68
 
 
69
    OrgOpenobexTransferInterface *m_currentTransferJob;
 
70
};
 
71
 
 
72
#endif // SENDFILESJOB_H