5#ifndef QXMPPTRANSFERMANAGER_H
6#define QXMPPTRANSFERMANAGER_H
8#include "QXmppClientExtension.h"
21class QXmppStreamInitiationIq;
22class QXmppTransferFileInfoPrivate;
23class QXmppTransferJobPrivate;
25class QXmppTransferManagerPrivate;
34 QDateTime date()
const;
35 void setDate(
const QDateTime &date);
37 QByteArray hash()
const;
38 void setHash(
const QByteArray &hash);
41 void setName(
const QString &name);
43 QString description()
const;
44 void setDescription(
const QString &description);
47 void setSize(qint64 size);
54 void parse(
const QDomElement &element);
55 void toXml(QXmlStreamWriter *writer)
const;
59 QSharedDataPointer<QXmppTransferFileInfoPrivate> d;
67 Q_PROPERTY(
Direction direction READ direction CONSTANT)
69 Q_PROPERTY(QUrl localFileUrl READ localFileUrl WRITE setLocalFileUrl NOTIFY localFileUrlChanged)
71 Q_PROPERTY(QString jid READ jid CONSTANT)
73 Q_PROPERTY(
Method method READ method CONSTANT)
75 Q_PROPERTY(
State state READ state NOTIFY stateChanged)
78 Q_PROPERTY(QString fileName READ fileName CONSTANT)
80 Q_PROPERTY(qint64 fileSize READ fileSize CONSTANT)
108 Q_DECLARE_FLAGS(Methods, Method)
133 qint64 speed()
const;
139 QUrl localFileUrl()
const;
140 void setLocalFileUrl(
const QUrl &localFileUrl);
143 QDateTime fileDate()
const;
144 QByteArray fileHash()
const;
145 QString fileName()
const;
146 qint64 fileSize()
const;
174 void accept(
const QString &filePath);
175 void accept(QIODevice *output);
178 void _q_terminated();
185 const std::unique_ptr<QXmppTransferJobPrivate> d;
187 friend class QXmppTransferManagerPrivate;
188 friend class QXmppTransferIncomingJob;
189 friend class QXmppTransferOutgoingJob;
197 Q_PROPERTY(QString proxy READ proxy WRITE setProxy)
199 Q_PROPERTY(
bool proxyOnly READ proxyOnly WRITE setProxyOnly)
201 Q_PROPERTY(
QXmppTransferJob::Methods supportedMethods READ supportedMethods WRITE setSupportedMethods)
209 QString proxy() const;
210 void setProxy(const QString &proxyJid);
215 bool proxyOnly() const;
216 void setProxyOnly(
bool proxyOnly);
226 QStringList discoveryFeatures() const override;
227 bool handleStanza(const QDomElement &element) override;
246 QXmppTransferJob *sendFile(const QString &jid, const QString &filePath, const QString &description = QString());
255 void _q_iqReceived(const
QXmppIq &);
256 void _q_jobDestroyed(QObject *
object);
258 void _q_jobFinished();
260 void _q_socksServerConnected(QTcpSocket *socket, const QString &hostName, quint16 port);
263 const std::unique_ptr<QXmppTransferManagerPrivate> d;
266 void byteStreamResponseReceived(const
QXmppIq &);
270 void ibbDataIqReceived(const QXmppIbbDataIq &);
272 void ibbResponseReceived(const
QXmppIq &);
273 void streamInitiationIqReceived(const QXmppStreamInitiationIq &);
274 void streamInitiationResultReceived(const QXmppStreamInitiationIq &);
275 void streamInitiationSetReceived(const QXmppStreamInitiationIq &);
278 friend class QXmppTransferManagerPrivate;
Definition QXmppByteStreamIq.h:13
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition QXmppClientExtension.h:33
The QXmppClient class is the main class for using QXmpp.
Definition QXmppClient.h:84
Definition QXmppIbbIq.h:36
Definition QXmppIbbIq.h:12
The QXmppIq class is the base class for all IQs.
Definition QXmppIq.h:23
The QXmppLoggable class represents a source of logging messages.
Definition QXmppLogger.h:105
Definition QXmppTransferManager.h:28
QXmppTransferFileInfo(const QXmppTransferFileInfo &other)
Default copy-constructor.
QXmppTransferFileInfo & operator=(const QXmppTransferFileInfo &other)
Default assignment operator.
Definition QXmppTransferManager.h:63
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:101
Direction
This enum is used to describe the direction of a transfer job.
Definition QXmppTransferManager.h:84
@ IncomingDirection
The file is being received.
Definition QXmppTransferManager.h:85
State
This enum is used to describe the state of a transfer job.
Definition QXmppTransferManager.h:111
Error
This enum is used to describe the type of error encountered by a transfer job.
Definition QXmppTransferManager.h:91
@ AbortError
The file transfer was aborted.
Definition QXmppTransferManager.h:93
@ FileAccessError
An error was encountered trying to access a local file.
Definition QXmppTransferManager.h:94
@ FileCorruptError
The file is corrupt: the file size or hash do not match.
Definition QXmppTransferManager.h:95
Definition QXmppTransferManager.h:193