QXmpp: QXmppMixIq_p.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
QXmppMixIq_p.h
1// SPDX-FileCopyrightText: 2023 Melvin Keskin <melvo@olomono.de>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPMIXIQ_P_H
6#define QXMPPMIXIQ_P_H
7
8#include "QXmppIq.h"
9#include "QXmppMixConfigItem.h"
10#include "QXmppMixInvitation.h"
11
12#include "Enums.h"
13
14class QXMPP_EXPORT QXmppMixSubscriptionUpdateIq : public QXmppIq
15{
16public:
17 QXmppMixSubscriptionUpdateIq();
18
19 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppMixSubscriptionUpdateIq)
20
21 QXmppMixConfigItem::Nodes additions() const;
22 void setAdditions(QXmppMixConfigItem::Nodes);
23
24 QXmppMixConfigItem::Nodes removals() const;
25 void setRemovals(QXmppMixConfigItem::Nodes);
26
27 static bool isMixSubscriptionUpdateIq(const QDomElement &);
28
29protected:
30 void parseElementFromChild(const QDomElement &) override;
31 void toXmlElementFromChild(QXmlStreamWriter *) const override;
32
33private:
34 QXmppMixConfigItem::Nodes m_additions;
35 QXmppMixConfigItem::Nodes m_removals;
36};
37
38class QXMPP_EXPORT QXmppMixInvitationRequestIq : public QXmppIq
39{
40public:
41 QXmppMixInvitationRequestIq();
42
43 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppMixInvitationRequestIq)
44
45 QString inviteeJid() const;
46 void setInviteeJid(const QString &);
47
48 static bool isMixInvitationRequestIq(const QDomElement &);
49
50protected:
51 void parseElementFromChild(const QDomElement &) override;
52 void toXmlElementFromChild(QXmlStreamWriter *) const override;
53
54private:
55 QString m_inviteeJid;
56};
57
58class QXMPP_EXPORT QXmppMixInvitationResponseIq : public QXmppIq
59{
60public:
61 QXmppMixInvitationResponseIq();
62
63 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppMixInvitationResponseIq)
64
65 QXmppMixInvitation invitation() const;
66 void setInvitation(const QXmppMixInvitation &);
67
68 static bool isMixInvitationResponseIq(const QDomElement &);
69
70protected:
71 void parseElementFromChild(const QDomElement &) override;
72 void toXmlElementFromChild(QXmlStreamWriter *) const override;
73
74private:
75 QXmppMixInvitation m_invitation;
76};
77
78namespace QXmpp::Private {
79
80template<>
81struct Enums::Data<QXmppMixConfigItem::Node> {
82 using enum QXmppMixConfigItem::Node;
83 static constexpr bool IsFlags = true;
84 static constexpr auto Values = makeValues<QXmppMixConfigItem::Node>({
85 { AllowedJids, ns_mix_node_allowed },
86 { AvatarData, ns_user_avatar_data },
87 { AvatarMetadata, ns_user_avatar_metadata },
88 { BannedJids, ns_mix_node_banned },
89 { Configuration, ns_mix_node_config },
90 { Information, ns_mix_node_info },
91 { JidMap, ns_mix_node_jidmap },
92 { Messages, ns_mix_node_messages },
93 { Participants, ns_mix_node_participants },
94 { Presence, ns_mix_node_presence },
95 });
96};
97
98} // namespace QXmpp::Private
99
100#endif // QXMPPMIXIQ_P_H
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition QXmppIq.h:23
QXmppMixConfigItem::Node
Node
Definition QXmppMixConfigItem.h:25