Loading...
Searching...
No Matches
QXmppUserLocationManager.h
// 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 "QXmppClientExtension.h"
#include "QXmppError.h"
#include "QXmppPubSubEventHandler.h"
#include <variant>
template<typename T>
class QXmppTask;
class QXmppGeolocItem;
class QXMPP_EXPORT QXmppUserLocationManager : public QXmppClientExtension, public QXmppPubSubEventHandler
{
Q_OBJECT
public:
using Item = QXmppGeolocItem;
using GetResult = std::variant<Item, QXmppError>;
using PublishResult = std::variant<QString, QXmppError>;
QXmppUserLocationManager();
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 &);
protected:
bool handlePubSubEvent(const QDomElement &element, const QString &pubSubService, const QString &nodeName) override;
};
#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