Yate
|
A client contact's resource. More...
#include <yatecbase.h>
Public Types | |
enum | Status { Unknown = 0, Offline = 1, Connecting = 2, Online = 3, Busy = 4, Dnd = 5, Away = 6, Xa = 7 } |
Public Member Functions | |
ClientResource (const char *id, const char *name=0, bool audio=true) | |
virtual const String & | toString () const |
bool | online () const |
bool | offline () const |
const char * | statusName () const |
const char * | text () const |
bool | setAudio (bool ok) |
bool | setFileTransfer (bool ok) |
bool | setPriority (int prio) |
bool | setStatus (int stat) |
bool | setStatusText (const String &text=String::empty()) |
Static Public Member Functions | |
static const char * | statusDisplayText (int status, const char *defVal=0) |
Public Attributes | |
String | m_id |
String | m_name |
bool | m_audio |
bool | m_fileTransfer |
int | m_priority |
int | m_status |
String | m_text |
Static Public Attributes | |
static const TokenDict | s_statusName [] |
A client contact's resource.
This class holds data about a client account/contact resource
enum Status |
Resource status
ClientResource | ( | const char * | id, |
const char * | name = 0 , |
||
bool | audio = true |
||
) | [inline, explicit] |
Constructor
id | The resource's id |
name | Optional display name. Defaults to the id's value if 0 |
audio | True (default) if the resource has audio capability |
bool offline | ( | ) | const [inline] |
Check if the resource is offline
bool online | ( | ) | const [inline] |
Check if the resource is online
bool setAudio | ( | bool | ok | ) | [inline] |
Update resource audio capability
ok | The new audio capability value |
bool setFileTransfer | ( | bool | ok | ) | [inline] |
Update resource file transfer capability
ok | The new file transfer value |
bool setPriority | ( | int | prio | ) | [inline] |
Update resource priority
prio | Resource priority |
bool setStatus | ( | int | stat | ) | [inline] |
Update resource status
stat | Resource status |
bool setStatusText | ( | const String & | text = String::empty() | ) | [inline] |
Update resource status text
text | Resource status text |
static const char* statusDisplayText | ( | int | status, |
const char * | defVal = 0 |
||
) | [inline, static] |
Retrieve the status display text associated with a given resource status
status | The status to find |
defVal | Text to return if none found |
References TelEngine::lookup().
const char* statusName | ( | ) | const [inline] |
const char* text | ( | ) | const [inline] |
Retrieve resource status text or associated status display text
References String::c_str().
Get a string representation of this object
Reimplemented from GenObject.
Referenced by MucRoom::ownMember().
const TokenDict s_statusName[] [static] |
Resource status names