QXmpp: QXmppUserLocationManager.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppUserLocationManager.h
1// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
2// SPDX-FileCopyrightText: 2022 Cochise César <cochisecesar@zoho.com>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPUSERLOCATIONMANAGER_H
7#define QXMPPUSERLOCATIONMANAGER_H
8
9#include "QXmppClientExtension.h"
10#include "QXmppError.h"
11#include "QXmppPubSubEventHandler.h"
12
13#include <variant>
14
15template<typename T>
16class QXmppTask;
17class QXmppGeolocItem;
18
19 class QXMPP_EXPORT QXmppUserLocationManager : public QXmppClientExtension, public QXmppPubSubEventHandler
20{
21 Q_OBJECT
22
23public:
24 using Item = QXmppGeolocItem;
25 using GetResult = std::variant<Item, QXmppError>;
26 using PublishResult = std::variant<QString, QXmppError>;
27
28 QXmppUserLocationManager();
29
30 QStringList discoveryFeatures() const override;
31
32 auto request(const QString &jid) -> QXmppTask<GetResult>;
33 auto publish(const Item &item) -> QXmppTask<PublishResult>;
34
35 Q_SIGNAL void itemReceived(const QString &jid, const QXmppGeolocItem &);
36
37protected:
39 bool handlePubSubEvent(const QDomElement &element, const QString &pubSubService, const QString &nodeName) override;
41};
42
43#endif // QXMPPUSERLOCATIONMANAGER_H
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::QXmppClientExtension
QXmppClientExtension()
Definition QXmppClientExtension.cpp:12
QXmppGeolocItem
Definition QXmppGeolocItem.h:18
QXmppPubSubEventHandler
Definition QXmppPubSubEventHandler.h:15
QXmppPubSubEventHandler::handlePubSubEvent
virtual bool handlePubSubEvent(const QDomElement &element, const QString &pubSubService, const QString &nodeName)=0
QXmppTask
Definition QXmppTask.h:46
QXmppUserLocationManager::PublishResult
std::variant< QString, QXmppError > PublishResult
Definition QXmppUserLocationManager.h:26
QXmppUserLocationManager::itemReceived
Q_SIGNAL void itemReceived(const QString &jid, const QXmppGeolocItem &)
QXmppUserLocationManager::GetResult
std::variant< Item, QXmppError > GetResult
Definition QXmppUserLocationManager.h:25
QXmppUserLocationManager::publish
auto publish(const Item &item) -> QXmppTask< PublishResult >
Definition QXmppUserLocationManager.cpp:90
QXmppUserLocationManager::request
auto request(const QString &jid) -> QXmppTask< GetResult >
Definition QXmppUserLocationManager.cpp:79
QXmppUserLocationManager::Item
QXmppGeolocItem Item
Definition QXmppUserLocationManager.h:24