|
|
This class holds a JID resource (name,presence,capabilities)
| enum Capability { CapChat = 1, CapAudio = 2, } | Capability |
Resource capabilities enumeration.
| enum Presence { Unknown = 0, Available = 1, Unavailable = 2, } | Presence |
Resource presence enumeration
| enum Show { ShowAway, ShowChat, ShowDND, ShowXA, ShowNone, } | Show |
Values of the 'show' child of a presence element
| inline JIDResource (const char* name, Presence presence = Unknown,
u_int32_t capability = CapChat, int prio = 0)
| JIDResource |
Constructor. Set data members
Parameters:
| name | The resource name |
| presence | The resource presence |
| capability | The resource capability |
| prio | The resource priority |
| inline ~JIDResource ()
| ~JIDResource |
[virtual]
Destructor
| inline const String& name ()
| name |
[const]
Get the resource name
Returns: The resource name
| inline void setName (const char* name)
| setName |
Set the resource name
Parameters:
| name | The new name of the resource |
| inline Presence presence ()
| presence |
[const]
Get the presence attribute
Returns: The presence attribute
| inline bool available ()
| available |
[const]
Check if the resource is available
Returns: True if the resource is available
| inline Show show ()
| show |
[const]
Get the show attribute as enumeration
Returns: The show attribute as enumeration
| inline void show (Show s)
| show |
Set the show attribute
Parameters:
| s | The new show attribute |
| inline const String& status ()
| status |
[const]
Get the status of this resource
Returns: The status of this resource
| inline void status (const char* s)
| status |
Set the status of this resource
Parameters:
| s | The new status of this resource |
| inline int priority ()
| priority |
Get the priority of this resource
Returns: The priority of this resource
| inline void priority (int value)
| priority |
Set the priority of this resource
Parameters:
| value | The new priority of this resource |
| inline JIDFeatureList& features ()
| features |
Get the list of resource features
Returns: The resource features
| inline ObjList* infoXml ()
| infoXml |
Get the list containing XML elements with additional data describing this resource
Returns: The info list
| bool setPresence (bool value)
| setPresence |
Set the presence information
Parameters:
| value | True if available, False if not |
Returns: True if presence changed
| inline bool hasCap (Capability capability)
| hasCap |
[const]
Check if the resource has the required capability
Parameters:
| capability | The required capability |
Returns: True if the resource has the required capability
| bool fromXML (XMLElement* element)
| fromXML |
Update resource from a presence element
Parameters:
| element | A presence element |
Returns: True if presence or capability changed changed
| void addTo (XMLElement* element, bool addInfo = true)
| addTo |
Add capabilities to a presence element
Parameters:
| element | The target presence element |
| addInfo | True to add the elements from info list |
| const char* getShow (XMLElement* element)
| getShow |
[static]
Get the 'show' child of a presence element
Parameters:
| element | The XML element |
Returns: The text or 0
| const char* getStatus (XMLElement* element)
| getStatus |
[static]
Get the 'show' child of a presence element
Parameters:
| element | The XML element |
Returns: The text or 0
| inline Show showType (const char* text)
| showType |
[static]
Get the type of a 'show' element as enumeration
Parameters:
| text | The text to check |
Returns: Show type as enumeration
| inline const char* showText (Show show)
| showText |
[static]
Get the text from a show type
Parameters:
| show | The type to get text for |
Returns: The associated text or 0
| static TokenDict s_show[] | s_show[] |
[protected]
| Generated by: paulc on bussard on Mon Mar 8 12:18:15 2010, using kdoc 2.0a54. |