Loading...
Searching...
No Matches
QXmppUserTuneManager.h
// SPDX-FileCopyrightText: 2021 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPUSERTUNEMANAGER_H
#define QXMPPUSERTUNEMANAGER_H
#include "QXmppClientExtension.h"
#include "QXmppError.h"
#include "QXmppPubSubEventHandler.h"
#include <variant>
class QXmppTuneItem;
template<typename T>
class QXmppTask;
class QXMPP_EXPORT QXmppUserTuneManager : public QXmppClientExtension, public QXmppPubSubEventHandler
{
Q_OBJECT
public:
using Item = QXmppTuneItem;
using GetResult = std::variant<Item, QXmppError>;
using PublishResult = std::variant<QString, QXmppError>;
QXmppUserTuneManager();
QStringList discoveryFeatures() const override;
auto request(const QString &jid) -> QXmppTask<GetResult>;
auto publish(const QXmppTuneItem &item) -> QXmppTask<PublishResult>;
Q_SIGNAL void itemReceived(const QString &jid, const QXmppTuneItem &item);
protected:
bool handlePubSubEvent(const QDomElement &element, const QString &pubSubService, const QString &nodeName) override;
};
#endif // QXMPPUSERTUNEMANAGER_H
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::QXmppClientExtension
QXmppClientExtension()
Definition QXmppClientExtension.cpp:12
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
QXmppTuneItem
Definition QXmppUserTuneItem.h:20
QXmppUserTuneManager::GetResult
std::variant< Item, QXmppError > GetResult
Definition QXmppUserTuneManager.h:24
QXmppUserTuneManager::request
auto request(const QString &jid) -> QXmppTask< GetResult >
Definition QXmppUserTuneManager.cpp:80
QXmppUserTuneManager::itemReceived
Q_SIGNAL void itemReceived(const QString &jid, const QXmppTuneItem &item)
QXmppUserTuneManager::publish
auto publish(const QXmppTuneItem &item) -> QXmppTask< PublishResult >
Definition QXmppUserTuneManager.cpp:91
QXmppUserTuneManager::Item
QXmppTuneItem Item
Definition QXmppUserTuneManager.h:23
QXmppUserTuneManager::PublishResult
std::variant< QString, QXmppError > PublishResult
Definition QXmppUserTuneManager.h:25