~ubuntu-branches/ubuntu/jaunty/psi/jaunty

« back to all changes in this revision

Viewing changes to iris/jabber/filetransfer.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef XMPP_FILETRANSFER_H
22
22
#define XMPP_FILETRANSFER_H
23
23
 
24
 
#include"im.h"
25
 
 
26
 
#if QT_VERSION < 0x030200
27
 
typedef long int Q_LLONG;
28
 
#endif
 
24
#include "im.h"
29
25
 
30
26
namespace XMPP
31
27
{
32
28
        class S5BConnection;
33
29
        struct FTRequest;
34
30
 
35
 
        class FileTransfer : public QObject
 
31
        /*class AbstractFileTransfer 
 
32
        {
 
33
                public:
 
34
                        // Receive
 
35
                        virtual Jid peer() const = 0;
 
36
                        virtual QString fileName() const = 0;
 
37
                        virtual qlonglong fileSize() const = 0;
 
38
                        virtual QString description() const { return ""; }
 
39
                        virtual bool rangeSupported() const { return false; }
 
40
                        virtual void accept(qlonglong offset=0, qlonglong length=0) = 0;
 
41
        };*/
 
42
 
 
43
        class FileTransfer : public QObject /*, public AbstractFileTransfer */
36
44
        {
37
45
                Q_OBJECT
38
46
        public:
43
51
                void setProxy(const Jid &proxy);
44
52
 
45
53
                // send
46
 
                void sendFile(const Jid &to, const QString &fname, Q_LLONG size, const QString &desc);
47
 
                Q_LLONG offset() const;
48
 
                Q_LLONG length() const;
 
54
                void sendFile(const Jid &to, const QString &fname, qlonglong size, const QString &desc);
 
55
                qlonglong offset() const;
 
56
                qlonglong length() const;
49
57
                int dataSizeNeeded() const;
50
58
                void writeFileData(const QByteArray &a);
51
59
 
52
60
                // receive
53
61
                Jid peer() const;
54
62
                QString fileName() const;
55
 
                Q_LLONG fileSize() const;
 
63
                qlonglong fileSize() const;
56
64
                QString description() const;
57
65
                bool rangeSupported() const;
58
 
                void accept(Q_LLONG offset=0, Q_LLONG length=0);
 
66
                void accept(qlonglong offset=0, qlonglong length=0);
59
67
 
60
68
                // both
61
69
                void close(); // reject, or stop sending/receiving
127
135
                JT_FT(Task *parent);
128
136
                ~JT_FT();
129
137
 
130
 
                void request(const Jid &to, const QString &id, const QString &fname, Q_LLONG size, const QString &desc, const QStringList &streamTypes);
131
 
                Q_LLONG rangeOffset() const;
132
 
                Q_LLONG rangeLength() const;
 
138
                void request(const Jid &to, const QString &id, const QString &fname, qlonglong size, const QString &desc, const QStringList &streamTypes);
 
139
                qlonglong rangeOffset() const;
 
140
                qlonglong rangeLength() const;
133
141
                QString streamType() const;
134
142
 
135
143
                void onGo();
145
153
                Jid from;
146
154
                QString iq_id, id;
147
155
                QString fname;
148
 
                Q_LLONG size;
 
156
                qlonglong size;
149
157
                QString desc;
150
158
                bool rangeSupported;
151
159
                QStringList streamTypes;
157
165
                JT_PushFT(Task *parent);
158
166
                ~JT_PushFT();
159
167
 
160
 
                void respondSuccess(const Jid &to, const QString &id, Q_LLONG rangeOffset, Q_LLONG rangeLength, const QString &streamType);
 
168
                void respondSuccess(const Jid &to, const QString &id, qlonglong rangeOffset, qlonglong rangeLength, const QString &streamType);
161
169
                void respondError(const Jid &to, const QString &id, int code, const QString &str);
162
170
 
163
171
                bool take(const QDomElement &);