ClientContact Class Reference
A client contact.
More...
#include <yatecbase.h>
List of all members.
|
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) |
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 |
Detailed Description
A client contact.
A client contact The contact is using the owner's mutex to lock it's operations
Constructor & Destructor Documentation
Constructor. Append itself to the owner's list
- Parameters:
-
| 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 |
Constructor. Build a contact from a list of parameters. . Append itself to the owner's list
- Parameters:
-
| owner | The contact's owner |
| params | The list of parameters used to build this contact |
| chat | True to create the chat window |
Member Function Documentation
Get this contact's account
- Returns:
- This contact's account
const URI& uri |
( |
|
) |
const [inline] |
Get this contact's URI
- Returns:
- This contact's URI
Get the resource list of this contact
- Returns:
- The resource list of this contact
Get the group list of this contact
- Returns:
- The group list of this contact
virtual const String& toString |
( |
|
) |
const [inline, virtual] |
Get a string representation of this object
- Returns:
- The contact's id
Reimplemented from GenObject.
void buildContactId |
( |
String & |
dest |
) |
[inline] |
bool isChatWnd |
( |
Window * |
wnd |
) |
[inline] |
Check if a window is this contact's chat
- Parameters:
-
- Returns:
- True if the given window is this contact's chat
References Window::toString().
bool hasChat |
( |
|
) |
[inline] |
Check if this contact has a chat window
- Returns:
- True if this contact has a chat window
bool isChatVisible |
( |
|
) |
[inline] |
Check if this contact's chat window is visible
- Returns:
- True if this contact's chat window is visible
bool showChat |
( |
bool |
active |
) |
[inline] |
Show or hide this contact's chat window
- Parameters:
-
| active | The chat window's visibility flag |
- Returns:
- True on success
void createChatWindow |
( |
bool |
force = false , |
|
|
const char * |
name = "chat" | |
|
) |
| | |
Create the chat window
- Parameters:
-
| force | True to destroy the current one if any |
| name | The window's name |
void destroyChatWindow |
( |
|
) |
[inline] |
Close (desrtoy) the chat window
virtual String* findGroup |
( |
const String & |
group |
) |
[virtual] |
Find a group this contact might belong to
- Parameters:
-
| group | The name of the group to find |
- Returns:
- String pointer or 0 if not found
virtual bool appendGroup |
( |
const String & |
group |
) |
[virtual] |
Append a group to this contact
- Parameters:
-
- Returns:
- False if the group already exists
virtual bool removeGroup |
( |
const String & |
group |
) |
[virtual] |
Remove a contact's group
- Parameters:
-
- Returns:
- False if the group was not found
Find a resource having a given id
- Parameters:
-
| id | The id of the desired resource |
| ref | True to obtain a referenced pointer |
- Returns:
- ClientResource pointer or 0 if not found
virtual ClientResource* findAudioResource |
( |
bool |
ref = false |
) |
[virtual] |
Get the first resource with audio capability
- Parameters:
-
| ref | True to obtain a referenced pointer |
- Returns:
- ClientResource pointer or 0 if not found
Append a resource having a given id
- Parameters:
-
| id | The id of the desired resource |
- Returns:
- ClientResource pointer or 0 if a resource with the given name already exists
virtual bool removeResource |
( |
const String & |
id |
) |
[virtual] |
Remove a resource having a given id
- Parameters:
-
| id | The id of the desired resource |
- Returns:
- True if the resource was removed
static bool isChatWndPrefix |
( |
Window * |
wnd |
) |
[inline, static] |
static void buildContactId |
( |
String & |
dest, |
|
|
const String & |
account, |
|
|
const String & |
contact | |
|
) |
| | [inline, static] |
Build a contact id to be used in UI
- Parameters:
-
| dest | Destination string |
| account | Account owning the contact |
| contact | The contact's id |
References String::toLower().
static void splitContactId |
( |
const String & |
src, |
|
|
String & |
account, |
|
|
String & |
contact | |
|
) |
| | [inline, static] |
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.
The documentation for this class was generated from the following file: