kopete/libkopete
#include <kopeteaccountmanager.h>
Public Types | |
enum | SetOnlineStatusFlag { ConnectIfOffline =0x01 } |
Public Slots | |
void | load () |
bool | resume () |
void | save () |
void | setOnlineStatus (uint category, const Kopete::StatusMessage &statusMessage, uint flags, bool forced) |
void | setOnlineStatus (uint category, const Kopete::StatusMessage &statusMessage=Kopete::StatusMessage(), uint flags=0) |
void | setStatusMessage (const QString &message) |
void | suspend () |
Signals | |
void | accountOnlineStatusChanged (Kopete::Account *account, const Kopete::OnlineStatus &oldStatus, const Kopete::OnlineStatus &newStatus) |
void | accountRegistered (Kopete::Account *account) |
void | accountUnregistered (const Kopete::Account *account) |
Public Member Functions | |
~AccountManager () | |
const QList< Account * > & | accounts () const |
QList< Account * > | accounts (Kopete::Protocol *protocol) const |
Account * | findAccount (const QString &protocolId, const QString &accountId) |
QColor | guessColor (Protocol *protocol) const |
bool | isAnyAccountConnected () const |
Account * | registerAccount (Account *account) |
void | removeAccount (Account *account) |
Static Public Member Functions | |
static AccountManager * | self () |
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 47 of file kopeteaccountmanager.h.
Member Enumeration Documentation
Flag to be used in setOnlineStatus.
ConnectIfOffline
: if set, this will connect offlines account with the status.
Enumerator | |
---|---|
ConnectIfOffline |
Definition at line 125 of file kopeteaccountmanager.h.
Constructor & Destructor Documentation
Kopete::AccountManager::~AccountManager | ( | ) |
Definition at line 100 of file kopeteaccountmanager.cpp.
Member Function Documentation
|
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
|
signal |
Signals when an account is ready for use.
const QList< Account * > & Kopete::AccountManager::accounts | ( | ) | const |
Retrieve the list of accounts.
- Returns
- a list of all the accounts
Definition at line 312 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
protocol
protocol
Definition at line 317 of file kopeteaccountmanager.cpp.
|
signal |
Signals when an account has been unregistered.
At this state, we are already in the Account destructor.
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 328 of file kopeteaccountmanager.cpp.
QColor Kopete::AccountManager::guessColor | ( | Protocol * | protocol | ) | const |
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 208 of file kopeteaccountmanager.cpp.
bool Kopete::AccountManager::isAnyAccountConnected | ( | ) | const |
Check if there is at least one account connected.
- Returns
- true if there at least one account connected, false otherwise.
Definition at line 107 of file kopeteaccountmanager.cpp.
|
slot |
Load the account data from KConfig
Definition at line 374 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 252 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 339 of file kopeteaccountmanager.cpp.
|
slot |
Resumes all accounts.
Returns false if network is not available.
Definition at line 193 of file kopeteaccountmanager.cpp.
|
slot |
Save the account data to KConfig
Definition at line 357 of file kopeteaccountmanager.cpp.
|
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 76 of file kopeteaccountmanager.cpp.
|
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 statusMessage is the new status message flags is a bitmask of SetOnlineStatusFlag forced is a boolean indicating that all accounts are required to change status
- Note
- KDE5: Merge these two setOnlineStatus functions (default value for forced is false)
Definition at line 118 of file kopeteaccountmanager.cpp.
|
slot |
Definition at line 148 of file kopeteaccountmanager.cpp.
|
slot |
Set the given status message for all online accounts.
- Parameters
-
message Status message to set
Definition at line 153 of file kopeteaccountmanager.cpp.
|
slot |
Suspends all accounts.
Definition at line 161 of file kopeteaccountmanager.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.