24 #ifndef QXMPPTRANSFERMANAGER_H
25 #define QXMPPTRANSFERMANAGER_H
27 #include "QXmppClientExtension.h"
30 #include <QSharedData>
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);
62 QString description()
const;
63 void setDescription(
const QString &description);
66 void setSize(qint64 size);
69 QXmppTransferFileInfo &operator=(
const QXmppTransferFileInfo &other);
70 bool operator==(
const QXmppTransferFileInfo &other)
const;
73 void parse(
const QDomElement &element);
74 void toXml(QXmlStreamWriter *writer)
const;
78 QSharedDataPointer<QXmppTransferFileInfoPrivate> d;
91 Q_PROPERTY(
Direction direction READ direction CONSTANT)
93 Q_PROPERTY(QUrl localFileUrl READ localFileUrl WRITE setLocalFileUrl NOTIFY localFileUrlChanged)
95 Q_PROPERTY(QString jid READ jid CONSTANT)
97 Q_PROPERTY(
Method method READ method CONSTANT)
99 Q_PROPERTY(
State state READ state NOTIFY stateChanged)
102 Q_PROPERTY(QString fileName READ fileName CONSTANT)
104 Q_PROPERTY(qint64 fileSize READ fileSize CONSTANT)
132 Q_DECLARE_FLAGS(Methods, Method)
157 qint64 speed()
const;
160 QXmppTransferFileInfo fileInfo()
const;
163 QUrl localFileUrl()
const;
164 void setLocalFileUrl(
const QUrl &localFileUrl);
167 QDateTime fileDate()
const;
168 QByteArray fileHash()
const;
169 QString fileName()
const;
170 qint64 fileSize()
const;
198 void accept(
const QString &filePath);
199 void accept(QIODevice *output);
202 void _q_terminated();
209 QXmppTransferJobPrivate *
const d;
211 friend class QXmppTransferManagerPrivate;
212 friend class QXmppTransferIncomingJob;
213 friend class QXmppTransferOutgoingJob;
239 Q_PROPERTY(QString proxy READ proxy WRITE setProxy)
241 Q_PROPERTY(
bool proxyOnly READ proxyOnly WRITE setProxyOnly)
243 Q_PROPERTY(QXmppTransferJob::Methods supportedMethods READ supportedMethods WRITE setSupportedMethods)
251 QString proxy()
const;
252 void setProxy(
const QString &proxyJid);
257 bool proxyOnly()
const;
258 void setProxyOnly(
bool proxyOnly);
264 QXmppTransferJob::Methods supportedMethods()
const;
265 void setSupportedMethods(QXmppTransferJob::Methods methods);
268 QStringList discoveryFeatures()
const override;
269 bool handleStanza(
const QDomElement &element)
override;
288 QXmppTransferJob *sendFile(
const QString &jid,
const QString &filePath,
const QString &description = QString());
289 QXmppTransferJob *sendFile(
const QString &jid, QIODevice *device,
const QXmppTransferFileInfo &fileInfo,
const QString &sid = QString());
297 void _q_iqReceived(
const QXmppIq &);
298 void _q_jobDestroyed(QObject *
object);
300 void _q_jobFinished();
302 void _q_socksServerConnected(QTcpSocket *socket,
const QString &hostName, quint16 port);
305 QXmppTransferManagerPrivate *d;
308 void byteStreamResponseReceived(
const QXmppIq &);
314 void ibbResponseReceived(
const QXmppIq &);
315 void streamInitiationIqReceived(
const QXmppStreamInitiationIq &);
316 void streamInitiationResultReceived(
const QXmppStreamInitiationIq &);
317 void streamInitiationSetReceived(
const QXmppStreamInitiationIq &);
320 friend class QXmppTransferManagerPrivate;
323 Q_DECLARE_OPERATORS_FOR_FLAGS(QXmppTransferJob::Methods)
QXmppByteStreamIq represents a SOCKS5 bytestreams negoatiation IQ as defined by XEP-0065: SOCKS5 Byte...
Definition: QXmppByteStreamIq.h:36
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:47
The QXmppClient class is the main class for using QXmpp.
Definition: QXmppClient.h:94
QXmppIbbCloseIq represents an IBB close request as defined by XEP-0047: In-Band Bytestreams.
Definition: QXmppIbbIq.h:67
QXmppIbbCloseIq represents an IBB data request as defined by XEP-0047: In-Band Bytestreams.
Definition: QXmppIbbIq.h:93
QXmppIbbOpenIq represents an IBB open request as defined by XEP-0047: In-Band Bytestreams.
Definition: QXmppIbbIq.h:37
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:124
The QXmppTransferJob class represents a single file transfer job.
Definition: QXmppTransferManager.h:87
void stateChanged(QXmppTransferJob::State state)
This signal is emitted when the transfer job changes state.
void progress(qint64 done, qint64 total)
This signal is emitted to indicate the progress of this transfer job.
void error(QXmppTransferJob::Error error)
void localFileUrlChanged(const QUrl &localFileUrl)
This signal is emitted when the local file URL changes.
Method
This enum is used to describe a transfer method.
Definition: QXmppTransferManager.h:125
Direction
This enum is used to describe the direction of a transfer job.
Definition: QXmppTransferManager.h:108
@ IncomingDirection
The file is being received.
Definition: QXmppTransferManager.h:109
State
This enum is used to describe the state of a transfer job.
Definition: QXmppTransferManager.h:135
Error
This enum is used to describe the type of error encountered by a transfer job.
Definition: QXmppTransferManager.h:115
@ AbortError
The file transfer was aborted.
Definition: QXmppTransferManager.h:117
@ FileAccessError
An error was encountered trying to access a local file.
Definition: QXmppTransferManager.h:118
@ FileCorruptError
The file is corrupt: the file size or hash do not match.
Definition: QXmppTransferManager.h:119
The QXmppTransferManager class provides support for sending and receiving files.
Definition: QXmppTransferManager.h:235
void fileReceived(QXmppTransferJob *job)
void jobStarted(QXmppTransferJob *job)
This signal is emitted whenever a transfer job is started.
void jobFinished(QXmppTransferJob *job)