Yate
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ClientResource Class Reference

A client contact's resource. More...

#include <yatecbase.h>

Inheritance diagram for ClientResource:
RefObject GenObject MucRoomMember

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 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
 
Flags32caps ()
 
bool setAudio (bool ok)
 
bool setFileTransfer (bool ok)
 
bool setPriority (int prio)
 
bool setStatus (int stat)
 
bool setStatusText (const String &text=String::empty())
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void * getObject (const String &name) const
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static const char * statusDisplayText (int status, const char *defVal=0)
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Public Attributes

String m_id
 
String m_name
 
Flags32 m_caps
 
int m_priority
 
int m_status
 
String m_text
 

Static Public Attributes

static const TokenDict s_statusName []
 
static const TokenDict s_resNotifyCaps []
 

Additional Inherited Members

- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
virtual void destroyed ()
 

Detailed Description

A client contact's resource.

This class holds data about a client account/contact resource

Member Enumeration Documentation

enum Capability

Resource capabilities

enum Status

Resource status

Constructor & Destructor Documentation

ClientResource ( const char *  id,
const char *  name = 0,
bool  audio = true 
)
inlineexplicit

Constructor

Parameters
idThe resource's id
nameOptional display name. Defaults to the id's value if 0
audioTrue (default) if the resource has audio capability

Member Function Documentation

Flags32& caps ( )
inline

Retrieve resource capabilities

Returns
Resource capabilities flags
bool offline ( ) const
inline

Check if the resource is offline

Returns
True if the resource is offline
bool online ( ) const
inline

Check if the resource is online

Returns
True if the resource is online

Referenced by MucRoom::available().

bool setAudio ( bool  ok)
inline

Update resource audio capability

Parameters
okThe new audio capability value
Returns
True if changed

References Flags32::changeFlagCheck().

bool setFileTransfer ( bool  ok)
inline

Update resource file transfer capability

Parameters
okThe new file transfer value
Returns
True if changed

References Flags32::changeFlagCheck().

bool setPriority ( int  prio)
inline

Update resource priority

Parameters
prioResource priority
Returns
True if changed
bool setStatus ( int  stat)
inline

Update resource status

Parameters
statResource status
Returns
True if changed
bool setStatusText ( const String text = String::empty())
inline

Update resource status text

Parameters
textResource status text
Returns
True if changed

References ClientResource::text().

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

Retrieve the status display text associated with a given resource status

Parameters
statusThe status to find
defValText to return if none found
Returns
Status display text or the default value if not found

References TelEngine::lookup(), and ClientResource::s_statusName.

Referenced by ClientResource::text().

const char* statusName ( ) const
inline

Retrieve resource status name

Returns
Resource status name

References TelEngine::lookup(), and ClientResource::s_statusName.

const char* text ( ) const
inline

Retrieve resource status text or associated status display text

Returns
Resource status text

References String::c_str(), and ClientResource::statusDisplayText().

Referenced by ClientResource::setStatusText().

virtual const String& toString ( ) const
inlinevirtual

Get a string representation of this object

Returns
The resource id

Reimplemented from GenObject.

Referenced by MucRoom::ownMember().

Member Data Documentation

const TokenDict s_resNotifyCaps[]
static

resource.notify capability names

const TokenDict s_statusName[]
static

Resource status names

Referenced by ClientResource::statusDisplayText(), and ClientResource::statusName().


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