QXmpp  Version:1.0.0
QXmppPresence.h
1 /*
2  * Copyright (C) 2008-2019 The QXmpp developers
3  *
4  * Author:
5  * Manjeet Dahiya
6  *
7  * Source:
8  * https://github.com/qxmpp-project/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 
25 #ifndef QXMPPPRESENCE_H
26 #define QXMPPPRESENCE_H
27 
28 #include "QXmppStanza.h"
29 #include "QXmppMucIq.h"
30 
31 class QXmppPresencePrivate;
32 
36 class QXMPP_EXPORT QXmppPresence : public QXmppStanza
37 {
38 public:
40  enum Type
41  {
42  Error = 0,
49  Probe
50  };
51 
54  {
55  Online = 0,
56  Away,
57  XA,
58  DND,
59  Chat,
60  Invisible
61  };
62 
66  {
67  VCardUpdateNone = 0,
70  VCardUpdateNotReady
71 
74  };
75 
77  QXmppPresence(const QXmppPresence &other);
78  ~QXmppPresence();
79 
80  QXmppPresence& operator=(const QXmppPresence &other);
81 
82  AvailableStatusType availableStatusType() const;
83  void setAvailableStatusType(AvailableStatusType type);
84 
85  int priority() const;
86  void setPriority(int priority);
87 
88  QXmppPresence::Type type() const;
89  void setType(QXmppPresence::Type);
90 
91  QString statusText() const;
92  void setStatusText(const QString& statusText);
93 
95  void parse(const QDomElement &element);
96  void toXml(QXmlStreamWriter *writer) const;
98 
99  // XEP-0045: Multi-User Chat
100  QXmppMucItem mucItem() const;
101  void setMucItem(const QXmppMucItem &item);
102 
103  QString mucPassword() const;
104  void setMucPassword(const QString &password);
105 
106  QList<int> mucStatusCodes() const;
107  void setMucStatusCodes(const QList<int> &codes);
108 
109  bool isMucSupported() const;
110  void setMucSupported(bool supported);
111 
113  QByteArray photoHash() const;
114  void setPhotoHash(const QByteArray&);
115 
116  VCardUpdateType vCardUpdateType() const;
117  void setVCardUpdateType(VCardUpdateType type);
118 
119  // XEP-0115: Entity Capabilities
120  QString capabilityHash() const;
121  void setCapabilityHash(const QString&);
122 
123  QString capabilityNode() const;
124  void setCapabilityNode(const QString&);
125 
126  QByteArray capabilityVer() const;
127  void setCapabilityVer(const QByteArray&);
128 
129  QStringList capabilityExt() const;
130 
131  // XEP-0319: Last User Interaction in Presence
132  QDateTime lastUserInteraction() const;
133  void setLastUserInteraction(const QDateTime&);
134 
135  bool isXmppStanza() const;
136 
137 private:
138  QSharedDataPointer<QXmppPresencePrivate> d;
139 };
140 
141 #endif // QXMPPPRESENCE_H
The sender is unsubscribing from another entity&#39;s presence.
Definition: QXmppPresence.h:47
AvailableStatusType
This enum is used to describe an availability status.
Definition: QXmppPresence.h:53
The entity or resource is busy ("Do Not Disturb").
Definition: QXmppPresence.h:58
The entity or resource is actively interested in chatting.
Definition: QXmppPresence.h:59
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:90
Signals that the sender is online and available for communication.
Definition: QXmppPresence.h:43
virtual bool isXmppStanza() const
Definition: QXmppStanza.cpp:492
The subscription request has been denied or a previously-granted subscription has been cancelled...
Definition: QXmppPresence.h:48
The QXmppMucItem class represents a chat room "item".
Definition: QXmppMucIq.h:36
User is advertising an image.
Definition: QXmppPresence.h:69
Type
This enum is used to describe a presence type.
Definition: QXmppPresence.h:40
The QXmppPresence class represents an XMPP presence stanza.
Definition: QXmppPresence.h:36
User is not using any image.
Definition: QXmppPresence.h:68
VCardUpdateType
Definition: QXmppPresence.h:65
Signals that the sender is no longer available for communication.
Definition: QXmppPresence.h:44
The entity or resource is away for an extended period.
Definition: QXmppPresence.h:57
The entity or resource is temporarily away.
Definition: QXmppPresence.h:56
QXmppStanza & operator=(const QXmppStanza &other)
Assigns other to this stanza.
Definition: QXmppStanza.cpp:368
The sender wishes to subscribe to the recipient&#39;s presence.
Definition: QXmppPresence.h:45
The sender has allowed the recipient to receive their presence.
Definition: QXmppPresence.h:46