diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-11 19:38:15 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-11 19:38:15 +0000 |
| commit | 7999763cc5239dade9807996895982b99893f90b (patch) | |
| tree | 13e11a162b34e9e5b4b44cf1842eb98b0eacdd98 /src | |
| parent | 09cf930f6c2b693bac5f487b070c2f846b4b7bb8 (diff) | |
| download | qxmpp-7999763cc5239dade9807996895982b99893f90b.tar.gz | |
document QXmppPresence::Status
Diffstat (limited to 'src')
| -rw-r--r-- | src/QXmppPresence.cpp | 18 | ||||
| -rw-r--r-- | src/QXmppPresence.h | 36 |
2 files changed, 39 insertions, 15 deletions
diff --git a/src/QXmppPresence.cpp b/src/QXmppPresence.cpp index 81a47d63..64ed0d58 100644 --- a/src/QXmppPresence.cpp +++ b/src/QXmppPresence.cpp @@ -303,6 +303,8 @@ void QXmppPresence::setTypeFromStr(const QString& str) } } +/// Constructs a presence status. + QXmppPresence::Status::Status(QXmppPresence::Status::Type type, const QString statusText, int priority) : m_type(type), @@ -310,11 +312,15 @@ QXmppPresence::Status::Status(QXmppPresence::Status::Type type, { } +/// Returns the status type, for instance busy or away. + QXmppPresence::Status::Type QXmppPresence::Status::type() const { return m_type; } +/// Sets the status type. + void QXmppPresence::Status::setType(QXmppPresence::Status::Type type) { m_type = type; @@ -396,21 +402,33 @@ QString QXmppPresence::Status::getTypeStr() const return text; } +/// Returns the status text, a textual description of the user's status. + QString QXmppPresence::Status::statusText() const { return m_statusText; } +/// Sets the status text, a textual description of the user's status. +/// +/// \param str The status text, for example "Gone fishing". + void QXmppPresence::Status::setStatusText(const QString& str) { m_statusText = str; } +/// Returns the priority level of the resource. + int QXmppPresence::Status::priority() const { return m_priority; } +/// Sets the priority level of the resource. +/// +/// \param priority + void QXmppPresence::Status::setPriority(int priority) { m_priority = priority; diff --git a/src/QXmppPresence.h b/src/QXmppPresence.h index 4066759b..c5744424 100644 --- a/src/QXmppPresence.h +++ b/src/QXmppPresence.h @@ -36,14 +36,14 @@ public: /// This enum is used to describe a presence type. enum Type { - Error = 0, - Available, - Unavailable, - Subscribe, - Subscribed, - Unsubscribe, - Unsubscribed, - Probe + Error = 0, ///< An error has occurred regarding processing or delivery of a previously-sent presence stanza. + Available, ///< Signals that the sender is online and available for communication. + Unavailable, ///< Signals that the sender is no longer available for communication. + Subscribe, ///< The sender wishes to subscribe to the recipient's presence. + Subscribed, ///< The sender has allowed the recipient to receive their presence. + Unsubscribe, ///< The sender is unsubscribing from another entity's presence. + Unsubscribed, ///< The subscription request has been denied or a previously-granted subscription has been cancelled. + Probe ///< A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user. }; // XEP-0153: vCard-Based Avatars @@ -59,18 +59,24 @@ public: ///< client doesn't know it temporarily. }; + /// The QXmppPresence::Status class represents the status of an XMPP entity. + /// + /// It stores information such as the "away", "busy" status of a user, or + /// a human-readable description. + class Status { public: + /// This enum is used to describe an availability status. enum Type { - Offline = 0, - Online, - Away, - XA, - DND, - Chat, - Invisible + Offline = 0, + Online, ///< The entity or resource is online. + Away, ///< The entity or resource is temporarily away. + XA, ///< The entity or resource is away for an extended period. + DND, ///< The entity or resource is busy ("Do Not Disturb"). + Chat, ///< The entity or resource is actively interested in chatting. + Invisible }; Status(QXmppPresence::Status::Type type = QXmppPresence::Status::Online, |
