QXmpp Version: 1.10.0
QXmppDiscoveryManager.h
1// SPDX-FileCopyrightText: 2010 Manjeet Dahiya <manjeetdahiya@gmail.com>
2// SPDX-FileCopyrightText: 2021 Linus Jahn <lnj@kaidan.im>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPDISCOVERYMANAGER_H
7#define QXMPPDISCOVERYMANAGER_H
8
9#include "QXmppClientExtension.h"
10
11#include <variant>
12
13template<typename T>
14class QXmppTask;
15class QXmppDataForm;
17class QXmppDiscoveryManagerPrivate;
18struct QXmppError;
19
24
26{
27 Q_OBJECT
28
29public:
31 ~QXmppDiscoveryManager() override;
32
33 QXmppDiscoveryIq capabilities();
34
35 QString requestInfo(const QString &jid, const QString &node = QString());
36 QString requestItems(const QString &jid, const QString &node = QString());
37
38 using InfoResult = std::variant<QXmppDiscoveryIq, QXmppError>;
39 using ItemsResult = std::variant<QList<QXmppDiscoveryIq::Item>, QXmppError>;
40 QXmppTask<InfoResult> requestDiscoInfo(const QString &jid, const QString &node = {});
41 QXmppTask<ItemsResult> requestDiscoItems(const QString &jid, const QString &node = {});
42
43 QString clientCapabilitiesNode() const;
44 void setClientCapabilitiesNode(const QString &);
45
46 // http://xmpp.org/registrar/disco-categories.html#client
47 QString clientCategory() const;
48 void setClientCategory(const QString &);
49
50 void setClientName(const QString &);
51 QString clientName() const;
52
53 QString clientType() const;
54 void setClientType(const QString &);
55
56 QXmppDataForm clientInfoForm() const;
57 void setClientInfoForm(const QXmppDataForm &form);
58
60 QStringList discoveryFeatures() const override;
61 bool handleStanza(const QDomElement &element) override;
62 std::variant<QXmppDiscoveryIq, QXmppStanza::Error> handleIq(QXmppDiscoveryIq &&iq);
64
65Q_SIGNALS:
68
71
72private:
73 const std::unique_ptr<QXmppDiscoveryManagerPrivate> d;
74};
75
76#endif // QXMPPDISCOVERYMANAGER_H
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:32
virtual QStringList discoveryFeatures() const
Definition: QXmppClientExtension.cpp:22
virtual bool handleStanza(const QDomElement &stanza)
You need to implement this method to process incoming XMPP stanzas.
Definition: client/compat/removed_api.cpp:26
Definition: QXmppDataForm.h:27
Definition: QXmppDiscoveryIq.h:18
The QXmppDiscoveryManager class makes it possible to discover information about other entities as def...
Definition: QXmppDiscoveryManager.h:26
std::variant< QList< QXmppDiscoveryIq::Item >, QXmppError > ItemsResult
Definition: QXmppDiscoveryManager.h:39
std::variant< QXmppDiscoveryIq, QXmppError > InfoResult
Definition: QXmppDiscoveryManager.h:38
void itemsReceived(const QXmppDiscoveryIq &)
This signal is emitted when an items response is received.
void infoReceived(const QXmppDiscoveryIq &)
This signal is emitted when an information response is received.
Definition: QXmppTask.h:62
Definition: QXmppError.h:17