QXmpp: QXmppTransferManager Class Reference

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppTransferManager Class Reference
Managers
Inheritance diagram for QXmppTransferManager:

## Public Member Functions
| QXmppTransferManager ()
QString | proxy () const
| Return the JID of the bytestream proxy to use for outgoing transfers.
void | setProxy (const QString &proxyJid)
bool | proxyOnly () const
void | setProxyOnly (bool proxyOnly)
QXmppTransferJob::Methods | supportedMethods () const
void | setSupportedMethods (QXmppTransferJob::Methods methods)
Q_SIGNAL void | fileReceived (QXmppTransferJob *job)
Q_SIGNAL void | jobStarted (QXmppTransferJob *job)
| This signal is emitted whenever a transfer job is started.
Q_SIGNAL void | jobFinished (QXmppTransferJob *job)
Q_SLOT QXmppTransferJob * | sendFile (const QString &jid, const QString &filePath, const QString &description=QString())
Q_SLOT QXmppTransferJob * | sendFile (const QString &jid, QIODevice *device, const QXmppTransferFileInfo &fileInfo, const QString &sid=QString())
Public Member Functions inherited from QXmppClientExtension
| QXmppClientExtension ()
virtual QStringList | discoveryFeatures () const
virtual QList< QXmppDiscoIdentity > | discoveryIdentities () const
virtual bool | handleStanza (const QDomElement &stanza)
| You need to implement this method to process incoming XMPP stanzas.
virtual bool | handleStanza (const QDomElement &stanza, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
| You need to implement this method to process incoming XMPP stanzas.
Public Member Functions inherited from QXmppLoggable
| QXmppLoggable (QObject *parent=nullptr)
Q_SIGNAL void | setGauge (const QString &gauge, double value)
| Sets the given gauge to value.
Q_SIGNAL void | logMessage (QXmppLogger::MessageType type, const QString &msg)
| This signal is emitted to send logging messages.
Q_SIGNAL void | updateCounter (const QString &counter, qint64 amount=1)
| Updates the given counter by amount.

## Properties
QString | proxy
| The JID of the bytestream proxy to use for outgoing transfers.
bool | proxyOnly
| Whether the proxy will systematically be used for outgoing SOCKS5 bytestream transfers.
QXmppTransferJob::Methods | supportedMethods
| The supported stream methods.

## Friends
class | QXmppTransferManagerPrivate

## Additional Inherited Members
Protected Member Functions inherited from QXmppClientExtension
QXmppClient * | client () const
virtual void | setClient (QXmppClient *client)
virtual void | onRegistered (QXmppClient *client)
virtual void | onUnregistered (QXmppClient *client)
void | injectIq (const QDomElement &element, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
bool | injectMessage (QXmppMessage &&message)
Protected Member Functions inherited from QXmppLoggable
void | debug (const QString &message)
| Logs a debugging message.
void | info (const QString &message)
| Logs an informational message.
void | warning (const QString &message)
| Logs a warning message.
void | logReceived (const QString &message)
| Logs a received packet.
void | logSent (const QString &message)
| Logs a sent packet.

## Detailed Description

The QXmppTransferManager class provides support for sending and receiving files.

Stream initiation is performed as described in XEP-0095: Stream Initiation and XEP-0096: SI File Transfer. The actual file transfer is then performed using either XEP-0065: SOCKS5 Bytestreams or XEP-0047: In-Band Bytestreams.

To make use of this manager, you need to instantiate it and load it into the QXmppClient instance as follows:

auto *manager = new QXmppTransferManager;
client->addExtension(manager);
QXmppClientExtension::client
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
QXmppTransferManager::QXmppTransferManager
QXmppTransferManager()
Definition QXmppTransferManager.cpp:781

## Constructor & Destructor Documentation

## ◆ QXmppTransferManager()

QXmppTransferManager::QXmppTransferManager | ( |  | ) |

Constructs a QXmppTransferManager to handle incoming and outgoing file transfers.

## Member Function Documentation

## ◆ fileReceived()

Q_SIGNAL void QXmppTransferManager::fileReceived | ( | QXmppTransferJob * | job | ) |

This signal is emitted when a new file transfer offer is received.

To accept the transfer job, call the job's QXmppTransferJob::accept() method. To refuse the transfer job, call the job's QXmppTransferJob::abort() method.

## ◆ jobFinished()

Q_SIGNAL void QXmppTransferManager::jobFinished | ( | QXmppTransferJob * | job | ) |

This signal is emitted whenever a transfer job is finished.

See also
  QXmppTransferJob::finished()

## ◆ proxyOnly()

bool QXmppTransferManager::proxyOnly | ( |  | ) | const

Return whether the proxy will systematically be used for outgoing SOCKS5 bytestream transfers.

## ◆ sendFile() [1/2]

QXmppTransferJob * QXmppTransferManager::sendFile | ( | const QString & | jid,
|  | const QString & | filePath,
|  | const QString & | description = QString() )

Sends the file at filePath to a remote party.

The remote party will be given the choice to accept or refuse the transfer.

Returns 0 if the jid is not valid or if the file at filePath cannot be read.

Note
  The recipient's jid must be a full JID with a resource, for instance "user@host/resource".

## ◆ sendFile() [2/2]

QXmppTransferJob * QXmppTransferManager::sendFile | ( | const QString & | jid,
|  | QIODevice * | device,
|  | const QXmppTransferFileInfo & | fileInfo,
|  | const QString & | sid = QString() )

Sends the file in device to a remote party.

The remote party will be given the choice to accept or refuse the transfer.

Returns 0 if the jid is not valid.

Note
  The recipient's jid must be a full JID with a resource, for instance "user@host/resource".
  The ownership of the device should be managed by the caller.

## ◆ setProxy()

void QXmppTransferManager::setProxy | ( | const QString & | proxyJid | ) |

Set the JID of the SOCKS5 bytestream proxy to use for outgoing transfers.

If you set a proxy, when you send a file the proxy will be offered to the recipient in addition to your own IP addresses.

## ◆ setProxyOnly()

void QXmppTransferManager::setProxyOnly | ( | bool | proxyOnly | ) |

Set whether the proxy should systematically be used for outgoing SOCKS5 bytestream transfers.

Note
  If you set this to true and do not provide a proxy using setProxy(), your outgoing transfers will fail!

## ◆ setSupportedMethods()

void QXmppTransferManager::setSupportedMethods | ( | QXmppTransferJob::Methods | methods | ) |

Set the supported stream methods. This allows you to selectively enable or disable stream methods (In-Band or SOCKS5 bytestreams).

The methods argument is a combination of zero or more QXmppTransferJob::Method.

## ◆ supportedMethods()

QXmppTransferJob::Methods QXmppTransferManager::supportedMethods | ( |  | ) | const

Return the supported stream methods.

The methods are a combination of zero or more QXmppTransferJob::Method.

The documentation for this class was generated from the following files:

- QXmppTransferManager.h
- QXmppTransferManager.cpp