#include <TelepathyQt4/Prototype/AccountManager.h>
Signals | |
void | signalAccountsUpdated () |
void | signalNewAccountAvailable (TpPrototype::Account *account) |
void | signalAboutToRemoveAccount (TpPrototype::Account *account) |
void | signalAccountRemoved () |
void | signalAccountUpdated (TpPrototype::Account *account) |
Public Member Functions | |
int | count () ATTRIBUTE_DEPRECATED |
QList< QPointer< Account > > | accountList () |
QList< QPointer< Account > > | accountListOfEnabledAccounts () |
bool | createAccount (const QString &connectionManager, const QString &protocol, const QString &displayName, const QVariantMap ¶meters) |
bool | removeAccount (Account *account) |
Static Public Member Functions | |
static AccountManager * | instance () |
Protected Slots | |
void | slotAccountValidityChanged (const QDBusObjectPath &account, bool valid) |
void | slotAccountRemoved (const QDBusObjectPath &account) |
void | slotAccountRemoved () |
void | slotAccountUpdated () |
Protected Member Functions | |
AccountManager (QObject *parent=NULL) | |
~AccountManager () |
AccountManager::AccountManager | ( | QObject * | parent = NULL |
) | [protected] |
Constructor. The account manager cannot be instantiated directly. Use instance() for it!
Referenced by instance().
AccountManager::~AccountManager | ( | ) | [protected] |
QList< QPointer< Account > > AccountManager::accountList | ( | ) |
List of accounts. The account pointer is stored in a QPointer. If the account is removed it is deleted by the account manager. Thus, the pointer is set to 0.
Referenced by accountListOfEnabledAccounts().
QList< QPointer< Account > > AccountManager::accountListOfEnabledAccounts | ( | ) |
List of enabled accounts
References accountList(), and count().
int AccountManager::count | ( | ) |
Number of Accounts. Returns how many accounts are available.
Referenced by accountListOfEnabledAccounts().
bool AccountManager::createAccount | ( | const QString & | connectionManager, | |
const QString & | protocol, | |||
const QString & | displayName, | |||
const QVariantMap & | parameters | |||
) |
Create account. This function creates an account with the given parameters.
Note: Although this call is synchronous, the internal book keeping of valid accounts is updated by DBUS signals that might need some time. Thus, calling count() emmediately after create might return an incorrect value. Wait until signalAccountsUpdated() is emitted.
connectionManager | The name of the connection manager, e.g. "salut". | |
protocol | The protocol, e.g. "local-xmpp". | |
parameters | List of parameters needed to create the account | |
displayName | The name of the account to display. |
AccountManager * AccountManager::instance | ( | ) | [static] |
Returns pointer to the instance of this class.
References AccountManager().
bool TpPrototype::AccountManager::removeAccount | ( | Account * | account | ) |
Remove account. Removes the given account.
account | The pointer to the account. The pointer is not accessable after this call! |
void TpPrototype::AccountManager::signalAboutToRemoveAccount | ( | TpPrototype::Account * | account | ) | [signal] |
An account will be removed from internal data. This signal is emitted after the account was removed but immediately before the account is removed from the internal lists.
Use this signal to obtain all necessary information to handle this remove operation properly. The signal signalAccountRemoved() will be called immediately after cleaning the internal lists.
Do not use account after receiving this signal!
Referenced by slotAccountRemoved(), and slotAccountValidityChanged().
void TpPrototype::AccountManager::signalAccountRemoved | ( | ) | [signal] |
An account was removed. This signal is emitted after signalAboutToRemoveAccount(). The internal lists are updated now.
Referenced by slotAccountRemoved(), and slotAccountValidityChanged().
void TpPrototype::AccountManager::signalAccountsUpdated | ( | ) | [signal] |
Some changes occurred on the account data. This signal is emitted if the internal data of the account manager is changed (accounts were created or removed).
It is suggested to refetch all locally stored data after this signal.
Referenced by slotAccountRemoved(), slotAccountUpdated(), and slotAccountValidityChanged().
void TpPrototype::AccountManager::signalAccountUpdated | ( | TpPrototype::Account * | account | ) | [signal] |
An account was updated. This signal is emitted after an account was updated.
Referenced by slotAccountUpdated().
void TpPrototype::AccountManager::signalNewAccountAvailable | ( | TpPrototype::Account * | account | ) | [signal] |
A new account is available. This signal is emitted if a new account was created by a contact manager
Referenced by slotAccountValidityChanged().
void AccountManager::slotAccountRemoved | ( | ) | [protected, slot] |
void AccountManager::slotAccountRemoved | ( | const QDBusObjectPath & | account | ) | [protected, slot] |
References signalAboutToRemoveAccount(), signalAccountRemoved(), and signalAccountsUpdated().
void AccountManager::slotAccountUpdated | ( | ) | [protected, slot] |
References signalAccountsUpdated(), and signalAccountUpdated().
void AccountManager::slotAccountValidityChanged | ( | const QDBusObjectPath & | account, | |
bool | valid | |||
) | [protected, slot] |