class JIDResource

A JID resource. More...

Full nameTelEngine::JIDResource
Definition#include <libs/yjingle/yatejabber.h>
InheritsTelEngine::RefObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods

Protected Members


Detailed Description

This class holds a JID resource (name,presence,capabilities)

enum Capability { CapChat = 1, CapAudio = 2, }

Capability

Resource capabilities enumeration.

enum Presence { Unknown = 0, Available = 1, Unavailable = 2, }

Presence

Resource presence enumeration

enum Show { ShowAway, ShowChat, ShowDND, ShowXA, ShowNone, }

Show

Values of the 'show' child of a presence element

inline  JIDResource (const char* name, Presence presence = Unknown, u_int32_t capability = CapChat, int prio = 0)

JIDResource

Constructor. Set data members

Parameters:
nameThe resource name
presenceThe resource presence
capabilityThe resource capability
prioThe resource priority

inline  ~JIDResource ()

~JIDResource

[virtual]

Destructor

inline const String&  name ()

name

[const]

Get the resource name

Returns: The resource name

inline void  setName (const char* name)

setName

Set the resource name

Parameters:
nameThe new name of the resource

inline Presence  presence ()

presence

[const]

Get the presence attribute

Returns: The presence attribute

inline bool  available ()

available

[const]

Check if the resource is available

Returns: True if the resource is available

inline Show  show ()

show

[const]

Get the show attribute as enumeration

Returns: The show attribute as enumeration

inline void  show (Show s)

show

Set the show attribute

Parameters:
sThe new show attribute

inline const String&  status ()

status

[const]

Get the status of this resource

Returns: The status of this resource

inline void  status (const char* s)

status

Set the status of this resource

Parameters:
sThe new status of this resource

inline int  priority ()

priority

Get the priority of this resource

Returns: The priority of this resource

inline void  priority (int value)

priority

Set the priority of this resource

Parameters:
valueThe new priority of this resource

inline JIDFeatureList&  features ()

features

Get the list of resource features

Returns: The resource features

inline ObjList*  infoXml ()

infoXml

Get the list containing XML elements with additional data describing this resource

Returns: The info list

bool  setPresence (bool value)

setPresence

Set the presence information

Parameters:
valueTrue if available, False if not

Returns: True if presence changed

inline bool  hasCap (Capability capability)

hasCap

[const]

Check if the resource has the required capability

Parameters:
capabilityThe required capability

Returns: True if the resource has the required capability

bool  fromXML (XMLElement* element)

fromXML

Update resource from a presence element

Parameters:
elementA presence element

Returns: True if presence or capability changed changed

void  addTo (XMLElement* element, bool addInfo = true)

addTo

Add capabilities to a presence element

Parameters:
elementThe target presence element
addInfoTrue to add the elements from info list

const char*  getShow (XMLElement* element)

getShow

[static]

Get the 'show' child of a presence element

Parameters:
elementThe XML element

Returns: The text or 0

const char*  getStatus (XMLElement* element)

getStatus

[static]

Get the 'show' child of a presence element

Parameters:
elementThe XML element

Returns: The text or 0

inline Show  showType (const char* text)

showType

[static]

Get the type of a 'show' element as enumeration

Parameters:
textThe text to check

Returns: Show type as enumeration

inline const char*  showText (Show show)

showText

[static]

Get the text from a show type

Parameters:
showThe type to get text for

Returns: The associated text or 0

static TokenDict s_show[]

s_show[]

[protected]


Generated by: paulc on bussard on Mon Mar 8 12:18:15 2010, using kdoc 2.0a54.