Loading...
Searching...
No Matches
QXmppPubSubAffiliation.h
// SPDX-FileCopyrightText: 2020 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPPUBSUBAFFILIATION_H
#define QXMPPPUBSUBAFFILIATION_H
#include "QXmppGlobal.h"
#include <QMetaType>
#include <QSharedDataPointer>
class QXmppPubSubAffiliationPrivate;
class QDomElement;
class QXmlStreamWriter;
class QXMPP_EXPORT QXmppPubSubAffiliation
{
public:
enum Affiliation {
None,
Member,
Outcast,
Owner,
Publisher,
PublishOnly,
};
QXmppPubSubAffiliation(Affiliation = None,
const QString &node = {},
const QString &jid = {});
QXmppPubSubAffiliation(const QXmppPubSubAffiliation &);
QXmppPubSubAffiliation(QXmppPubSubAffiliation &&);
~QXmppPubSubAffiliation();
QXmppPubSubAffiliation &operator=(const QXmppPubSubAffiliation &);
QXmppPubSubAffiliation &operator=(QXmppPubSubAffiliation &&);
Affiliation type() const;
void setType(Affiliation type);
QString node() const;
void setNode(const QString &node);
QString jid() const;
void setJid(const QString &jid);
static bool isAffiliation(const QDomElement &);
void parse(const QDomElement &);
void toXml(QXmlStreamWriter *) const;
private:
QSharedDataPointer<QXmppPubSubAffiliationPrivate> d;
};
Q_DECLARE_METATYPE(QXmppPubSubAffiliation)
Q_DECLARE_METATYPE(QXmppPubSubAffiliation::Affiliation)
#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