Yate
|
A client contact. More...
#include <yatecbase.h>
Public Member Functions | |
ClientContact (ClientAccount *owner, const char *id, const char *name=0, bool chat=false) | |
ClientContact (ClientAccount *owner, NamedList ¶ms, bool chat) | |
ClientAccount * | account () |
const URI & | uri () const |
ObjList & | resources () |
ObjList & | groups () |
virtual const String & | toString () const |
void | buildContactId (String &dest) |
bool | isChatWnd (Window *wnd) |
bool | hasChat () |
bool | isChatVisible () |
bool | showChat (bool active) |
Window * | getChatWnd () const |
void | createChatWindow (bool force=false, const char *name="chat") |
void | destroyChatWindow () |
virtual String * | findGroup (const String &group) |
virtual bool | appendGroup (const String &group) |
virtual bool | removeGroup (const String &group) |
virtual ClientResource * | findResource (const String &id, bool ref=false) |
virtual ClientResource * | findAudioResource (bool ref=false) |
virtual ClientResource * | appendResource (const String &id) |
virtual bool | removeResource (const String &id) |
Static Public Member Functions | |
static bool | isChatWndPrefix (Window *wnd) |
static void | buildContactId (String &dest, const String &account, const String &contact) |
static void | splitContactId (const String &src, String &account, String &contact) |
Public Attributes | |
String | m_name |
String | m_subscription |
Static Public Attributes | |
static String | s_chatPrefix |
Protected Member Functions | |
virtual void | destroyed () |
Protected Attributes | |
ClientAccount * | m_owner |
String | m_id |
URI | m_uri |
ObjList | m_resources |
ObjList | m_groups |
Friends | |
class | ClientAccount |
A client contact.
A client contact The contact is using the owner's mutex to lock it's operations
ClientContact | ( | ClientAccount * | owner, |
const char * | id, | ||
const char * | name = 0 , |
||
bool | chat = false |
||
) |
Constructor. Append itself to the owner's list
owner | The contact's owner |
id | The contact's id |
name | Optional display name. Defaults to the id's value if 0 |
chat | True to create the chat window |
ClientContact | ( | ClientAccount * | owner, |
NamedList & | params, | ||
bool | chat | ||
) |
Constructor. Build a contact from a list of parameters. . Append itself to the owner's list
owner | The contact's owner |
params | The list of parameters used to build this contact |
chat | True to create the chat window |
ClientAccount* account | ( | ) | [inline] |
Get this contact's account
virtual bool appendGroup | ( | const String & | group | ) | [virtual] |
Append a group to this contact
group | Group's name |
virtual ClientResource* appendResource | ( | const String & | id | ) | [virtual] |
Append a resource having a given id
id | The id of the desired resource |
static void buildContactId | ( | String & | dest, |
const String & | account, | ||
const String & | contact | ||
) | [inline, static] |
Build a contact id to be used in UI
dest | Destination string |
account | Account owning the contact |
contact | The contact's id |
References String::toLower().
void buildContactId | ( | String & | dest | ) | [inline] |
Build a contact id to be used in UI
dest | Destination string |
References ClientContact::buildContactId(), String::empty(), and String::toString().
Referenced by ClientContact::buildContactId().
void createChatWindow | ( | bool | force = false , |
const char * | name = "chat" |
||
) |
Create the chat window
force | True to destroy the current one if any |
name | The window's name |
void destroyChatWindow | ( | ) | [inline] |
Close (desrtoy) the chat window
virtual void destroyed | ( | ) | [protected, virtual] |
Pre-destruction notification, called just before the object is deleted. Unlike in the destructor it is safe to call virtual methods here. Reimplementing this method allows to perform any object cleanups.
Reimplemented from RefObject.
virtual ClientResource* findAudioResource | ( | bool | ref = false | ) | [virtual] |
Get the first resource with audio capability
ref | True to obtain a referenced pointer |
Find a group this contact might belong to
group | The name of the group to find |
virtual ClientResource* findResource | ( | const String & | id, |
bool | ref = false |
||
) | [virtual] |
Find a resource having a given id
id | The id of the desired resource |
ref | True to obtain a referenced pointer |
ObjList& groups | ( | ) | [inline] |
Get the group list of this contact
bool hasChat | ( | ) | [inline] |
Check if this contact has a chat window
bool isChatVisible | ( | ) | [inline] |
Check if this contact's chat window is visible
bool isChatWnd | ( | Window * | wnd | ) | [inline] |
Check if a window is this contact's chat
wnd | The window to check |
References Window::toString().
static bool isChatWndPrefix | ( | Window * | wnd | ) | [inline, static] |
Check if a window is a chat one
wnd | The window to check |
References String::startsWith(), and Window::toString().
virtual bool removeGroup | ( | const String & | group | ) | [virtual] |
Remove a contact's group
group | Group's name |
virtual bool removeResource | ( | const String & | id | ) | [virtual] |
Remove a resource having a given id
id | The id of the desired resource |
ObjList& resources | ( | ) | [inline] |
Get the resource list of this contact
bool showChat | ( | bool | active | ) | [inline] |
Show or hide this contact's chat window
active | The chat window's visibility flag |
static void splitContactId | ( | const String & | src, |
String & | account, | ||
String & | contact | ||
) | [inline, static] |
Split a contact id
src | Source string |
account | Account name |
contact | Contact's name |
References String::find(), and String::substr().
virtual const String& toString | ( | ) | const [inline, virtual] |