24 #ifndef QXMPPTRANSFERMANAGER_H
25 #define QXMPPTRANSFERMANAGER_H
28 #include <QSharedData>
32 #include "QXmppClientExtension.h"
35 class QXmppByteStreamIq;
36 class QXmppIbbCloseIq;
40 class QXmppStreamInitiationIq;
41 class QXmppTransferFileInfoPrivate;
42 class QXmppTransferJobPrivate;
44 class QXmppTransferManagerPrivate;
46 class QXMPP_EXPORT QXmppTransferFileInfo
49 QXmppTransferFileInfo();
50 QXmppTransferFileInfo(
const QXmppTransferFileInfo &other);
51 ~QXmppTransferFileInfo();
53 QDateTime date()
const;
54 void setDate(
const QDateTime &date);
56 QByteArray hash()
const;
57 void setHash(
const QByteArray &hash);
60 void setName(
const QString &name);
63 void setSize(qint64 size);
65 QXmppTransferFileInfo& operator=(
const QXmppTransferFileInfo &other);
66 bool operator==(
const QXmppTransferFileInfo &other)
const;
69 QSharedDataPointer<QXmppTransferFileInfoPrivate> d;
82 Q_PROPERTY(
Direction direction READ direction CONSTANT)
83 Q_PROPERTY(QUrl localFileUrl READ localFileUrl WRITE setLocalFileUrl NOTIFY localFileUrlChanged)
84 Q_PROPERTY(QString jid READ jid CONSTANT)
85 Q_PROPERTY(
Method method READ method CONSTANT)
86 Q_PROPERTY(State state READ state NOTIFY stateChanged)
88 Q_PROPERTY(QString fileName READ fileName CONSTANT)
89 Q_PROPERTY(qint64 fileSize READ fileSize CONSTANT)
117 Q_DECLARE_FLAGS(Methods, Method)
135 qint64 speed()
const;
139 QXmppTransferFileInfo fileInfo()
const;
140 QUrl localFileUrl()
const;
141 void setLocalFileUrl(
const QUrl &localFileUrl);
144 QDateTime fileDate()
const;
145 QByteArray fileHash()
const;
146 QString fileName()
const;
147 qint64 fileSize()
const;
165 void localFileUrlChanged(
const QUrl &localFileUrl);
168 void progress(qint64 done, qint64 total);
175 void accept(
const QString &filePath);
176 void accept(QIODevice *output);
179 void _q_terminated();
186 QXmppTransferJobPrivate *
const d;
188 friend class QXmppTransferManagerPrivate;
189 friend class QXmppTransferIncomingJob;
190 friend class QXmppTransferOutgoingJob;
213 Q_PROPERTY(QString proxy READ proxy WRITE setProxy)
214 Q_PROPERTY(
bool proxyOnly READ proxyOnly WRITE setProxyOnly)
215 Q_PROPERTY(
QXmppTransferJob::Methods supportedMethods READ supportedMethods WRITE setSupportedMethods)
219 ~QXmppTransferManager();
221 QString proxy() const;
222 void setProxy(const QString &proxyJid);
224 bool proxyOnly() const;
225 void setProxyOnly(
bool proxyOnly);
231 QStringList discoveryFeatures() const;
232 bool handleStanza(const QDomElement &element);
251 QXmppTransferJob *sendFile(const QString &jid, const QString &filePath, const QString &sid = QString());
252 QXmppTransferJob *sendFile(const QString &jid, QIODevice *device, const QXmppTransferFileInfo &fileInfo, const QString &sid = QString());
260 void _q_iqReceived(const
QXmppIq&);
261 void _q_jobDestroyed(QObject *
object);
263 void _q_jobFinished();
265 void _q_socksServerConnected(QTcpSocket *socket, const QString &hostName, quint16 port);
268 QXmppTransferManagerPrivate *d;
270 void byteStreamIqReceived(const QXmppByteStreamIq&);
271 void byteStreamResponseReceived(const QXmppIq&);
272 void byteStreamResultReceived(const QXmppByteStreamIq&);
273 void byteStreamSetReceived(const QXmppByteStreamIq&);
274 void ibbCloseIqReceived(const QXmppIbbCloseIq&);
275 void ibbDataIqReceived(const QXmppIbbDataIq&);
276 void ibbOpenIqReceived(const QXmppIbbOpenIq&);
277 void ibbResponseReceived(const QXmppIq&);
278 void streamInitiationIqReceived(const QXmppStreamInitiationIq&);
279 void streamInitiationResultReceived(const QXmppStreamInitiationIq&);
280 void streamInitiationSetReceived(const QXmppStreamInitiationIq&);
283 friend class QXmppTransferManagerPrivate;