QXmpp  Version: 1.10.4
QXmppPresence.h
1 // SPDX-FileCopyrightText: 2009 Manjeet Dahiya <manjeetdahiya@gmail.com>
2 // SPDX-FileCopyrightText: 2022 Melvin Keskin <melvo@olomono.de>
3 // SPDX-FileCopyrightText: 2024 Filipe Azevedo <pasnox@gmail.com>
4 //
5 // SPDX-License-Identifier: LGPL-2.1-or-later
6 
7 #ifndef QXMPPPRESENCE_H
8 #define QXMPPPRESENCE_H
9 
10 #include "QXmppJingleIq.h"
11 #include "QXmppMucIq.h"
12 #include "QXmppStanza.h"
13 
14 class QXmppPresencePrivate;
15 
21 class QXMPP_EXPORT QXmppPresence : public QXmppStanza
22 {
23 public:
25  enum Type {
26  Error = 0,
33  Probe
34  };
35 
38  Online = 0,
39  Away,
40  XA,
41  DND,
42  Chat,
43  Invisible
44  };
45 
49  VCardUpdateNone = 0,
52  VCardUpdateNotReady
53 
56  };
57 
59  QXmppPresence(const QXmppPresence &other);
61  ~QXmppPresence() override;
62 
63  QXmppPresence &operator=(const QXmppPresence &other);
65 
66  bool isXmppStanza() const override;
67 
68  AvailableStatusType availableStatusType() const;
69  void setAvailableStatusType(AvailableStatusType type);
70 
71  int priority() const;
72  void setPriority(int priority);
73 
74  QXmppPresence::Type type() const;
75  void setType(QXmppPresence::Type);
76 
77  QString statusText() const;
78  void setStatusText(const QString &statusText);
79 
80  // XEP-0045: Multi-User Chat
81  QXmppMucItem mucItem() const;
82  void setMucItem(const QXmppMucItem &item);
83 
84  QString mucPassword() const;
85  void setMucPassword(const QString &password);
86 
87  QList<int> mucStatusCodes() const;
88  void setMucStatusCodes(const QList<int> &codes);
89 
90  bool isMucSupported() const;
91  void setMucSupported(bool supported);
92 
93  // XEP-0153: vCard-Based Avatars
94  QByteArray photoHash() const;
95  void setPhotoHash(const QByteArray &);
96 
97  VCardUpdateType vCardUpdateType() const;
98  void setVCardUpdateType(VCardUpdateType type);
99 
100  // XEP-0115: Entity Capabilities
101  QString capabilityHash() const;
102  void setCapabilityHash(const QString &);
103 
104  QString capabilityNode() const;
105  void setCapabilityNode(const QString &);
106 
107  QByteArray capabilityVer() const;
108  void setCapabilityVer(const QByteArray &);
109 
110  QStringList capabilityExt() const;
111 
112  // XEP-0272: Multiparty Jingle (Muji)
113  bool isPreparingMujiSession() const;
114  void setIsPreparingMujiSession(bool isPreparingMujiSession);
115 
116  QVector<QXmppJingleIq::Content> mujiContents() const;
117  void setMujiContents(const QVector<QXmppJingleIq::Content> &mujiContents);
118 
119  // XEP-0283: Moved
120  QString oldJid() const;
121  void setOldJid(const QString &oldJid);
122 
123  // XEP-0319: Last User Interaction in Presence
124  QDateTime lastUserInteraction() const;
125  void setLastUserInteraction(const QDateTime &);
126 
127  // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements
128  QString mixUserJid() const;
129  void setMixUserJid(const QString &);
130 
131  QString mixUserNick() const;
132  void setMixUserNick(const QString &);
133 
135  void parse(const QDomElement &element) override;
136  void toXml(QXmlStreamWriter *writer) const override;
138 
139 private:
141  void parseExtension(const QDomElement &element, QXmppElementList &unknownElements);
143 
144  QSharedDataPointer<QXmppPresencePrivate> d;
145 };
146 
147 #endif // QXMPPPRESENCE_H
The sender is unsubscribing from another entity&#39;s presence.
Definition: QXmppPresence.h:31
virtual bool isXmppStanza() const
Definition: QXmppNonza.h:19
AvailableStatusType
This enum is used to describe an availability status.
Definition: QXmppPresence.h:37
The entity or resource is busy ("Do Not Disturb").
Definition: QXmppPresence.h:41
The entity or resource is actively interested in chatting.
Definition: QXmppPresence.h:42
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:87
Signals that the sender is online and available for communication.
Definition: QXmppPresence.h:27
The subscription request has been denied or a previously-granted subscription has been cancelled...
Definition: QXmppPresence.h:32
virtual void parse(const QDomElement &)=0
The QXmppMucItem class represents a chat room "item".
Definition: QXmppMucIq.h:17
User is advertising an image.
Definition: QXmppPresence.h:51
Type
This enum is used to describe a presence type.
Definition: QXmppPresence.h:25
The QXmppPresence class represents an XMPP presence stanza.
Definition: QXmppPresence.h:21
User is not using any image.
Definition: QXmppPresence.h:50
VCardUpdateType
Definition: QXmppPresence.h:48
Signals that the sender is no longer available for communication.
Definition: QXmppPresence.h:28
virtual void toXml(QXmlStreamWriter *writer) const =0
The Error class represents a stanza error.
Definition: QXmppStanza.h:93
The entity or resource is away for an extended period.
Definition: QXmppPresence.h:40
The entity or resource is temporarily away.
Definition: QXmppPresence.h:39
QXmppStanza & operator=(const QXmppStanza &other)
Assigns other to this stanza.
The sender wishes to subscribe to the recipient&#39;s presence.
Definition: QXmppPresence.h:29
The sender has allowed the recipient to receive their presence.
Definition: QXmppPresence.h:30