ClientResource Class Reference

A client contact's resource. More...

#include <yatecbase.h>

Inheritance diagram for ClientResource:

RefObject GenObject MucRoomMember

List of all members.

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 StringtoString () 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 []


Detailed Description

A client contact's resource.

This class holds data about a client account/contact resource


Member Enumeration Documentation

enum Status

Resource status


Constructor & Destructor Documentation

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

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


Member Function Documentation

virtual const String& toString (  )  const [inline, virtual]

Get a string representation of this object

Returns:
The account's id

Reimplemented from GenObject.

Referenced by MucRoom::ownMember().

bool online (  )  const [inline]

Check if the resource is online

Returns:
True if the resource is online

bool offline (  )  const [inline]

Check if the resource is offline

Returns:
True if the resource is offline

const char* statusName (  )  const [inline]

Retrieve resource status name

Returns:
Resource status name

References TelEngine::lookup().

const char* text (  )  const [inline]

Retrieve resource status text or associated status display text

Returns:
Resource status text

References String::c_str().

bool setAudio ( bool  ok  )  [inline]

Update resource audio capability

Parameters:
ok The new audio capability value
Returns:
True if changed

bool setFileTransfer ( bool  ok  )  [inline]

Update resource file transfer capability

Parameters:
ok The new file transfer value
Returns:
True if changed

bool setPriority ( int  prio  )  [inline]

Update resource priority

Parameters:
prio Resource priority
Returns:
True if changed

bool setStatus ( int  stat  )  [inline]

Update resource status

Parameters:
stat Resource status
Returns:
True if changed

bool setStatusText ( const String text = String::empty()  )  [inline]

Update resource status text

Parameters:
text Resource status text
Returns:
True if changed

static const char* statusDisplayText ( int  status,
const char *  defVal = 0 
) [inline, 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

References TelEngine::lookup().


Member Data Documentation

const TokenDict s_statusName[] [static]

Resource status names


The documentation for this class was generated from the following file:

Generated on Sat May 28 18:28:24 2011 for Yate by  doxygen 1.5.6