Yate
Public Member Functions | Protected Attributes
ClientAccountList Class Reference

A client account list. More...

#include <yatecbase.h>

Inheritance diagram for ClientAccountList:
String Mutex GenObject Lockable

List of all members.

Public Member Functions

 ClientAccountList (const char *name, ClientAccount *localContacts=0)
 ~ClientAccountList ()
ObjListaccounts ()
ClientAccountlocalContacts () const
bool isLocalContact (ClientContact *c) const
bool isLocalContact (const String &id) const
virtual ClientAccountfindAccount (const String &id, bool ref=false)
virtual ClientContactfindContactByUri (const String &account, const String &uri, bool ref=false)
virtual ClientContactfindContact (const String &account, const String &id, bool ref=false)
virtual ClientContactfindContact (const String &builtId, bool ref=false)
virtual ClientContactfindContactByInstance (const String &id, String *instance=0, bool ref=false)
virtual MucRoomfindRoom (const String &id, bool ref=false)
virtual MucRoomfindRoomByMember (const String &id, bool ref=false)
virtual ClientContactfindAnyContact (const String &id, bool ref=false)
virtual ClientAccountfindSingleRegAccount (const String *skipProto=0, bool ref=false)
virtual bool appendAccount (ClientAccount *account)
virtual void removeAccount (const String &id)

Protected Attributes

ObjList m_accounts

Detailed Description

A client account list.

This class holds an account list


Constructor & Destructor Documentation

ClientAccountList ( const char *  name,
ClientAccount localContacts = 0 
) [inline, explicit]

Constructor

Parameters:
nameList's name used for debug purposes
localContactsOptional account owning locally stored contacts

Destructor


Member Function Documentation

ObjList& accounts ( ) [inline]

Get the accounts list

Returns:
The accounts list
virtual bool appendAccount ( ClientAccount account) [virtual]

Append a new account. The account's reference counter is increased before

Parameters:
accountThe account to append
Returns:
True on succes, false if an account with the same id already exists
virtual ClientAccount* findAccount ( const String id,
bool  ref = false 
) [virtual]

Find an account

Parameters:
idThe account's id
refTrue to get a referenced pointer
Returns:
ClientAccount pointer or 0 if not found
virtual ClientContact* findAnyContact ( const String id,
bool  ref = false 
) [virtual]

Find any contact (regular or MUC room) by its id

Parameters:
idThe id of the desired contact
refTrue to obtain a referenced pointer
Returns:
ClientContact pointer (may be account's own contact) or 0 if not found
virtual ClientContact* findContact ( const String account,
const String id,
bool  ref = false 
) [virtual]

Find an account's contact

Parameters:
accountThe account's id
idThe contact's id
refTrue to get a referenced pointer
Returns:
ClientContact pointer or 0 if not found
virtual ClientContact* findContact ( const String builtId,
bool  ref = false 
) [virtual]

Find an account's contact from a built id

Parameters:
builtIdThe string containign the account and the contact
refTrue to get a referenced pointer
Returns:
ClientContact pointer or 0 if not found
virtual ClientContact* findContactByInstance ( const String id,
String instance = 0,
bool  ref = false 
) [virtual]

Find a contact an instance id

Parameters:
idThe id
instanceOptional pointer to String to be filled with instance id
refTrue to get a referenced pointer
Returns:
ClientContact pointer or 0 if not found
virtual ClientContact* findContactByUri ( const String account,
const String uri,
bool  ref = false 
) [virtual]

Find an account's contact by its URI (build an id from account and uri)

Parameters:
accountThe account's id
uriThe contact's uri
refTrue to get a referenced pointer
Returns:
ClientContact pointer or 0 if not found
virtual MucRoom* findRoom ( const String id,
bool  ref = false 
) [virtual]

Find a MUC room by its id

Parameters:
idRoom id
refTrue to obtain a referenced pointer
Returns:
MucRoom pointer or 0 if not found
virtual MucRoom* findRoomByMember ( const String id,
bool  ref = false 
) [virtual]

Find a MUC room by member id

Parameters:
idRoom member id
refTrue to obtain a referenced pointer
Returns:
MucRoom pointer or 0 if not found
virtual ClientAccount* findSingleRegAccount ( const String skipProto = 0,
bool  ref = false 
) [virtual]

Check if there is a single registered account and return it

Parameters:
skipProtoOptional account protocol to skip
refTrue to get a referenced pointer
Returns:
ClientAccount pointer or 0 if not found
bool isLocalContact ( ClientContact c) const

Check if a contact is locally stored

Parameters:
cThe contact to check
Returns:
True if the contact owner is the account owning locally stored contacts
bool isLocalContact ( const String id) const [inline]

Check if a contact is locally stored

Parameters:
idContact id to check
Returns:
True if the contact owner is the account owning locally stored contacts
ClientAccount* localContacts ( ) const [inline]

Retrieve the account owning locally stored contacts

Returns:
ClientAccount pointer or 0
virtual void removeAccount ( const String id) [virtual]

Remove an account

Parameters:
idThe account's id

The documentation for this class was generated from the following file: