QXmpp: QXmppMucIq.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppMucIq.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPMUCIQ_H
6#define QXMPPMUCIQ_H
7
8#include "QXmppDataForm.h"
9#include "QXmppIq.h"
10
18 class QXMPP_EXPORT QXmppMucItem
19{
20public:
22 enum Affiliation {
23 UnspecifiedAffiliation,
24 OutcastAffiliation,
25 NoAffiliation,
26 MemberAffiliation,
27 AdminAffiliation,
28 OwnerAffiliation
29 };
30
32 enum Role {
33 UnspecifiedRole,
34 NoRole,
35 VisitorRole,
36 ParticipantRole,
37 ModeratorRole
38 };
39
40 QXmppMucItem();
41 bool isNull() const;
42
43 QString actor() const;
44 void setActor(const QString &actor);
45
46 Affiliation affiliation() const;
47 void setAffiliation(Affiliation affiliation);
48
49 QString jid() const;
50 void setJid(const QString &jid);
51
52 QString nick() const;
53 void setNick(const QString &nick);
54
55 QString reason() const;
56 void setReason(const QString &reason);
57
58 Role role() const;
59 void setRole(Role role);
60
62 static constexpr std::tuple XmlTag = { u"item", QXmpp::Private::ns_muc_admin };
63 void parse(const QDomElement &element);
64 void toXml(QXmlStreamWriter *writer) const;
66
67private:
68 QString m_actor;
69 Affiliation m_affiliation;
70 QString m_jid;
71 QString m_nick;
72 QString m_reason;
73 Role m_role;
74};
75
84 class QXMPP_EXPORT QXmppMucAdminIq : public QXmppIq
85{
86public:
87 QList<QXmppMucItem> items() const;
88 void setItems(const QList<QXmppMucItem> &items);
89
91 static bool isMucAdminIq(const QDomElement &element);
93
94protected:
96 void parseElementFromChild(const QDomElement &element) override;
97 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
99
100private:
101 QList<QXmppMucItem> m_items;
102};
103
112 class QXMPP_EXPORT QXmppMucOwnerIq : public QXmppIq
113{
114public:
115 QXmppDataForm form() const;
116 void setForm(const QXmppDataForm &form);
117
119 static bool isMucOwnerIq(const QDomElement &element);
121
122protected:
124 void parseElementFromChild(const QDomElement &element) override;
125 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
127
128private:
129 QXmppDataForm m_form;
130};
131
132#endif
QXmppDataForm
Definition QXmppDataForm.h:28
QXmppIq::QXmppIq
QXmppIq(QXmppIq::Type type=QXmppIq::Get)
Definition QXmppIq.cpp:39
QXmppMucAdminIq
The QXmppMucAdminIq class represents a chat room administration IQ as defined by XEP-0045: Multi-User...
Definition QXmppMucIq.h:85
QXmppMucAdminIq::setItems
void setItems(const QList< QXmppMucItem > &items)
Sets the IQ's items.
Definition QXmppMucIq.cpp:173
QXmppMucAdminIq::items
QList< QXmppMucItem > items() const
Returns the IQ's items.
Definition QXmppMucIq.cpp:167
QXmppMucItem
The QXmppMucItem class represents a chat room "item".
Definition QXmppMucIq.h:19
QXmppMucItem::Affiliation
Affiliation
This enum is used to represent long-lived permissions in a room (affiliations).
Definition QXmppMucIq.h:22
QXmppMucItem::Role
Role
This enum is used to represent short-lived permissions in a room (roles).
Definition QXmppMucIq.h:32
QXmppMucOwnerIq
The QXmppMucOwnerIq class represents a chat room configuration IQ as defined by XEP-0045: Multi-User ...
Definition QXmppMucIq.h:113
QXmppMucOwnerIq::setForm
void setForm(const QXmppDataForm &form)
Sets the IQ's data form.
Definition QXmppMucIq.cpp:204
QXmppMucOwnerIq::form
QXmppDataForm form() const
Returns the IQ's data form.
Definition QXmppMucIq.cpp:198