|
gloox 1.0
|
An abstraction of a presence stanza. More...
#include <presence.h>

Public Types | |
| enum | PresenceType { Available, Chat, Away, DND, XA, Unavailable, Probe, Error, Invalid } |
Public Member Functions | |
| Presence (PresenceType type, const JID &to, const std::string &status=EmptyString, int priority=0, const std::string &xmllang=EmptyString) | |
| virtual | ~Presence () |
| PresenceType | subtype () const |
| const Capabilities * | capabilities () const |
| PresenceType | presence () const |
| void | setPresence (PresenceType type) |
| const std::string | status (const std::string &lang="default") const |
| void | addStatus (const std::string &status, const std::string &lang=EmptyString) |
| void | resetStatus () |
| int | priority () const |
| void | setPriority (int priority) |
| virtual Tag * | tag () const |
| enum PresenceType |
Describes the different valid presence types.
Definition at line 42 of file presence.h.
| Presence | ( | PresenceType | type, |
| const JID & | to, | ||
| const std::string & | status = EmptyString, |
||
| int | priority = 0, |
||
| const std::string & | xmllang = EmptyString |
||
| ) |
Creates a Presence request.
| type | The presence type. |
| to | The intended receiver. Use an empty JID to create a broadcast packet. |
| status | An optional status message (e.g. "gone fishing"). |
| priority | An optional presence priority. Legal range is between -128 and +127. Defaults to 0. |
| xmllang | An optional xml:lang for the status message. |
Definition at line 72 of file presence.cpp.
| ~Presence | ( | ) | [virtual] |
Destructor.
Definition at line 81 of file presence.cpp.
| void addStatus | ( | const std::string & | status, |
| const std::string & | lang = EmptyString |
||
| ) | [inline] |
Adds a (possibly translated) status message.
| status | The status message. |
| lang | The language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. |
Definition at line 117 of file presence.h.
| const Capabilities * capabilities | ( | ) | const |
A convenience function returning the stanza's Capabilities, if any. May be 0.
Definition at line 103 of file presence.cpp.
| PresenceType presence | ( | ) | const [inline] |
| int priority | ( | ) | const [inline] |
Returns the presence priority in the legal range: -128 to +127.
Definition at line 131 of file presence.h.
| void resetStatus | ( | ) |
Resets the default status message as well as all language-specific ones.
Definition at line 86 of file presence.cpp.
| void setPresence | ( | PresenceType | type | ) | [inline] |
Sets the presence type.
| type | The presence type. |
Definition at line 95 of file presence.h.
| void setPriority | ( | int | priority | ) |
Sets the priority. Legal range: -128 to +127.
| priority | The priority to set. |
Definition at line 93 of file presence.cpp.
| const std::string status | ( | const std::string & | lang = "default" | ) | const [inline] |
Returns the status text of a presence stanza for the given language if available. If the requested language is not available, the default status text (without a xml:lang attribute) will be returned.
| lang | The language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. If empty, the default body will be returned, if any. |
Definition at line 106 of file presence.h.
| PresenceType subtype | ( | ) | const [inline] |
| Tag * tag | ( | ) | const [virtual] |
1.7.4