00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef QXMPPPRESENCE_H
00026 #define QXMPPPRESENCE_H
00027
00028 #include "QXmppStanza.h"
00029
00033 class QXmppPresence : public QXmppStanza
00034 {
00035 public:
00037 enum Type
00038 {
00039 Error = 0,
00040 Available,
00041 Unavailable,
00042 Subscribe,
00043 Subscribed,
00044 Unsubscribe,
00045 Unsubscribed,
00046 Probe
00047 };
00048
00049
00050 enum VCardUpdateType
00051 {
00052 VCardUpdateNone = 0,
00053 VCardUpdateNoPhoto,
00054 VCardUpdateValidPhoto,
00055 VCardUpdateNotReady
00056
00059 };
00060
00065
00066 class Status
00067 {
00068 public:
00070 enum Type
00071 {
00072 Offline = 0,
00073 Online,
00074 Away,
00075 XA,
00076 DND,
00077 Chat,
00078 Invisible
00079 };
00080
00081 Status(QXmppPresence::Status::Type type = QXmppPresence::Status::Online,
00082 const QString statusText = "", int priority = 0);
00083
00084 QXmppPresence::Status::Type type() const;
00085 void setType(QXmppPresence::Status::Type);
00086
00087 QString statusText() const;
00088 void setStatusText(const QString&);
00089
00090 int priority() const;
00091 void setPriority(int);
00092
00094 void parse(const QDomElement &element);
00095 void toXml(QXmlStreamWriter *writer) const;
00096
00097
00098
00099 int Q_DECL_DEPRECATED getPriority() const;
00100 QString Q_DECL_DEPRECATED getStatusText() const;
00101 QXmppPresence::Status::Type Q_DECL_DEPRECATED getType() const;
00103
00104 private:
00105 QString getTypeStr() const;
00106 void setTypeFromStr(const QString&);
00107
00108 QXmppPresence::Status::Type m_type;
00109 QString m_statusText;
00110 int m_priority;
00111 };
00112
00113 QXmppPresence(QXmppPresence::Type type = QXmppPresence::Available,
00114 const QXmppPresence::Status& status = QXmppPresence::Status());
00115 ~QXmppPresence();
00116
00117 QXmppPresence::Type type() const;
00118 void setType(QXmppPresence::Type);
00119
00120 QXmppPresence::Status& status();
00121 const QXmppPresence::Status& status() const;
00122 void setStatus(const QXmppPresence::Status&);
00123
00125 void parse(const QDomElement &element);
00126 void toXml(QXmlStreamWriter *writer) const;
00128
00129 QByteArray photoHash() const;
00130 void setPhotoHash(const QByteArray&);
00131
00132 VCardUpdateType vCardUpdateType() const;
00133 void setVCardUpdateType(VCardUpdateType type);
00134
00135 QString capabilityHash() const;
00136 void setCapabilityHash(const QString&);
00137
00138 QString capabilityNode() const;
00139 void setCapabilityNode(const QString&);
00140
00141 QByteArray capabilityVer() const;
00142 void setCapabilityVer(const QByteArray&);
00143
00144 QStringList capabilityExt() const;
00145
00146
00147
00149 QXmppPresence::Type Q_DECL_DEPRECATED getType() const;
00150 QXmppPresence::Status Q_DECL_DEPRECATED & getStatus();
00151 const QXmppPresence::Status Q_DECL_DEPRECATED & getStatus() const;
00153
00154 private:
00155 QString getTypeStr() const;
00156 void setTypeFromStr(const QString&);
00157
00158 Type m_type;
00159 QXmppPresence::Status m_status;
00160
00161
00163
00166 QByteArray m_photoHash;
00167 VCardUpdateType m_vCardUpdateType;
00168
00169
00170 QString m_capabilityHash;
00171 QString m_capabilityNode;
00172 QByteArray m_capabilityVer;
00173
00174 QStringList m_capabilityExt;
00175 };
00176
00177 #endif // QXMPPPRESENCE_H