Yate
|
A JID resource. More...
#include <yatejabber.h>
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, int prio=0) | |
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) |
int | priority () |
void | priority (int value) |
JIDFeatureList & | features () |
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 [] |
A JID resource.
This class holds a JID resource (name,presence,capabilities)
enum Capability |
Resource capabilities enumeration.
enum Presence |
Resource presence enumeration
enum Show |
Values of the 'show' child of a presence element
JIDResource | ( | const char * | name, |
Presence | presence = Unknown , |
||
u_int32_t | capability = CapChat , |
||
int | prio = 0 |
||
) | [inline] |
Constructor. Set data members
name | The resource name |
presence | The resource presence |
capability | The resource capability |
prio | The resource priority |
virtual ~JIDResource | ( | ) | [inline, virtual] |
Destructor
void addTo | ( | XMLElement * | element, |
bool | addInfo = true |
||
) |
Add capabilities to a presence element
element | The target presence element |
addInfo | True to add the elements from info list |
bool available | ( | ) | const [inline] |
Check if the resource is available
JIDFeatureList& features | ( | ) | [inline] |
Get the list of resource features
bool fromXML | ( | XMLElement * | element | ) |
Update resource from a presence element
element | A presence element |
static const char* getShow | ( | XMLElement * | element | ) | [static] |
Get the 'show' child of a presence element
element | The XML element |
static const char* getStatus | ( | XMLElement * | element | ) | [static] |
Get the 'show' child of a presence element
element | The XML element |
bool hasCap | ( | Capability | capability | ) | const [inline] |
Check if the resource has the required capability
capability | The required capability |
ObjList* infoXml | ( | ) | [inline] |
Get the list containing XML elements with additional data describing this resource
const String& name | ( | ) | const [inline] |
Get the resource name
Presence presence | ( | ) | const [inline] |
Get the presence attribute
int priority | ( | ) | [inline] |
Get the priority of this resource
void priority | ( | int | value | ) | [inline] |
Set the priority of this resource
value | The new priority of this resource |
void setName | ( | const char * | name | ) | [inline] |
Set the resource name
name | The new name of the resource |
bool setPresence | ( | bool | value | ) |
Set the presence information
value | True if available, False if not |
Show show | ( | ) | const [inline] |
Get the show attribute as enumeration
void show | ( | Show | s | ) | [inline] |
Set the show attribute
s | The new show attribute |
static const char* showText | ( | Show | show | ) | [inline, static] |
Get the text from a show type
show | The type to get text for |
References TelEngine::lookup().
static Show showType | ( | const char * | text | ) | [inline, static] |
Get the type of a 'show' element as enumeration
text | The text to check |
References TelEngine::lookup().
void status | ( | const char * | s | ) | [inline] |
Set the status of this resource
s | The new status of this resource |
const String& status | ( | ) | const [inline] |
Get the status of this resource