LeechCraft Azoth  %{LEECHCRAFT_VERSION}
Modular multiprotocol IM plugin for LeechCraft
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
LeechCraft::Azoth::IProxyObject Class Referenceabstract

#include "iproxyobject.h"

Public Types

enum  PublicResourceLoader { PRLClientIcons, PRLStatusIcons, PRLSystemIcons }
 

Public Member Functions

virtual ~IProxyObject ()
 
virtual QObject * GetSettingsManager ()=0
 Returns the Core's settings manager object. More...
 
virtual QString GetPassword (QObject *account)=0
 Retrieves the password for the given account. More...
 
virtual void SetPassword (const QString &password, QObject *account)=0
 Stores the password for the given account. More...
 
virtual QString GetAccountPassword (QObject *account, bool useStored=true)=0
 Retrieves password for the given account, asking user if needed. More...
 
virtual bool IsAutojoinAllowed ()=0
 Queries whether autojoin is allowed. More...
 
virtual QString StateToString (State state) const =0
 Returns a human-readable string for the given state. More...
 
virtual QString AuthStatusToString (AuthStatus status) const =0
 Returns serialized name of the authorization status. More...
 
virtual AuthStatus AuthStatusFromString (const QString &str) const =0
 Converts string representation to AuthStatus element. More...
 
virtual QObject * GetAccount (const QString &accID) const =0
 Returns the account object for the given account ID. More...
 
virtual QList< QObject * > GetAllAccounts () const =0
 Returns all the accounts registered in Azoth. More...
 
virtual QObject * GetEntry (const QString &entryID, const QString &accID) const =0
 Returns the entry object for the given entry ID. More...
 
virtual void OpenChat (const QString &entryID, const QString &accID, const QString &message=QString(), const QString &variant=QString()) const =0
 Opens the chat with the given entry. More...
 
virtual QList< QColor > GenerateColors (const QString &scheme) const =0
 Generates the nickname colors for the given scheme. More...
 
virtual QString GetNickColor (const QString &nick, const QList< QColor > &colors) const =0
 Returns the color for the given nick and color set. More...
 
virtual QString FormatDate (QDateTime date, QObject *message) const =0
 Formats the date for the given message. More...
 
virtual QString FormatNickname (QString nick, QObject *message, const QString &color) const =0
 Formats the nickname for the given message and color. More...
 
virtual QString FormatBody (QString body, QObject *message) const =0
 Formats the body for the given message. More...
 
virtual void PreprocessMessage (QObject *message)=0
 Preprocesses the message before displaying it. More...
 
virtual Util::ResourceLoader * GetResourceLoader (PublicResourceLoader loader) const =0
 
virtual QIcon GetIconForState (State state) const =0
 
virtual void FormatLinks (QString &body)=0
 

Detailed Description

Definition at line 47 of file iproxyobject.h.

Member Enumeration Documentation

Enumerator
PRLClientIcons 
PRLStatusIcons 
PRLSystemIcons 

Definition at line 52 of file iproxyobject.h.

Constructor & Destructor Documentation

virtual LeechCraft::Azoth::IProxyObject::~IProxyObject ( )
inlinevirtual

Definition at line 50 of file iproxyobject.h.

Member Function Documentation

virtual AuthStatus LeechCraft::Azoth::IProxyObject::AuthStatusFromString ( const QString &  str) const
pure virtual

Converts string representation to AuthStatus element.

The string that's passed should be the one previously returned from AuthStatusToString().

Parameters
[in]strString previously returned from AuthStatusToString().
Returns
AuthStatus element or ASNone if str is invalid.
See Also
AuthStatusToString()
virtual QString LeechCraft::Azoth::IProxyObject::AuthStatusToString ( AuthStatus  status) const
pure virtual

Returns serialized name of the authorization status.

Returns
Serialized name of the auth status.
See Also
AuthStatusFromString()
virtual QString LeechCraft::Azoth::IProxyObject::FormatBody ( QString  body,
QObject *  message 
) const
pure virtual

Formats the body for the given message.

This function should be used to format the body of the given message.

Parameters
[in]bodyThe body to format.
[in]messageThe message object implementing IMessage.
Returns
The formatted body.
virtual QString LeechCraft::Azoth::IProxyObject::FormatDate ( QDateTime  date,
QObject *  message 
) const
pure virtual

Formats the date for the given message.

This function should be used to format the date when displaying the given message.

Parameters
[in]dateThe date to format.
[in]messageThe message object implementing IMessage.
Returns
The formatted date string.
virtual void LeechCraft::Azoth::IProxyObject::FormatLinks ( QString &  body)
pure virtual
virtual QString LeechCraft::Azoth::IProxyObject::FormatNickname ( QString  nick,
QObject *  message,
const QString &  color 
) const
pure virtual

Formats the nickname for the given message and color.

This function should be used to format the nick when displaying the given message. The color should be the one from GetNickColor().

Parameters
[in]nickThe nickname to format.
[in]messageThe message object implementing IMessage.
[in]colorThe color of the nickname.
Returns
The formatted nickname.
virtual QList<QColor> LeechCraft::Azoth::IProxyObject::GenerateColors ( const QString &  scheme) const
pure virtual

Generates the nickname colors for the given scheme.

If the scheme is empty or equals "hash", then a random set of colors is generated based on current palette and settings. Otherwise, scheme is interpreted as space-separated list of colors, either named, like "green" or "cyan", or their RGB values in forms like "#FA12BB".

Parameters
[in]schemeThe color scheme to use.
Returns
The list of colors matching the given color scheme.
virtual QObject* LeechCraft::Azoth::IProxyObject::GetAccount ( const QString &  accID) const
pure virtual

Returns the account object for the given account ID.

If there is no such account, NULL is returned.

Parameters
[in]accIDThe unique account ID.
Returns
Account object implementing IAccount, or NULL if no such account exists.
virtual QString LeechCraft::Azoth::IProxyObject::GetAccountPassword ( QObject *  account,
bool  useStored = true 
)
pure virtual

Retrieves password for the given account, asking user if needed.

Returns password for the given account. If no password is stored, this function asks user to enter one and tries to store it after that. If the user refuses to enter a password, a null string would be returned.

If there was no password and user entered a non-null string, this function would call SetPassword() by itself, so there is no need to call SetPassword() explicitly.

This function may also ignore the already stored password if useStored is set to false. This is useful, for example, when a password previously returned by this function turned out to be wrong.

The account object should implement the IAccount interface. Accounts are distinguished by their IDs.

Parameters
[in]accountThe account for which to retrieve the password. The object should implement IAccount.
[in]useStoredWhether returning already stored password is OK.
Returns
The stored password, or user-entered password if there is no stored password or useStored is false, or null string if there is no stored password and user refused to enter one.
See Also
GetPassword()
virtual QList<QObject*> LeechCraft::Azoth::IProxyObject::GetAllAccounts ( ) const
pure virtual

Returns all the accounts registered in Azoth.

Returns
The list of objects implementing IAccount.
virtual QObject* LeechCraft::Azoth::IProxyObject::GetEntry ( const QString &  entryID,
const QString &  accID 
) const
pure virtual

Returns the entry object for the given entry ID.

Parameters
[in]entryIDThe entry ID.
[in]accIDThe account ID to which this entry belongs.
Returns
Entry object, or NULL if no such entry exists.
virtual QIcon LeechCraft::Azoth::IProxyObject::GetIconForState ( State  state) const
pure virtual
virtual QString LeechCraft::Azoth::IProxyObject::GetNickColor ( const QString &  nick,
const QList< QColor > &  colors 
) const
pure virtual

Returns the color for the given nick and color set.

This function should be used to choose a color for the given nick. Internally, it calculates a hash from the nick and uses it to choose a corresponding color.

Parameters
[in]nickThe nickname for which to choose the color.
[in]colorsThe list of colors to choose from.
Returns
The color name to use.
virtual QString LeechCraft::Azoth::IProxyObject::GetPassword ( QObject *  account)
pure virtual

Retrieves the password for the given account.

Returns password for the given account, or a null string if no password is stored. The password should be previously set (stored) by the call to SetPassword().

The account object should implement the IAccount interface. Accounts are distinguished by their IDs.

Parameters
[in]accountThe account for which to retrieve the password. The object should implement IAccount.
Returns
The stored password or null string if no password is stored.
Note
This function may return null passwords even after corresponding calls to SetPassword() since the implementation uses secure storage plugins to store passwords, and if no such plugins are installed, no passwords are stored.
See Also
GetAccountPassword(), SetPassword(), IAccount
virtual Util::ResourceLoader* LeechCraft::Azoth::IProxyObject::GetResourceLoader ( PublicResourceLoader  loader) const
pure virtual
virtual QObject* LeechCraft::Azoth::IProxyObject::GetSettingsManager ( )
pure virtual

Returns the Core's settings manager object.

The returned object's properties could be queried to find out the settings and parameters of Core's settings.

Returns
Core's settings manager object.
virtual bool LeechCraft::Azoth::IProxyObject::IsAutojoinAllowed ( )
pure virtual

Queries whether autojoin is allowed.

Returns
Whether autojoin is allowed.
virtual void LeechCraft::Azoth::IProxyObject::OpenChat ( const QString &  entryID,
const QString &  accID,
const QString &  message = QString(),
const QString &  variant = QString() 
) const
pure virtual

Opens the chat with the given entry.

This function allows to open a chat with the given entry identified by entryID for the given account identified by accId.

Parameters
[in]entryIDThe ID of the entry to open chat with.
[in]accIDThe ID of the account where entryID belongs.
[in]messagePrepare this text in the message editor.
[in]variantSelect this variant, if available.
virtual void LeechCraft::Azoth::IProxyObject::PreprocessMessage ( QObject *  message)
pure virtual

Preprocesses the message before displaying it.

This function should be called once on each message before displaying it.

Parameters
[in]messageThe message to preprocess.
virtual void LeechCraft::Azoth::IProxyObject::SetPassword ( const QString &  password,
QObject *  account 
)
pure virtual

Stores the password for the given account.

The password set by this function overwrites any previously set ones. After this function is called for given account, the GetPassword() would return either the last stored password or null string if no password storage plugin is installed.

The account object should implement the IAccount interface. Accounts are distinguished by their IDs.

Parameters
[in]passwordThe password string to store. Null string may be used to overwrite/clear the saved password.
[in]accountThe account for which the password should be stored. The object should implement IAccount.
See Also
GetPassword(), IAccount
virtual QString LeechCraft::Azoth::IProxyObject::StateToString ( State  state) const
pure virtual

Returns a human-readable string for the given state.

Returns
Human-readable string describing state.

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