QXmpp Version: 1.5.6
Loading...
Searching...
No Matches
QXmppRosterIq.h
1// SPDX-FileCopyrightText: 2009 Manjeet Dahiya <manjeetdahiya@gmail.com>
2// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPROSTERIQ_H
7#define QXMPPROSTERIQ_H
8
9#include "QXmppIq.h"
10
11#include <QList>
12#include <QSet>
13#include <QSharedDataPointer>
14
15class QXmppRosterIqPrivate;
16
20
21class QXMPP_EXPORT QXmppRosterIq : public QXmppIq
22{
23public:
24 class ItemPrivate;
25
27 class QXMPP_EXPORT Item
28 {
29 public:
32 None = 0,
35 From = 1,
37 To = 2,
39 Both = 3,
41 Remove = 4,
42 NotSet = 8
43 };
44
45 Item();
46 Item(const Item &other);
48 ~Item();
49
50 Item &operator=(const Item &other);
52
53 QString bareJid() const;
54 QSet<QString> groups() const;
55 QString name() const;
56 QString subscriptionStatus() const;
57 SubscriptionType subscriptionType() const;
58 bool isApproved() const;
59
60 void setBareJid(const QString &);
61 void setGroups(const QSet<QString> &);
62 void setName(const QString &);
63 void setSubscriptionStatus(const QString &);
64 void setSubscriptionType(SubscriptionType);
65 void setIsApproved(bool);
66
67 // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements
68 bool isMixChannel() const;
69 void setIsMixChannel(bool);
70
71 QString mixParticipantId() const;
72 void setMixParticipantId(const QString &);
73
75 void parse(const QDomElement &element);
76 void toXml(QXmlStreamWriter *writer) const;
78
79 private:
80 QString getSubscriptionTypeStr() const;
81 void setSubscriptionTypeFromStr(const QString &);
82
83 QSharedDataPointer<ItemPrivate> d;
84 };
85
89 ~QXmppRosterIq() override;
90
93
94 QString version() const;
95 void setVersion(const QString &);
96
97 void addItem(const Item &);
98 QList<Item> items() const;
99
100 // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements
101 bool mixAnnotate() const;
102 void setMixAnnotate(bool);
103
105 static bool isRosterIq(const QDomElement &element);
107
108protected:
110 void parseElementFromChild(const QDomElement &element) override;
111 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
113
114private:
115 QSharedDataPointer<QXmppRosterIqPrivate> d;
116};
117
118#endif // QXMPPROSTERIQ_H
The QXmppIq class is the base class for all IQs.
Definition QXmppIq.h:23
virtual void parse(const QDomElement &)=0
virtual void toXml(QXmlStreamWriter *writer) const =0
The QXmppRosterIq::Item class represents a roster entry.
Definition QXmppRosterIq.h:28
SubscriptionType
An enumeration for type of subscription with the bareJid in the roster.
Definition QXmppRosterIq.h:31
Item(Item &&)
Default move-constructor.
Item & operator=(const Item &other)
Default assignment operator.
Item & operator=(Item &&)
Default assignment operator.
Item(const Item &other)
Default copy-constructor.
The QXmppRosterIq class represents a roster IQ.
Definition QXmppRosterIq.h:22
QXmppRosterIq(const QXmppRosterIq &)
Default copy-constructor.
QXmppRosterIq & operator=(const QXmppRosterIq &)
Default assignment operator.
QXmppRosterIq & operator=(QXmppRosterIq &&)
Default move-assignment operator.
QXmppRosterIq(QXmppRosterIq &&)
Default move-constructor.