an Extendable KDE Blogging Client Logo

Blokkal::Account Class Reference

This class provides the interface for a bloggging account. More...

#include <blokkalaccount.h>

Inheritance diagram for Blokkal::Account:


List of all members.

Public Types

enum  ConnectionStatus { Connected = 1, Connecting = 2, Disconnected = 3 }
enum  DisconnectReason { UserDisconnect = 1, IOErrorDisconnect = 2, OtherDisconnect = 3, AuthenticationDisconnect = 4 }

Public Slots

Blokkal::Io::CategoryManagercategoryManager (void) const
virtual void connectAccount (void)=0
virtual void disconnectAccount (Blokkal::Account::DisconnectReason reason=UserDisconnect, const QString &reasonString=0)
void restoreBlogs (void)


void accountDestroyed (Blokkal::Account *account)
void blogRegistered (Blokkal::Blog *blog)
void blogUnregistered (Blokkal::Blog *blog)
void connectionStatusChanged (Blokkal::Account *account)

Public Member Functions

virtual QList< QAction * > actionList (void)
bool autoConnect (void) const
Blokkal::Blogblog (const QString &id) const
QList< Blokkal::Blog * > blogs (void) const
KUrl connectAddress (void) const
Blokkal::Account::ConnectionStatus connectionStatus (void) const
QString dataDirectory (void) const
virtual KIcon icon (void) const
QString id (void) const
bool isConnected (void) const
bool isDisconnected (void) const
Blokkal::Protocolprotocol (void) const
virtual void removeAccount (void)
QString serverName (void) const
void setAutoConnect (bool enable) const
void setConnectAddress (const QString &address)
void setServerName (const QString &serverName)
void setUserName (const QString &user)
void setUsesDefaultConnectAddress (bool useDefault)
QString userName (void) const
bool usesDefaultConnectAddress (void) const
virtual ~Account (void)

Protected Slots

Blokkal::BlogregisterBlog (Blokkal::Blog *blog)
void unregisterBlog (Blokkal::Blog *blog)

Protected Member Functions

 Account (Blokkal::Protocol *protocol, const QString &id=0)
QDomElement blogNode (const QString &id)
Blokkal::AccountConfigconfig (void) const
virtual Blokkal::BlogrestoreBlog (Blokkal::BlogConfig *config)=0
void setConnectionStatus (Blokkal::Account::ConnectionStatus status)


class BlogConfig

Detailed Description

This class provides the interface for a bloggging account.

This class provides the interface for a bloggging account.

Martin Müller <>

Definition at line 52 of file blokkalaccount.h.

Member Enumeration Documentation

Enumeration for the connection state.

Connected  Account is connected.
Connecting  Account is connecting.
Disconnected  Account is disconnected.

Definition at line 59 of file blokkalaccount.h.

Enumeration for disconnect reasons

UserDisconnect  Disconnected due to user action.
IOErrorDisconnect  Disconnected due to some IO error.
OtherDisconnect  Disconnected for some other reason.

Definition at line 68 of file blokkalaccount.h.

Constructor & Destructor Documentation

Blokkal::Account::~Account ( void   )  [virtual]

Destroys the object. The configuration will not be removed. If you want to destroy this account permanently, use removeAccount()

Definition at line 80 of file blokkalaccount.cpp.

Blokkal::Account::Account ( Blokkal::Protocol protocol,
const QString &  id = 0 
) [protected]

Creates a new account for protocol protocol, with name id

protocol the procotol of this account
id the id of this account

Definition at line 69 of file blokkalaccount.cpp.

Member Function Documentation

void Blokkal::Account::accountDestroyed ( Blokkal::Account account  )  [signal]

This signal is emitted when the account object is destroyed

QList< QAction * > Blokkal::Account::actionList ( void   )  [virtual]

Returns a list of custom actions for context menus. The default implementation returns an empty list.

a list of custom actions

Definition at line 472 of file blokkalaccount.cpp.

bool Blokkal::Account::autoConnect ( void   )  const

Returns whether this account may be connected automatically.

whether this account may be connected automatically

Definition at line 348 of file blokkalaccount.cpp.

Blokkal::Blog * Blokkal::Account::blog ( const QString &  id  )  const

Returns the blog with the internal id id or 0 if no such blog has been registered.

the blog

Definition at line 227 of file blokkalaccount.cpp.

QDomElement Blokkal::Account::blogNode ( const QString &  id  )  [protected]

Returns the node of the blog with name blogName if it exists. If it does not exist, a new node for this blog will be created, but not inserted in the tree. This method is used by the BlogConfig constructor.

id get the node for this blog.
the configuration node

Definition at line 287 of file blokkalaccount.cpp.

void Blokkal::Account::blogRegistered ( Blokkal::Blog blog  )  [signal]

This signal is emitted, when a blog is registered by the account

QList< Blokkal::Blog * > Blokkal::Account::blogs ( void   )  const

Returns a list of currently registered blogs.

current blogs

Definition at line 190 of file blokkalaccount.cpp.

void Blokkal::Account::blogUnregistered ( Blokkal::Blog blog  )  [signal]

This signal is emitted, when a blog is unregistered from the account.

Blokkal::Io::CategoryManager * Blokkal::Account::categoryManager ( void   )  const [slot]

Returns the category manager for this account.

the category manager for this account

Definition at line 358 of file blokkalaccount.cpp.

Blokkal::AccountConfig * Blokkal::Account::config ( void   )  const [protected]

Returns the account config object for this account.

the account config

Definition at line 89 of file blokkalaccount.cpp.

virtual void Blokkal::Account::connectAccount ( void   )  [pure virtual, slot]

This method is called to prepare any succeeding actions. You are required to gather any required information (e.g. blogs accessible for the user ) and emit connectionStatusChanged(). Do not forget to set the new connection status with setConnectionStatus()

Implemented in Blokkal::PasswordedAccount.

KUrl Blokkal::Account::connectAddress ( void   )  const

Returns the address this account connects to.

the address this account connects to

Definition at line 104 of file blokkalaccount.cpp.

Blokkal::Account::ConnectionStatus Blokkal::Account::connectionStatus ( void   )  const

Returns the connection state of the account.

See also:
the current connection status

Definition at line 135 of file blokkalaccount.cpp.

void Blokkal::Account::connectionStatusChanged ( Blokkal::Account account  )  [signal]

This signals is emitted when the connection status changes.

account the account that has a new connection status

QString Blokkal::Account::dataDirectory ( void   )  const

Returns the data directory, where an account may store its private data.

the account data directory

Definition at line 236 of file blokkalaccount.cpp.

void Blokkal::Account::disconnectAccount ( Blokkal::Account::DisconnectReason  reason = UserDisconnect,
const QString &  reasonString = 0 
) [virtual, slot]

This method is called to close the current session. The default implementation just calls setConnectionStatus() and emits connectionStatusChanged(). If reason indicates that the account was not disconnected at behalf of the user a notification will be generated.

It is good practice to override this method, so that any pending connections and connection attempts are canceled.
reason the reaon for the disconnect
reasonString to use instead of a generic error message

Reimplemented in Blokkal::PasswordedAccount.

Definition at line 149 of file blokkalaccount.cpp.

KIcon Blokkal::Account::icon ( void   )  const [virtual]

Returns the icon for this account

the icon for this account

Definition at line 119 of file blokkalaccount.cpp.

QString Blokkal::Account::id ( void   )  const

Returns the unique id of this account.

the unique id of this account

Definition at line 109 of file blokkalaccount.cpp.

bool Blokkal::Account::isConnected ( void   )  const

This is equal to connectionStatus() == Connected

TRUE if connectionStatus() == Connected

Definition at line 277 of file blokkalaccount.cpp.

bool Blokkal::Account::isDisconnected ( void   )  const

This is equal to connectionStatus() == Disconnected

TRUE if connectionStatus() == Disconnected

Definition at line 282 of file blokkalaccount.cpp.

Blokkal::Protocol * Blokkal::Account::protocol ( void   )  const

Returns the protocol owning this account.

the account's protocol

Definition at line 94 of file blokkalaccount.cpp.

Blokkal::Blog * Blokkal::Account::registerBlog ( Blokkal::Blog blog  )  [protected, slot]

Checks that blog does not already exists and registers it. If it tries to take over an already registered blog, blog will be deleted. If a registered blog is deleted it will be unregistered automatically

blog the new blog
blog or 0 if it was not registered
See also:

Definition at line 195 of file blokkalaccount.cpp.

void Blokkal::Account::removeAccount ( void   )  [virtual]

Removes the account from the configuration and deletes this object. You need to override this method only to delete additional configuration data.

Reimplemented in Blokkal::PasswordedAccount.

Definition at line 124 of file blokkalaccount.cpp.

virtual Blokkal::Blog* Blokkal::Account::restoreBlog ( Blokkal::BlogConfig config  )  [protected, pure virtual]

Restores the blog according to the information in config. If you do not want or are unable to restore the blog for some reason return 0.

config restore the blog with this configuration
the restored blog or 0 if the blog was not restored
See also:

void Blokkal::Account::restoreBlogs ( void   )  [slot]

Restores the blogs

Definition at line 317 of file blokkalaccount.cpp.

QString Blokkal::Account::serverName ( void   )  const

Returns the server name this account uses. The key in the config is "servername".

the server name
See also:

Definition at line 99 of file blokkalaccount.cpp.

void Blokkal::Account::setAutoConnect ( bool  enable  )  const

Sets whether this account may be connected automatically.

enable TRUE allow this account to be connected automatically

Definition at line 353 of file blokkalaccount.cpp.

void Blokkal::Account::setConnectAddress ( const QString &  address  ) 

Sets the connect address.

address the connect address

Definition at line 262 of file blokkalaccount.cpp.

void Blokkal::Account::setConnectionStatus ( Blokkal::Account::ConnectionStatus  status  )  [protected]

Sets the value returned by connectionStatus. Emits connectionStatusChanged().

status the new connection status

Definition at line 140 of file blokkalaccount.cpp.

void Blokkal::Account::setServerName ( const QString &  serverName  ) 

Sets the server name.

serverName the new server name

Definition at line 257 of file blokkalaccount.cpp.

void Blokkal::Account::setUserName ( const QString &  user  ) 

Sets the username used by this account.

user the username used by this account.

Definition at line 272 of file blokkalaccount.cpp.

void Blokkal::Account::setUsesDefaultConnectAddress ( bool  useDefault  ) 

Determines whether the connect address for this account is the default one or not

useDefault TRUE if this account uses the default address

Definition at line 267 of file blokkalaccount.cpp.

void Blokkal::Account::unregisterBlog ( Blokkal::Blog blog  )  [protected, slot]

Unregisters a blog.

blog blog to unregister
See also:

Definition at line 219 of file blokkalaccount.cpp.

QString Blokkal::Account::userName ( void   )  const

Returns the user name this account uses. The key in the config is "username".

the user name this account uses

Definition at line 114 of file blokkalaccount.cpp.

bool Blokkal::Account::usesDefaultConnectAddress ( void   )  const

Returns the whether this account uses the default address or not.

TRUE if the default address is used

Definition at line 130 of file blokkalaccount.cpp.

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