QXmpp Version: 1.10.0
QXmppDiscoveryIq.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPDISCOVERY_H
6#define QXMPPDISCOVERY_H
7
8#include "QXmppDataForm.h"
9#include "QXmppIq.h"
10
11#include <QSharedDataPointer>
12
13class QXmppDiscoveryIdentityPrivate;
14class QXmppDiscoveryItemPrivate;
15class QXmppDiscoveryIqPrivate;
16
17class QXMPP_EXPORT QXmppDiscoveryIq : public QXmppIq
18{
19public:
20 class QXMPP_EXPORT Identity
21 {
22 public:
23 Identity();
24 Identity(const Identity &other);
26 ~Identity();
27
28 Identity &operator=(const Identity &other);
30
31 QString category() const;
32 void setCategory(const QString &category);
33
34 QString language() const;
35 void setLanguage(const QString &language);
36
37 QString name() const;
38 void setName(const QString &name);
39
40 QString type() const;
41 void setType(const QString &type);
42
43 private:
44 QSharedDataPointer<QXmppDiscoveryIdentityPrivate> d;
45 };
46
47 class QXMPP_EXPORT Item
48 {
49 public:
50 Item();
51 Item(const Item &);
53 ~Item();
54
55 Item &operator=(const Item &);
57
58 QString jid() const;
59 void setJid(const QString &jid);
60
61 QString name() const;
62 void setName(const QString &name);
63
64 QString node() const;
65 void setNode(const QString &node);
66
67 private:
68 QSharedDataPointer<QXmppDiscoveryItemPrivate> d;
69 };
70
74 ~QXmppDiscoveryIq() override;
75
78
79 enum QueryType {
80 InfoQuery,
81 ItemsQuery
82 };
83
84 QStringList features() const;
85 void setFeatures(const QStringList &features);
86
87 QList<QXmppDiscoveryIq::Identity> identities() const;
88 void setIdentities(const QList<QXmppDiscoveryIq::Identity> &identities);
89
90 QList<QXmppDiscoveryIq::Item> items() const;
91 void setItems(const QList<QXmppDiscoveryIq::Item> &items);
92
93 QXmppDataForm form() const;
94 void setForm(const QXmppDataForm &form);
95
96 QString queryNode() const;
97 void setQueryNode(const QString &node);
98
99 enum QueryType queryType() const;
100 void setQueryType(enum QueryType type);
101
102 QByteArray verificationString() const;
103
104 static bool isDiscoveryIq(const QDomElement &element);
106 static bool checkIqType(const QString &tagName, const QString &xmlNamespace);
107
108protected:
109 void parseElementFromChild(const QDomElement &element) override;
110 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
112
113private:
114 QSharedDataPointer<QXmppDiscoveryIqPrivate> d;
115};
116
117#endif
Definition: QXmppDataForm.h:27
Identity represents one of possibly multiple identities of an XMPP entity obtained from a service dis...
Definition: QXmppDiscoveryIq.h:21
Identity & operator=(Identity &&)
Default move-assignment operator.
Identity(const Identity &other)
Default copy-constructor.
Identity(Identity &&)
Default move-constructor.
Identity & operator=(const Identity &other)
Default assignment operator.
Definition: QXmppDiscoveryIq.h:48
Item(const Item &)
Default copy-constructor.
Item & operator=(const Item &)
Default assignment operator.
Item(Item &&)
Default move-constructor.
Item & operator=(Item &&)
Default move-assignment operator.
Definition: QXmppDiscoveryIq.h:18
QXmppDiscoveryIq & operator=(QXmppDiscoveryIq &&)
Default move-assignment operator.
QXmppDiscoveryIq(const QXmppDiscoveryIq &)
Default copy-constructor.
QXmppDiscoveryIq(QXmppDiscoveryIq &&)
Default move-constructor.
QXmppDiscoveryIq & operator=(const QXmppDiscoveryIq &)
Default assignment operator.
QueryType
Definition: QXmppDiscoveryIq.h:79
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:23
void setType(QXmppIq::Type)
Definition: QXmppIq.cpp:65
QXmppIq::Type type() const
Definition: QXmppIq.cpp:55