|
QXmpp Version: 1.12.0
|
The QXmppDiscoveryManager class makes it possible to discover information about other entities as defined by XEP-0030: Service Discovery. More...


Public Types | |
| enum class | CachePolicy { Strict , Relaxed } |
| Policies for how cached service discovery information is used. More... | |
| using | InfoResult = std::variant< QXmppDiscoveryIq, QXmppError > |
| using | ItemsResult = std::variant< QList< QXmppDiscoveryIq::Item >, QXmppError > |
Public Member Functions | |
| QXmppTask< QXmpp::Result< QXmppDiscoInfo > > | info (const QString &jid, const QString &node={}, CachePolicy fetchPolicy=CachePolicy::Relaxed) |
| QXmppTask< QXmpp::Result< QList< QXmppDiscoItem > > > | items (const QString &jid, const QString &node={}, CachePolicy fetchPolicy=CachePolicy::Relaxed) |
| const QList< QXmppDiscoIdentity > & | identities () const |
| void | setIdentities (const QList< QXmppDiscoIdentity > &identities) |
| const QList< QXmppDataForm > & | infoForms () const |
| void | setInfoForms (const QList< QXmppDataForm > &dataForms) |
| QString | clientCapabilitiesNode () const |
| void | setClientCapabilitiesNode (const QString &) |
| QXmppDiscoInfo | buildClientInfo () const |
| Q_SIGNAL void | infoReceived (const QXmppDiscoveryIq &) |
| This signal is emitted when an information response is received. | |
| Q_SIGNAL void | itemsReceived (const QXmppDiscoveryIq &) |
| This signal is emitted when an items response is received. | |
| QXmppTask< InfoResult > | requestDiscoInfo (const QString &jid, const QString &node={}) |
| QXmppTask< ItemsResult > | requestDiscoItems (const QString &jid, const QString &node={}) |
| QT_WARNING_POP QXmppDiscoveryIq | capabilities () |
| QString | clientCategory () const |
| void | setClientCategory (const QString &) |
| void | setClientName (const QString &) |
| QString | clientApplicationName () const |
| QString | clientType () const |
| void | setClientType (const QString &) |
| QXmppDataForm | clientInfoForm () const |
| void | setClientInfoForm (const QXmppDataForm &form) |
| QString | requestInfo (const QString &jid, const QString &node=QString()) |
| QString | requestItems (const QString &jid, const QString &node=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) | |
Protected Member Functions | |
| void | onRegistered (QXmppClient *client) |
| void | onUnregistered (QXmppClient *client) |
Protected Member Functions inherited from QXmppClientExtension | |
| QXmppClient * | client () const |
| virtual void | setClient (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) |
| void | info (const QString &message) |
| void | warning (const QString &message) |
| void | logReceived (const QString &message) |
| void | logSent (const QString &message) |
Friends | |
| class | QXmppDiscoveryManagerPrivate |
Additional Inherited Members | |
Signals inherited from QXmppLoggable | |
| void | setGauge (const QString &gauge, double value) |
| Sets the given gauge to value. | |
| void | logMessage (QXmppLogger::MessageType type, const QString &msg) |
| This signal is emitted to send logging messages. | |
| void | updateCounter (const QString &counter, qint64 amount=1) |
| Updates the given counter by amount. | |
The QXmppDiscoveryManager class makes it possible to discover information about other entities as defined by XEP-0030: Service Discovery.
Since QXmpp 1.12 info and items queries are cached per session by default.
Contains the discovery information result in the form of an QXmppDiscoveryIq or (in case the request did not succeed) a QXmppStanza::Error.
Contains a list of service discovery items or (in case the request did not succeed) a QXmppStanza::Error.
|
strong |
Policies for how cached service discovery information is used.
| QXmppDiscoInfo QXmppDiscoveryManager::buildClientInfo | ( | ) | const |
Builds a full disco info element for this client.
Contains features and identities from all extensions and identities and data forms configured in this manager.
| QXmppDiscoveryIq QXmppDiscoveryManager::capabilities | ( | ) |
Returns the client's full capabilities.
| QString QXmppDiscoveryManager::clientApplicationName | ( | ) | const |
Returns the name of the local XMPP client.
By default this is "QXmpp x.y.z".
| QString QXmppDiscoveryManager::clientCapabilitiesNode | ( | ) | const |
Returns the capabilities node of the local XMPP client.
By default this is "org.qxmpp.caps".
| QString QXmppDiscoveryManager::clientCategory | ( | ) | const |
Returns the category of the local XMPP client.
By default this is "client".
| QXmppDataForm QXmppDiscoveryManager::clientInfoForm | ( | ) | const |
Returns the client's extended information form, as defined by XEP-0128: Service Discovery Extensions.
| QString QXmppDiscoveryManager::clientType | ( | ) | const |
Returns the type of the local XMPP client.
With Qt builds for Android, Blackberry, iOS or Windows Phone this is set to "phone", otherwise it defaults to "pc".
| const QList< QXmppDiscoIdentity > & QXmppDiscoveryManager::identities | ( | ) | const |
Returns the base identities of this client.
The identities are added to the service discovery information other entities can request.
| QXmppTask< Result< QXmppDiscoInfo > > QXmppDiscoveryManager::info | ( | const QString & | jid, |
| const QString & | node = {}, |
||
| CachePolicy | cachePolicy = CachePolicy::Relaxed |
||
| ) |
Fetches discovery info from the specified XMPP entity.
| const QList< QXmppDataForm > & QXmppDiscoveryManager::infoForms | ( | ) | const |
Returns the data forms for this client as defined in XEP-0128: Service Discovery Extensions.
The data forms are added to the service discovery information other entities can request.
| QXmppTask< Result< QList< QXmppDiscoItem > > > QXmppDiscoveryManager::items | ( | const QString & | jid, |
| const QString & | node = {}, |
||
| CachePolicy | cachePolicy = CachePolicy::Relaxed |
||
| ) |
Fetches discovery items from the specified XMPP entity.
|
protectedvirtual |
Called after the extension has been added to a QXmppClient.
| client |
Reimplemented from QXmppClientExtension.
|
protectedvirtual |
Called after the extension has been removed from a QXmppClient.
| client |
Reimplemented from QXmppClientExtension.
| QXmppTask< QXmppDiscoveryManager::InfoResult > QXmppDiscoveryManager::requestDiscoInfo | ( | const QString & | jid, |
| const QString & | node = {} |
||
| ) |
Requests information from the specified XMPP entity.
| jid | The target entity's JID. |
| node | The target node (optional). |
| QXmppTask< QXmppDiscoveryManager::ItemsResult > QXmppDiscoveryManager::requestDiscoItems | ( | const QString & | jid, |
| const QString & | node = {} |
||
| ) |
Requests items from the specified XMPP entity.
| jid | The target entity's JID. |
| node | The target node (optional). |
| QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED QString QXmppDiscoveryManager::requestInfo | ( | const QString & | jid, |
| const QString & | node = QString() |
||
| ) |
Requests information from the specified XMPP entity.
| jid | The target entity's JID. |
| node | The target node (optional). |
| QString QXmppDiscoveryManager::requestItems | ( | const QString & | jid, |
| const QString & | node = QString() |
||
| ) |
Requests items from the specified XMPP entity.
| jid | The target entity's JID. |
| node | The target node (optional). |
| void QXmppDiscoveryManager::setClientCapabilitiesNode | ( | const QString & | node | ) |
Sets the capabilities node of the local XMPP client.
By default this is "org.qxmpp.caps".
| QT_WARNING_POP void QXmppDiscoveryManager::setClientCategory | ( | const QString & | category | ) |
Sets the category of the local XMPP client.
You can find a list of valid categories at: http://xmpp.org/registrar/disco-categories.html
| void QXmppDiscoveryManager::setClientInfoForm | ( | const QXmppDataForm & | form | ) |
Sets the client's extended information form, as defined by XEP-0128: Service Discovery Extensions.
| void QXmppDiscoveryManager::setClientName | ( | const QString & | name | ) |
Sets the name of the local XMPP client.
| void QXmppDiscoveryManager::setClientType | ( | const QString & | type | ) |
Sets the type of the local XMPP client.
You can find a list of valid types at: http://xmpp.org/registrar/disco-categories.html
| void QXmppDiscoveryManager::setIdentities | ( | const QList< QXmppDiscoIdentity > & | identities | ) |
Sets the base identities of this client.
The identities are added to the service discovery information other entities can request.
| void QXmppDiscoveryManager::setInfoForms | ( | const QList< QXmppDataForm > & | dataForms | ) |
Sets the data forms for this client as defined in XEP-0128: Service Discovery Extensions.
The data forms are added to the service discovery information other entities can request.