diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-03-05 08:43:31 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-03-05 08:43:31 +0000 |
| commit | 5dd224f861b108fe967f8dfd6b467c3a91bedae0 (patch) | |
| tree | 5590a548eca2f31d90703c0397c573a1662ea951 /source/QXmppTransferManager.h | |
| parent | a5b471e805cd499f13e9ede69f1f3d3be5effd6a (diff) | |
| download | qxmpp-5dd224f861b108fe967f8dfd6b467c3a91bedae0.tar.gz | |
make it possible to associate arbitrary data with a job
Diffstat (limited to 'source/QXmppTransferManager.h')
| -rw-r--r-- | source/QXmppTransferManager.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/QXmppTransferManager.h b/source/QXmppTransferManager.h index cc8fc926..b5edf5a5 100644 --- a/source/QXmppTransferManager.h +++ b/source/QXmppTransferManager.h @@ -26,7 +26,9 @@ #include <QCryptographicHash> #include <QDateTime> +#include <QHash> #include <QHostAddress> +#include <QVariant> #include "QXmppIq.h" #include "QXmppByteStreamIq.h" @@ -79,10 +81,11 @@ public: void abort(); void accept(QIODevice *output); + QVariant data(int role) const; + void setData(int role, const QVariant &value); + QXmppTransferJob::Direction direction() const; QXmppTransferJob::Error error() const; - QString localFilePath() const; - void setLocalFilePath(const QString &path); QString jid() const; QXmppTransferJob::Method method() const; QXmppTransferJob::State state() const; @@ -122,8 +125,8 @@ private: QString m_requestId; State m_state; - // local path to file - QString m_localFilePath; + // arbitrary data + QHash<int, QVariant> m_data; // file meta-data QDateTime m_fileDate; @@ -155,6 +158,11 @@ public: void setSupportedMethods(int methods); signals: + /// This signal is emitted when a new file transfer offer is received. + /// + /// To accept the transfer job, you must call its accept() method from + /// a slot connected to the signal. Otherwise, the offer transfer job + /// will be refused. void fileReceived(QXmppTransferJob *offer); private slots: |
