JIDResource Class Reference
A JID resource.
More...
#include <yatejabber.h>
List of all members.
|
Public Types |
enum | Capability { CapChat = 1,
CapAudio = 2
} |
enum | Presence { Unknown = 0,
Available = 1,
Unavailable = 2
} |
enum | Show {
ShowAway,
ShowChat,
ShowDND,
ShowXA,
ShowNone
} |
Public Member Functions |
| JIDResource (const char *name, Presence presence=Unknown, u_int32_t capability=CapChat) |
virtual | ~JIDResource () |
const String & | name () const |
void | setName (const char *name) |
Presence | presence () const |
bool | available () const |
Show | show () const |
void | show (Show s) |
const String & | status () const |
void | status (const char *s) |
ObjList * | infoXml () |
bool | setPresence (bool value) |
bool | hasCap (Capability capability) const |
bool | fromXML (XMLElement *element) |
void | addTo (XMLElement *element, bool addInfo=true) |
Static Public Member Functions |
static const char * | getShow (XMLElement *element) |
static const char * | getStatus (XMLElement *element) |
static Show | showType (const char *text) |
static const char * | showText (Show show) |
Static Protected Attributes |
static TokenDict | s_show [] |
Detailed Description
A JID resource.
This class holds a JID resource (name,presence,capabilities)
Member Enumeration Documentation
Resource capabilities enumeration.
Resource presence enumeration
Values of the 'show' child of a presence element
Constructor & Destructor Documentation
JIDResource |
( |
const char * |
name, |
|
|
Presence |
presence = Unknown , |
|
|
u_int32_t |
capability = CapChat | |
|
) |
| | [inline] |
Constructor. Set data members
- Parameters:
-
| name | The resource name |
| presence | The resource presence |
| capability | The resource capability |
Member Function Documentation
void addTo |
( |
XMLElement * |
element, |
|
|
bool |
addInfo = true | |
|
) |
| | |
Add capabilities to a presence element
- Parameters:
-
| element | The target presence element |
| addInfo | True to add the elements from info list |
bool available |
( |
|
) |
const [inline] |
Check if the resource is available
- Returns:
- True if the resource is available
Update resource from a presence element
- Parameters:
-
| element | A presence element |
- Returns:
- True if presence or capability changed changed
static const char* getShow |
( |
XMLElement * |
element |
) |
[static] |
Get the 'show' child of a presence element
- Parameters:
-
- Returns:
- The text or 0
static const char* getStatus |
( |
XMLElement * |
element |
) |
[static] |
Get the 'show' child of a presence element
- Parameters:
-
- Returns:
- The text or 0
bool hasCap |
( |
Capability |
capability |
) |
const [inline] |
Check if the resource has the required capability
- Parameters:
-
| capability | The required capability |
- Returns:
- True if the resource has the required capability
Get the list containing XML elements with additional data describing this resource
- Returns:
- The info list
const String& name |
( |
|
) |
const [inline] |
Get the resource name
- Returns:
- The resource name
Get the presence attribute
- Returns:
- The presence attribute
void setName |
( |
const char * |
name |
) |
[inline] |
Set the resource name
- Parameters:
-
| name | The new name of the resource |
bool setPresence |
( |
bool |
value |
) |
|
Set the presence information
- Parameters:
-
| value | True if available, False if not |
- Returns:
- True if presence changed
void show |
( |
Show |
s |
) |
[inline] |
Set the show attribute
- Parameters:
-
Show show |
( |
|
) |
const [inline] |
Get the show attribute as enumeration
- Returns:
- The show attribute as enumeration
static const char* showText |
( |
Show |
show |
) |
[inline, static] |
Get the text from a show type
- Parameters:
-
| show | The type to get text for |
- Returns:
- The associated text or 0
References TelEngine::lookup().
static Show showType |
( |
const char * |
text |
) |
[inline, static] |
Get the type of a 'show' element as enumeration
- Parameters:
-
- Returns:
- Show type as enumeration
References TelEngine::lookup().
void status |
( |
const char * |
s |
) |
[inline] |
Set the status of this resource
- Parameters:
-
| s | The new status of this resource |
const String& status |
( |
|
) |
const [inline] |
Get the status of this resource
- Returns:
- The status of this resource
The documentation for this class was generated from the following file: