QXmpp: QXmppPubSubAffiliation.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppPubSubAffiliation.h
1// SPDX-FileCopyrightText: 2020 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPPUBSUBAFFILIATION_H
6#define QXMPPPUBSUBAFFILIATION_H
7
8#include "QXmppGlobal.h"
9
10#include <QMetaType>
11#include <QSharedDataPointer>
12
13class QXmppPubSubAffiliationPrivate;
14class QDomElement;
15class QXmlStreamWriter;
16
17 class QXMPP_EXPORT QXmppPubSubAffiliation
18{
19public:
24 enum Affiliation {
25 None,
26 Member,
27 Outcast,
28 Owner,
29 Publisher,
30 PublishOnly,
31 };
32
33 QXmppPubSubAffiliation(Affiliation = None,
34 const QString &node = {},
35 const QString &jid = {});
36 QXmppPubSubAffiliation(const QXmppPubSubAffiliation &);
37 QXmppPubSubAffiliation(QXmppPubSubAffiliation &&);
38 ~QXmppPubSubAffiliation();
39
40 QXmppPubSubAffiliation &operator=(const QXmppPubSubAffiliation &);
41 QXmppPubSubAffiliation &operator=(QXmppPubSubAffiliation &&);
42
43 Affiliation type() const;
44 void setType(Affiliation type);
45
46 QString node() const;
47 void setNode(const QString &node);
48
49 QString jid() const;
50 void setJid(const QString &jid);
51
52 static bool isAffiliation(const QDomElement &);
53
55 void parse(const QDomElement &);
56 void toXml(QXmlStreamWriter *) const;
58
59private:
60 QSharedDataPointer<QXmppPubSubAffiliationPrivate> d;
61};
62
63Q_DECLARE_METATYPE(QXmppPubSubAffiliation)
64Q_DECLARE_METATYPE(QXmppPubSubAffiliation::Affiliation)
65
66#endif // QXMPPPUBSUBAFFILIATION_H
QXmppPubSubAffiliation
Definition QXmppPubSubAffiliation.h:18
QXmppPubSubAffiliation::setJid
void setJid(const QString &jid)
Definition QXmppPubSubAffiliation.cpp:127
QXmppPubSubAffiliation::type
Affiliation type() const
Definition QXmppPubSubAffiliation.cpp:87
QXmppPubSubAffiliation::QXmppPubSubAffiliation
QXmppPubSubAffiliation(const QXmppPubSubAffiliation &)
Copy constructor.
QXmppPubSubAffiliation::jid
QString jid() const
Definition QXmppPubSubAffiliation.cpp:119
QXmppPubSubAffiliation::operator=
QXmppPubSubAffiliation & operator=(QXmppPubSubAffiliation &&)
Move-assignment operator.
QXmppPubSubAffiliation::QXmppPubSubAffiliation
QXmppPubSubAffiliation(Affiliation=None, const QString &node={}, const QString &jid={})
Definition QXmppPubSubAffiliation.cpp:67
QXmppPubSubAffiliation::operator=
QXmppPubSubAffiliation & operator=(const QXmppPubSubAffiliation &)
Assignment operator.
QXmppPubSubAffiliation::isAffiliation
static bool isAffiliation(const QDomElement &)
Definition QXmppPubSubAffiliation.cpp:135
QXmppPubSubAffiliation::setType
void setType(Affiliation type)
Definition QXmppPubSubAffiliation.cpp:95
QXmppPubSubAffiliation::QXmppPubSubAffiliation
QXmppPubSubAffiliation(QXmppPubSubAffiliation &&)
Move-constructor.
QXmppPubSubAffiliation::Affiliation
Affiliation
Definition QXmppPubSubAffiliation.h:24
QXmppPubSubAffiliation::None
@ None
No affiliation, but may subscribe.
Definition QXmppPubSubAffiliation.h:25
QXmppPubSubAffiliation::Member
@ Member
Active member, is subscribed, can read.
Definition QXmppPubSubAffiliation.h:26
QXmppPubSubAffiliation::Publisher
@ Publisher
May read and publish, but cannot configure node.
Definition QXmppPubSubAffiliation.h:29
QXmppPubSubAffiliation::Outcast
@ Outcast
Cannot subscribe, cannot read, 'banned'.
Definition QXmppPubSubAffiliation.h:27
QXmppPubSubAffiliation::Owner
@ Owner
Highest privileges, can read, publish & configure.
Definition QXmppPubSubAffiliation.h:28
QXmppPubSubAffiliation::PublishOnly
@ PublishOnly
Can only publish, cannot subscribe.
Definition QXmppPubSubAffiliation.h:30
QXmppPubSubAffiliation::node
QString node() const
Definition QXmppPubSubAffiliation.cpp:103
QXmppPubSubAffiliation::setNode
void setNode(const QString &node)
Definition QXmppPubSubAffiliation.cpp:111