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;
QXmppTask<GetResult> request(const QString &jid);
QXmppTask<PublishResult> publish(const QXmppTuneItem &);
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
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition QXmppClientExtension.h:33
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppPubSubEventHandler
Definition QXmppPubSubEventHandler.h:15
QXmppPubSubEventHandler::handlePubSubEvent
virtual bool handlePubSubEvent(const QDomElement &element, const QString &pubSubService, const QString &nodeName)=0
QXmppTask
Definition QXmppTask.h:62
QXmppTuneItem
Definition QXmppUserTuneItem.h:20
QXmppUserTuneManager
Definition QXmppUserTuneManager.h:19
QXmppUserTuneManager::PublishResult
std::variant< QString, QXmppError > PublishResult
Definition QXmppUserTuneManager.h:25
QXmppUserTuneManager::itemReceived
Q_SIGNAL void itemReceived(const QString &jid, const QXmppTuneItem &item)
QXmppUserTuneManager::GetResult
std::variant< Item, QXmppError > GetResult
Definition QXmppUserTuneManager.h:24