QXmpp Version: 1.10.0
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
16
17class QXMPP_EXPORT QXmppMucItem
18{
19public:
22 UnspecifiedAffiliation,
23 OutcastAffiliation,
24 NoAffiliation,
25 MemberAffiliation,
26 AdminAffiliation,
27 OwnerAffiliation
28 };
29
31 enum Role {
32 UnspecifiedRole,
33 NoRole,
34 VisitorRole,
35 ParticipantRole,
36 ModeratorRole
37 };
38
40 bool isNull() const;
41
42 QString actor() const;
43 void setActor(const QString &actor);
44
45 Affiliation affiliation() const;
46 void setAffiliation(Affiliation affiliation);
47
48 QString jid() const;
49 void setJid(const QString &jid);
50
51 QString nick() const;
52 void setNick(const QString &nick);
53
54 QString reason() const;
55 void setReason(const QString &reason);
56
57 Role role() const;
58 void setRole(Role role);
59
61 void parse(const QDomElement &element);
62 void toXml(QXmlStreamWriter *writer) const;
63
64 static Affiliation affiliationFromString(const QString &affiliationStr);
65 static QString affiliationToString(Affiliation affiliation);
66 static Role roleFromString(const QString &roleStr);
67 static QString roleToString(Role role);
69private:
70 QString m_actor;
71 Affiliation m_affiliation;
72 QString m_jid;
73 QString m_nick;
74 QString m_reason;
75 Role m_role;
76};
77
84
85class QXMPP_EXPORT QXmppMucAdminIq : public QXmppIq
86{
87public:
88 QList<QXmppMucItem> items() const;
89 void setItems(const QList<QXmppMucItem> &items);
90
92 static bool isMucAdminIq(const QDomElement &element);
94
95protected:
97 void parseElementFromChild(const QDomElement &element) override;
98 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
100
101private:
102 QList<QXmppMucItem> m_items;
103};
104
112
113class QXMPP_EXPORT QXmppMucOwnerIq : public QXmppIq
114{
115public:
116 QXmppDataForm form() const;
117 void setForm(const QXmppDataForm &form);
118
120 static bool isMucOwnerIq(const QDomElement &element);
122
123protected:
125 void parseElementFromChild(const QDomElement &element) override;
126 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
128
129private:
130 QXmppDataForm m_form;
131};
132
133#endif
Definition: QXmppDataForm.h:27
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:23
The QXmppMucAdminIq class represents a chat room administration IQ as defined by XEP-0045: Multi-User...
Definition: QXmppMucIq.h:86
The QXmppMucItem class represents a chat room "item".
Definition: QXmppMucIq.h:18
Affiliation
This enum is used to represent long-lived permissions in a room (affiliations).
Definition: QXmppMucIq.h:21
Role
This enum is used to represent short-lived permissions in a room (roles).
Definition: QXmppMucIq.h:31
The QXmppMucOwnerIq class represents a chat room configuration IQ as defined by XEP-0045: Multi-User ...
Definition: QXmppMucIq.h:114