kopete/libkopete
Kopete::AccountManager Class Reference
#include <kopeteaccountmanager.h>

Detailed Description
AccountManager manages all defined accounts in Kopete.You can query them and globally set them all online or offline from here.
AccountManager is a singleton, you may uses it with AccountManager::self()
Definition at line 44 of file kopeteaccountmanager.h.
Public Types | |
| enum | SetOnlineStatusFlag { ConnectIfOffline = 0x01 } |
Public Slots | |
| void | setOnlineStatus (uint category, const QString &awayMessage=QString(), uint flags=0) |
| void | setStatusMessage (const QString &message) |
| void | save () |
| void | load () |
Signals | |
| void | accountRegistered (Kopete::Account *account) |
| void | accountUnregistered (const Kopete::Account *account) |
| void | accountOnlineStatusChanged (Kopete::Account *account, const Kopete::OnlineStatus &oldStatus, const Kopete::OnlineStatus &newStatus) |
Public Member Functions | |
| ~AccountManager () | |
| const QList< Account * > & | accounts () const |
| QList< Account * > | accounts (Kopete::Protocol *protocol) const |
| Account * | findAccount (const QString &protocolId, const QString &accountId) |
| void | removeAccount (Account *account) |
| QColor | guessColor (Protocol *protocol) const |
| Account * | registerAccount (Account *account) |
Static Public Member Functions | |
| static AccountManager * | self () |
Member Enumeration Documentation
Flag to be used in setOnlineStatus.
ConnectIfOffline : if set, this will connect offlines account with the status.
Definition at line 117 of file kopeteaccountmanager.h.
Constructor & Destructor Documentation
| Kopete::AccountManager::~AccountManager | ( | ) |
Definition at line 88 of file kopeteaccountmanager.cpp.
Member Function Documentation
| AccountManager * Kopete::AccountManager::self | ( | ) | [static] |
Retrieve the instance of AccountManager.
The account manager is a singleton class of which only a single instance will exist. If no manager exists yet this function will create one for you.
- Returns:
- the instance of the AccountManager
Definition at line 69 of file kopeteaccountmanager.cpp.
Retrieve the list of accounts.
- Returns:
- a list of all the accounts
Definition at line 232 of file kopeteaccountmanager.cpp.
| QList< Account * > Kopete::AccountManager::accounts | ( | Kopete::Protocol * | protocol | ) | const |
Retrieve a list of accounts per protocol.
Provides a list of accounts for a certain protocol. If there are no accounts for that protocol then the list is empty.
- Parameters:
-
protocol the protocol to get accounts for
- Returns:
- the list of accounts that belong to the
protocolprotocol
Definition at line 237 of file kopeteaccountmanager.cpp.
| Account * Kopete::AccountManager::findAccount | ( | const QString & | protocolId, | |
| const QString & | accountId | |||
| ) |
Return the account asked.
- Parameters:
-
protocolId is the ID for the protocol accountId is the ID for the account you want
- Returns:
- the Account object found or NULL if no account was found
Definition at line 248 of file kopeteaccountmanager.cpp.
| void Kopete::AccountManager::removeAccount | ( | Account * | account | ) |
Delete the account and clean the config data.
This is praticaly called by the account config page when you remove the account.
Definition at line 259 of file kopeteaccountmanager.cpp.
Guess the color for a new account.
Guesses a color for the next account of a given protocol based on the already registered colors
- Returns:
- the color guessed for the account
Definition at line 143 of file kopeteaccountmanager.cpp.
Register the account.
This adds the account in the manager's account list. It will check no accounts already exist with the same ID, if any, the account is deleted. and not added
- Returns:
account, or 0L if the account was deleted because id collision
Definition at line 187 of file kopeteaccountmanager.cpp.
| void Kopete::AccountManager::setOnlineStatus | ( | uint | category, | |
| const QString & | awayMessage = QString(), |
|||
| uint | flags = 0 | |||
| ) | [slot] |
Set all accounts a status in the specified category.
Account that are offline will not be connected, unless the ConnectIfOffline flag is set.
- Parameters:
-
category is one of the Kopete::OnlineStatusManager::Categories awayMessage is the new away message flags is a bitmask of SetOnlineStatusFlag
Definition at line 106 of file kopeteaccountmanager.cpp.
| void Kopete::AccountManager::setStatusMessage | ( | const QString & | message | ) | [slot] |
Set the given status message for all online accounts.
- Parameters:
-
message Status message to set
Definition at line 135 of file kopeteaccountmanager.cpp.
| void Kopete::AccountManager::save | ( | ) | [slot] |
Definition at line 315 of file kopeteaccountmanager.cpp.
| void Kopete::AccountManager::load | ( | ) | [slot] |
Definition at line 332 of file kopeteaccountmanager.cpp.
| void Kopete::AccountManager::accountRegistered | ( | Kopete::Account * | account | ) | [signal] |
Signals when an account is ready for use.
| void Kopete::AccountManager::accountUnregistered | ( | const Kopete::Account * | account | ) | [signal] |
Signals when an account has been unregistered.
At this state, we are already in the Account destructor.
| void Kopete::AccountManager::accountOnlineStatusChanged | ( | Kopete::Account * | account, | |
| const Kopete::OnlineStatus & | oldStatus, | |||
| const Kopete::OnlineStatus & | newStatus | |||
| ) | [signal] |
An account has changed its onlinestatus Technically this monitors Account::myself() onlinestatus changes.
- Parameters:
-
account Account which changed its onlinestatus oldStatus The online status before the change newStatus The new online status
The documentation for this class was generated from the following files:
KDE 4.0 API Reference