Yate: ClientResource Class Reference

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:

## 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 String & | toString () const
bool | online () const
bool | offline () const
const char * | statusName () const
const char * | text () const
Flags32 & | caps ()
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 ()
virtual const String & | traceId () const
NamedCounter * | getObjCounter () const
NamedCounter * | setObjCounter (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 NamedCounter * | getObjCounter (const String &name, bool create=true)
static ObjList & | getObjCounters ()

## 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

## ◆ Capability

enum Capability

Resource capabilities

## ◆ Status

enum Status

Resource status

## Constructor & Destructor Documentation

## ◆ ClientResource()

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

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

## ◆ caps()

Flags32 & caps | ( |  | ) |
| inline

Retrieve resource capabilities

Returns
  Resource capabilities flags

## ◆ offline()

bool offline | ( |  | ) | const
| inline

Check if the resource is offline

Returns
  True if the resource is offline

## ◆ online()

bool online | ( |  | ) | const
| inline

Check if the resource is online

Returns
  True if the resource is online

Referenced by MucRoom::available().

## ◆ setAudio()

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

Update resource audio capability

Parameters

  ok | The new audio capability value

Returns
  True if changed

References Flags32::changeFlagCheck().

## ◆ setFileTransfer()

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

Update resource file transfer capability

Parameters

  ok | The new file transfer value

Returns
  True if changed

References Flags32::changeFlagCheck().

## ◆ setPriority()

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

Update resource priority

Parameters

  prio | Resource priority

Returns
  True if changed

## ◆ setStatus()

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

Update resource status

Parameters

  stat | Resource status

Returns
  True if changed

## ◆ setStatusText()

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

Update resource status text

Parameters

  text | Resource status text

Returns
  True if changed

References ClientResource::text().

## ◆ statusDisplayText()

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

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 ClientResource::s_statusName.

Referenced by ClientResource::text().

## ◆ statusName()

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

Retrieve resource status name

Returns
  Resource status name

References ClientResource::s_statusName.

## ◆ text()

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().

## ◆ toString()

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

## ◆ s_resNotifyCaps

const TokenDict s_resNotifyCaps[]
| static

resource.notify capability names

## ◆ s_statusName

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:

- yatecbase.h