Loading...
Searching...
No Matches
QXmppMucIq.h
// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPMUCIQ_H
#define QXMPPMUCIQ_H
#include "QXmppDataForm.h"
#include "QXmppIq.h"
class QXMPP_EXPORT QXmppMucItem
{
public:
enum Affiliation {
UnspecifiedAffiliation,
OutcastAffiliation,
NoAffiliation,
MemberAffiliation,
AdminAffiliation,
OwnerAffiliation
};
enum Role {
UnspecifiedRole,
NoRole,
VisitorRole,
ParticipantRole,
ModeratorRole
};
QXmppMucItem();
bool isNull() const;
QString actor() const;
void setActor(const QString &actor);
Affiliation affiliation() const;
void setAffiliation(Affiliation affiliation);
QString jid() const;
void setJid(const QString &jid);
QString nick() const;
void setNick(const QString &nick);
QString reason() const;
void setReason(const QString &reason);
Role role() const;
void setRole(Role role);
static constexpr std::tuple XmlTag = { u"item", QXmpp::Private::ns_muc_admin };
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
private:
QString m_actor;
Affiliation m_affiliation;
QString m_jid;
QString m_nick;
QString m_reason;
Role m_role;
};
class QXMPP_EXPORT QXmppMucAdminIq : public QXmppIq
{
public:
QList<QXmppMucItem> items() const;
void setItems(const QList<QXmppMucItem> &items);
static bool isMucAdminIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
QList<QXmppMucItem> m_items;
};
class QXMPP_EXPORT QXmppMucOwnerIq : public QXmppIq
{
public:
QXmppDataForm form() const;
void setForm(const QXmppDataForm &form);
static bool isMucOwnerIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
QXmppDataForm m_form;
};
#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