# class ClientResource | A client contact's resource. More...
Full name | `TelEngine::ClientResource`
Definition | `#include <yatecbase.h>`
Inherits | TelEngine::RefObject [public ]
Inherited by | MucRoomMember
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum Status { Unknown = 0, Offline = 1, Connecting = 2, Online = 3, Busy = 4, Dnd = 5, Away = 6, Xa = 7, }
- enum Capability { CapAudio = 0x00000001, CapFileTransfer = 0x00000002, CapFileInfo = 0x00000004, CapRsm = 0x00000008, }

#### Public Methods

- inline explicit ClientResource (const char* id, const char* name = 0, bool audio = true)
- virtual const String& toString () const
- inline bool online () const
- inline bool offline () const
- inline const char* statusName () const
- inline const char* text () const
- inline Flags32& caps ()
- inline bool setAudio (bool ok)
- inline bool setFileTransfer (bool ok)
- inline bool setPriority (int prio)
- inline bool setStatus (int stat)
- inline bool setStatusText (const String& text = String::empty())

#### Public Static Methods

- static inline const char* statusDisplayText (int status, const char* defVal = 0)

#### Public Members

- static const TokenDict s_statusName[]
- static const TokenDict s_resNotifyCaps[]
- String m_id
- String m_name
- Flags32 m_caps
- int m_priority
- int m_status
- String m_text

## Detailed Description

This class holds data about a client account/contact resource

enum Status { Unknown = 0, Offline = 1, Connecting = 2, Online = 3, Busy = 4, Dnd = 5, Away = 6, Xa = 7, } | ### Status

Resource status

enum Capability { CapAudio = 0x00000001, CapFileTransfer = 0x00000002, CapFileInfo = 0x00000004, CapRsm = 0x00000008, } | ### Capability

Resource capabilities

inline explicit ClientResource (const char* id, const char* name = 0, bool audio = true) | ### ClientResource

Constructor

Parameters:

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

const String& toString () | ### toString

[const virtual]

Get a string representation of this object

Returns: The resource id

Reimplemented from GenObject.

inline bool online () | ### online

[const]

Check if the resource is online

Returns: True if the resource is online

inline bool offline () | ### offline

[const]

Check if the resource is offline

Returns: True if the resource is offline

inline const char* statusName () | ### statusName

[const]

Retrieve resource status name

Returns: Resource status name

inline const char* text () | ### text

[const]

Retrieve resource status text or associated status display text

Returns: Resource status text

inline Flags32& caps () | ### caps

Retrieve resource capabilities

Returns: Resource capabilities flags

inline bool setAudio (bool ok) | ### setAudio

Update resource audio capability

Parameters:

ok | The new audio capability value

Returns: True if changed

inline bool setFileTransfer (bool ok) | ### setFileTransfer

Update resource file transfer capability

Parameters:

ok | The new file transfer value

Returns: True if changed

inline bool setPriority (int prio) | ### setPriority

Update resource priority

Parameters:

prio | Resource priority

Returns: True if changed

inline bool setStatus (int stat) | ### setStatus

Update resource status

Parameters:

stat | Resource status

Returns: True if changed

inline bool setStatusText (const String& text = String::empty()) | ### setStatusText

Update resource status text

Parameters:

text | Resource status text

Returns: True if changed

inline const char* statusDisplayText (int status, const char* defVal = 0) | ### statusDisplayText

[static]

Retrieve the status display text associated with a given resource status

Parameters:

status | The status to find
defVal | Text to return if none found

Returns: Status display text or the default value if not found

static const TokenDict s_statusName[] | ### s_statusName[]

static const TokenDict s_resNotifyCaps[] | ### s_resNotifyCaps[]

String m_id | ### m_id

String m_name | ### m_name

Flags32 m_caps | ### m_caps

int m_priority | ### m_priority

int m_status | ### m_status

String m_text | ### m_text

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.