diff options
| author | Cochise César <cochisecesar@zoho.com> | 2022-01-10 01:27:06 -0300 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-03-09 18:29:46 +0100 |
| commit | f2aadfefa283aafc88131c643b97acd28989ac20 (patch) | |
| tree | 2c5bfcf4f3634ba4435151ad1ba51321691d6ae4 /src/client/QXmppUserLocationManager.h | |
| parent | a69475d8b196605b19e532d62d1fc375630ea8f1 (diff) | |
| download | qxmpp-f2aadfefa283aafc88131c643b97acd28989ac20.tar.gz | |
Implement XEP-0080: User Location
Diffstat (limited to 'src/client/QXmppUserLocationManager.h')
| -rw-r--r-- | src/client/QXmppUserLocationManager.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/client/QXmppUserLocationManager.h b/src/client/QXmppUserLocationManager.h new file mode 100644 index 00000000..9033d512 --- /dev/null +++ b/src/client/QXmppUserLocationManager.h @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im> +// SPDX-FileCopyrightText: 2022 Cochise César <cochisecesar@zoho.com> +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef QXMPPUSERLOCATIONMANAGER_H +#define QXMPPUSERLOCATIONMANAGER_H + +#include "QXmppPubSubEventManager.h" + +#include <variant> + +class QXmppGeolocItem; + +class QXMPP_EXPORT QXmppUserLocationManager : public QXmppPubSubEventManager +{ + Q_OBJECT + +public: + using Item = QXmppGeolocItem; + using GetResult = std::variant<Item, QXmppStanza::Error>; + using PublishResult = std::variant<QString, QXmppStanza::Error>; + + QXmppUserLocationManager(); + + QStringList discoveryFeatures() const override; + + QFuture<GetResult> request(const QString &jid); + QFuture<PublishResult> publish(const Item &); + + Q_SIGNAL void itemReceived(const QString &jid, const QXmppGeolocItem &); + +protected: + /// \cond + bool handlePubSubEvent(const QDomElement &element, const QString &pubSubService, const QString &nodeName) override; + /// \endcond +}; + +#endif // QXMPPUSERLOCATIONMANAGER_H |
