ClientAccount Class Reference
A client account.
More...
#include <yatecbase.h>
List of all members.
|
Public Member Functions |
| ClientAccount (const char *proto, const char *user, const char *host, bool startup) |
| ClientAccount (const NamedList ¶ms) |
const URI & | uri () const |
const URI & | id () const |
ObjList & | contacts () |
virtual const String & | toString () const |
ClientResource * | resource (bool ref=false) |
void | setResource (ClientResource *res=0) |
virtual ClientContact * | findContact (const String &id, bool ref=false) |
virtual ClientContact * | findContact (const String &id, const String &resid, bool ref=false) |
virtual ClientContact * | appendContact (const String &id, const char *name) |
virtual ClientContact * | appendContact (const NamedList ¶ms) |
virtual ClientContact * | removeContact (const String &id, bool delObj=true) |
virtual Message * | userlogin (bool login, const char *msg="user.login") |
Static Public Member Functions |
static void | buildAccountId (URI &dest, const char *proto, const char *user, const char *host) |
Public Attributes |
String | m_password |
String | m_server |
int | m_port |
String | m_options |
bool | m_startup |
String | m_outbound |
int | m_expires |
bool | m_connected |
Protected Member Functions |
virtual void | destroyed () |
virtual void | appendContact (ClientContact *contact) |
void | setIdUri (const char *proto, const char *user, const char *host) |
Protected Attributes |
URI | m_id |
URI | m_uri |
ClientResource * | m_resource |
ObjList | m_contacts |
Friends |
class | ClientContact |
Detailed Description
A client account.
This class holds data about an account that can be registered to a server. It also holds a list of contacts belonging to this account. The account's id is kept in a lower case URI
Constructor & Destructor Documentation
ClientAccount |
( |
const char * |
proto, |
|
|
const char * |
user, |
|
|
const char * |
host, |
|
|
bool |
startup | |
|
) |
| | |
Constructor
- Parameters:
-
| proto | The account's protocol |
| user | The account's username |
| host | The account's host |
| startup | True if the account should login at startup |
Constructor. Build an account from a list of parameters
- Parameters:
-
| params | The list of parameters used to build this account |
Member Function Documentation
const URI& uri |
( |
|
) |
const [inline] |
Get this account's URI
- Returns:
- This account's URI
const URI& id |
( |
|
) |
const [inline] |
Get this account's id
- Returns:
- This account's id
Get this account's contacts. The caller should lock the account while browsing the list
- Returns:
- This account's contacts list
virtual const String& toString |
( |
|
) |
const [inline, virtual] |
Get a string representation of this object
- Returns:
- The account's compare id
Reimplemented from GenObject.
Set/reset this account's resource
- Parameters:
-
| res | The new account's resource |
Find a contact by its id
- Parameters:
-
| id | The id of the desired contact |
| ref | True to obtain a referenced pointer |
- Returns:
- ClientContact pointer or 0 if not found
Find a contact having a given id and resource
- Parameters:
-
| id | The id of the desired contact |
| resid | The id of the desired resource |
| ref | True to obtain a referenced pointer |
- Returns:
- ClientContact pointer or 0 if not found
Build a contact and append it to the list
- Parameters:
-
| id | The contact's id |
| name | The contact's name |
- Returns:
- ClientContact pointer or 0 if a contact with the given id already exists
Build a contact and append it to the list
- Parameters:
-
| params | Contact parameters |
- Returns:
- ClientContact pointer or 0 if a contact with the same id already exists
Remove a contact from list. Reset contact's owner
- Parameters:
-
| id | The contact's id |
| delObj | True to delete the object if found |
- Returns:
- ClientContact pointer if found and not deleted or 0
virtual Message* userlogin |
( |
bool |
login, |
|
|
const char * |
msg = "user.login" | |
|
) |
| | [virtual] |
Build a login/logout message from account's data
- Parameters:
-
| login | True to login, false to logout |
| msg | Optional message name. Default to 'user.login' |
- Returns:
- A valid Message pointer
static void buildAccountId |
( |
URI & |
dest, |
|
|
const char * |
proto, |
|
|
const char * |
user, |
|
|
const char * |
host | |
|
) |
| | [inline, static] |
Build an account id
- Parameters:
-
| dest | Destination URI |
| proto | The account's protocol |
| user | The account's username |
| host | The account's host |
References String::toLower().
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: