• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/libkopete

  • Kopete
  • AccountManager
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
Kopete::AccountManager Class Reference

#include <kopeteaccountmanager.h>

Inheritance diagram for Kopete::AccountManager:
Inheritance graph
[legend]

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()

Author
Martijn Klingens kling.nosp@m.ens@.nosp@m.kde.o.nosp@m.rg
Olivier Goffart <ogoffart@kde.org>

Definition at line 47 of file kopeteaccountmanager.h.

Member Enumeration Documentation

enum Kopete::AccountManager::SetOnlineStatusFlag

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

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
accountAccount which changed its onlinestatus
oldStatusThe online status before the change
newStatusThe new online status
void Kopete::AccountManager::accountRegistered ( Kopete::Account *  account)
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
protocolthe protocol to get accounts for
Returns
the list of accounts that belong to the protocol protocol

Definition at line 317 of file kopeteaccountmanager.cpp.

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.

Account * Kopete::AccountManager::findAccount ( const QString &  protocolId,
const QString &  accountId 
)

Return the account asked.

Parameters
protocolIdis the ID for the protocol
accountIdis 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.

void Kopete::AccountManager::load ( )
slot

Load the account data from KConfig

Definition at line 374 of file kopeteaccountmanager.cpp.

Account * Kopete::AccountManager::registerAccount ( Account *  account)

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.

bool Kopete::AccountManager::resume ( )
slot

Resumes all accounts.

Returns false if network is not available.

Definition at line 193 of file kopeteaccountmanager.cpp.

void Kopete::AccountManager::save ( )
slot

Save the account data to KConfig

Definition at line 357 of file kopeteaccountmanager.cpp.

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 76 of file kopeteaccountmanager.cpp.

void Kopete::AccountManager::setOnlineStatus ( uint  category,
const Kopete::StatusMessage &  statusMessage,
uint  flags,
bool  forced 
)
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
categoryis one of the Kopete::OnlineStatusManager::Categories
statusMessageis the new status message
flagsis a bitmask of SetOnlineStatusFlag
forcedis 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.

void Kopete::AccountManager::setOnlineStatus ( uint  category,
const Kopete::StatusMessage &  statusMessage = Kopete::StatusMessage(),
uint  flags = 0 
)
slot

Definition at line 148 of file kopeteaccountmanager.cpp.

void Kopete::AccountManager::setStatusMessage ( const QString &  message)
slot

Set the given status message for all online accounts.

Parameters
messageStatus message to set

Definition at line 153 of file kopeteaccountmanager.cpp.

void Kopete::AccountManager::suspend ( )
slot

Suspends all accounts.

Definition at line 161 of file kopeteaccountmanager.cpp.


The documentation for this class was generated from the following files:
  • kopeteaccountmanager.h
  • kopeteaccountmanager.cpp
This file is part of the KDE documentation.
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.

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal