~ubuntu-branches/ubuntu/saucy/kopete/saucy-proposed

« back to all changes in this revision

Viewing changes to protocols/oscar/liboscar/filetransferhandler.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-06-21 02:22:39 UTC
  • Revision ID: package-import@ubuntu.com-20130621022239-63l3zc8p0nf26pt6
Tags: upstream-4.10.80
ImportĀ upstreamĀ versionĀ 4.10.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    filetransferhandler.h  -  File Transfer Handler
 
3
 
 
4
    Copyright (c) 2008 by Roman Jarosz <kedgedev@centrum.cz>
 
5
    Kopete    (c) 2008 by the Kopete developers  <kopete-devel@kde.org>
 
6
 
 
7
    *************************************************************************
 
8
    *                                                                       *
 
9
    * This program is free software; you can redistribute it and/or modify  *
 
10
    * it under the terms of the GNU General Public License as published by  *
 
11
    * the Free Software Foundation; either version 2 of the License, or     *
 
12
    * (at your option) any later version.                                   *
 
13
    *                                                                       *
 
14
    *************************************************************************
 
15
*/
 
16
#ifndef FILETRANSFERHANDLER_H
 
17
#define FILETRANSFERHANDLER_H
 
18
 
 
19
#include <QtCore/QObject>
 
20
#include <QtCore/QPointer>
 
21
#include "oscartypes.h"
 
22
 
 
23
#include "liboscar_export.h"
 
24
 
 
25
class FileTransferTask;
 
26
 
 
27
class LIBOSCAR_EXPORT FileTransferHandler : public QObject
 
28
{
 
29
        Q_OBJECT
 
30
public:
 
31
        FileTransferHandler( FileTransferTask* fileTransferTask );
 
32
        ~FileTransferHandler();
 
33
 
 
34
        void send();
 
35
 
 
36
        QString internalId() const;
 
37
        QString contact() const;
 
38
        QString fileName() const;
 
39
        Oscar::WORD fileCount() const;
 
40
        Oscar::DWORD totalSize() const;
 
41
        QString description() const;
 
42
 
 
43
public Q_SLOTS:
 
44
        void cancel();
 
45
        void save( const QString &directory );
 
46
        void saveAs( const QStringList &fileNames );
 
47
 
 
48
Q_SIGNALS:
 
49
        void transferCancelled();
 
50
        void transferError( int errorCode, const QString &error );
 
51
        void transferFinished();
 
52
        void transferProcessed( unsigned int totalSent );
 
53
 
 
54
        void transferNextFile( const QString& sourceFile, const QString& destinationFile );
 
55
        void transferNextFile( const QString& fileName, unsigned int fileSize );
 
56
        void transferFileProcessed(unsigned int bytesSent, unsigned int fileSize );
 
57
 
 
58
private Q_SLOTS:
 
59
        void emitTransferCancelled();
 
60
        void emitTransferError( int errorCode, const QString &error );
 
61
        void emitTransferFinished();
 
62
        
 
63
private:
 
64
        QPointer<FileTransferTask> mFileTransferTask;
 
65
        bool mFileTransferDone;
 
66
};
 
67
 
 
68
#endif