QXmpp: QXmppUserLocationManager Class Reference

QXmpp Version: 1.14.2

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

## Public Types
using | Item = QXmppGeolocItem
using | GetResult = std::variant<Item, QXmppError>
using | PublishResult = std::variant<QString, QXmppError>

## Public Member Functions
QStringList | discoveryFeatures () const override
auto | request (const QString &jid) -> QXmppTask< GetResult >
auto | publish (const Item &item) -> QXmppTask< PublishResult >
Q_SIGNAL void | itemReceived (const QString &jid, const QXmppGeolocItem &)
Public Member Functions inherited from QXmppClientExtension
| QXmppClientExtension ()
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.
Public Member Functions inherited from QXmppPubSubEventHandler
virtual bool | handlePubSubEvent (const QDomElement &element, const QString &pubSubService, const QString &nodeName)=0

## 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 QXmppUserLocationManager implements XEP-0080: User Location. You'll receive location updates from all presence subscriptions. You can publish location information on the user's account (publish()) and request location information from specific accounts (request()).

The manager needs to be added to the client first and also requires the QXmppPubSubManager.

QXmppClient client;
auto *pubSubManager = client.addNewExtension<QXmppPubSubManager>();
auto *locationManager = client.addNewExtension<QXmppUserLocationManager>();
QXmppClientExtension::client
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
QXmppPubSubManager
The QXmppPubSubManager aims to provide publish-subscribe functionality as specified in XEP-0060: Publ...
Definition QXmppPubSubManager.h:21

Since
  QXmpp 1.5

## Member Typedef Documentation

## ◆ GetResult

using QXmppUserLocationManager::GetResult = std::variant<Item, QXmppError>

Contains the User Location information or an error.

## ◆ Item

using QXmppUserLocationManager::Item = QXmppGeolocItem

Used pubsub item type.

## ◆ PublishResult

using QXmppUserLocationManager::PublishResult = std::variant<QString, QXmppError>

Contains the ID of the published item on success or a stanza error.

## Member Function Documentation

## ◆ discoveryFeatures()

QStringList QXmppUserLocationManager::discoveryFeatures | ( |  | ) | const
| overridevirtual

Returns the discovery features to add to the client.

Reimplemented from QXmppClientExtension.

## ◆ itemReceived()

Q_SIGNAL void QXmppUserLocationManager::itemReceived | ( | const QString & | jid,
|  | const QXmppGeolocItem & | )

Emitted whenever a XEP-0080: User Location items event arrives.

## ◆ publish()

auto QXmppUserLocationManager::publish | ( | const Item & | item | ) | -> QXmppTask< PublishResult >

Publishes User Location information on the user's account.

Parameters

  item | The User Location item to be published.

## ◆ request()

auto QXmppUserLocationManager::request | ( | const QString & | jid | ) | -> QXmppTask< GetResult >

Request User Location information from an account.

Parameters

  jid | The account JID to request.

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

- QXmppUserLocationManager.h
- QXmppUserLocationManager.cpp