QXmpp: QXmppUserTuneManager.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
QXmppUserTuneManager.h
1// SPDX-FileCopyrightText: 2021 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPUSERTUNEMANAGER_H
6#define QXMPPUSERTUNEMANAGER_H
7
8#include "QXmppClientExtension.h"
9#include "QXmppError.h"
10#include "QXmppPubSubEventHandler.h"
11
12#include <variant>
13
14class QXmppTuneItem;
15template<typename T>
16class QXmppTask;
17
18 class QXMPP_EXPORT QXmppUserTuneManager : public QXmppClientExtension, public QXmppPubSubEventHandler
19{
20 Q_OBJECT
21
22public:
23 using Item = QXmppTuneItem;
24 using GetResult = std::variant<Item, QXmppError>;
25 using PublishResult = std::variant<QString, QXmppError>;
26
27 QXmppUserTuneManager();
28
29 QStringList discoveryFeatures() const override;
30
31 auto request(const QString &jid) -> QXmppTask<GetResult>;
32 auto publish(const QXmppTuneItem &item) -> QXmppTask<PublishResult>;
33
34 Q_SIGNAL void itemReceived(const QString &jid, const QXmppTuneItem &item);
35
36protected:
38 bool handlePubSubEvent(const QDomElement &element, const QString &pubSubService, const QString &nodeName) override;
40};
41
42#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