The QXmppTransferJob class represents a single file transfer job. More...
#include <QXmppTransferManager.h>
Public Types | |
enum | Direction { IncomingDirection, OutgoingDirection } |
This enum is used to describe the direction of a transfer job. More... | |
enum | Error { NoError = 0, AbortError, FileAccessError, FileCorruptError, ProtocolError } |
This enum is used to describe the type of error encountered by a transfer job. More... | |
enum | Method { NoMethod = 0, InBandMethod = 1, SocksMethod = 2, AnyMethod = 3 } |
This enum is used to describe a transfer method. More... | |
enum | State { OfferState = 0, StartState = 1, TransferState = 2, FinishedState = 3 } |
This enum is used to describe the state of a transfer job. More... | |
Signals | |
void | error (QXmppTransferJob::Error error) |
void | finished () |
void | progress (qint64 done, qint64 total) |
This signal is emitted to indicate the progress of this transfer job. | |
void | stateChanged (QXmppTransferJob::State state) |
This signal is emitted when the transfer job changes state. | |
Public Member Functions | |
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 | jid () const |
QXmppTransferJob::Method | method () const |
QString | sid () const |
qint64 | speed () const |
QXmppTransferJob::State | state () const |
QXmppTransferFileInfo | fileInfo () const |
Friends | |
class | QXmppTransferManager |
The QXmppTransferJob class represents a single file transfer job.
This enum is used to describe the type of error encountered by a transfer job.
void QXmppTransferJob::abort | ( | ) |
Call this method if you wish to abort on ongoing transfer job.
void QXmppTransferJob::accept | ( | QIODevice * | iodevice | ) |
Call this method if you wish to accept an incoming transfer job.
QVariant QXmppTransferJob::data | ( | int | role | ) | const |
Returns the job's data for a given role.
You can associate arbitrary data with the role using setData().
QXmppTransferJob::Direction QXmppTransferJob::direction | ( | ) | const |
Returns the job's transfer direction.
QXmppTransferJob::Error QXmppTransferJob::error | ( | ) | const |
Returns the last error that was encountered.
void QXmppTransferJob::error | ( | QXmppTransferJob::Error | error | ) | [signal] |
This signal is emitted when an error is encountered while processing the transfer job.
QXmppTransferFileInfo QXmppTransferJob::fileInfo | ( | ) | const |
Returns meta-data about the file being transferred.
void QXmppTransferJob::finished | ( | ) | [signal] |
This signal is emitted when the transfer job is finished.
You can determine if the job completed successfully by testing whether error() returns QXmppTransferJob::NoError.
Note: Do not delete the job in the slot connected to this signal, instead use deleteLater().
QString QXmppTransferJob::jid | ( | ) | const |
Returns the remote party's JID.
QXmppTransferJob::Method QXmppTransferJob::method | ( | ) | const |
Returns the job's transfer method.
void QXmppTransferJob::setData | ( | int | role, | |
const QVariant & | value | |||
) |
Sets the data for a given role to the given value.
You can set any data you want for use in your application, this data will not be used internally by QXmppTransferManager.
QString QXmppTransferJob::sid | ( | ) | const |
Returns the job's session identifier.
qint64 QXmppTransferJob::speed | ( | ) | const |
Returns the job's transfer speed in bytes per second.
If the transfer has not started yet or is already finished, returns 0.
QXmppTransferJob::State QXmppTransferJob::state | ( | ) | const |
Returns the job's state.