LeechCraft Azoth  0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
LC::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 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 QByteArray AuthStatusToString (AuthStatus status) const =0
 Returns serialized name of the authorization status. More...
 
virtual AuthStatus AuthStatusFromString (const QByteArray &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 QWidget * FindOpenedChat (const QString &entryID, const QByteArray &accID) const =0
 
virtual Util::ResourceLoader * GetResourceLoader (PublicResourceLoader loader) const =0
 
virtual QIcon GetIconForState (State state) const =0
 
virtual QObject * CreateCoreMessage (const QString &body, const QDateTime &date, IMessage::Type type, IMessage::Direction dir, QObject *other, QObject *parent=nullptr)=0
 
virtual QString ToPlainBody (QString body)=0
 
virtual bool IsMessageRead (QObject *msgObj)=0
 
virtual void MarkMessagesAsRead (QObject *entryObject)=0
 
virtual QString PrettyPrintDateTime (const QDateTime &datetime)=0
 Formats the datetime according to current locale. More...
 
virtual std::optional< CustomStatusFindCustomStatus (const QString &name) const =0
 Tries to find a cusotm status under the given name. More...
 
virtual QStringList GetCustomStatusNames () const =0
 Returns the names of all available custom statuses. More...
 
virtual void RedrawItem (QObject *) const =0
 
virtual QObject * GetFirstUnreadMessage (QObject *entryObj) const =0
 
virtual QImage GetDefaultAvatar (int size=-1) const =0
 
virtual IFormatterProxyObjectGetFormatterProxy ()=0
 
virtual IAvatarsManagerGetAvatarsManager ()=0
 

Detailed Description

Definition at line 130 of file iproxyobject.h.

Member Enumeration Documentation

◆ PublicResourceLoader

Enumerator
PRLClientIcons 
PRLStatusIcons 
PRLSystemIcons 

Definition at line 135 of file iproxyobject.h.

Constructor & Destructor Documentation

◆ ~IProxyObject()

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

Definition at line 133 of file iproxyobject.h.

Member Function Documentation

◆ AuthStatusFromString()

virtual AuthStatus LC::Azoth::IProxyObject::AuthStatusFromString ( const QByteArray &  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()

◆ AuthStatusToString()

virtual QByteArray LC::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()

◆ CreateCoreMessage()

virtual QObject* LC::Azoth::IProxyObject::CreateCoreMessage ( const QString &  body,
const QDateTime &  date,
IMessage::Type  type,
IMessage::Direction  dir,
QObject *  other,
QObject *  parent = nullptr 
)
pure virtual

◆ FindCustomStatus()

virtual std::optional<CustomStatus> LC::Azoth::IProxyObject::FindCustomStatus ( const QString &  name) const
pure virtual

Tries to find a cusotm status under the given name.

Parameters
[in]nameThe name of the custom status.
Returns
A custom status if it's found, or an empty std::optional object otherwise.
See also
GetCustomStatusNames()

◆ FindOpenedChat()

virtual QWidget* LC::Azoth::IProxyObject::FindOpenedChat ( const QString &  entryID,
const QByteArray &  accID 
) const
pure virtual

◆ GetAccount()

virtual QObject* LC::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.

◆ GetAccountPassword()

virtual QString LC::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()

◆ GetAllAccounts()

virtual QList<QObject*> LC::Azoth::IProxyObject::GetAllAccounts ( ) const
pure virtual

Returns all the accounts registered in Azoth.

Returns
The list of objects implementing IAccount.

◆ GetAvatarsManager()

virtual IAvatarsManager* LC::Azoth::IProxyObject::GetAvatarsManager ( )
pure virtual

◆ GetCustomStatusNames()

virtual QStringList LC::Azoth::IProxyObject::GetCustomStatusNames ( ) const
pure virtual

Returns the names of all available custom statuses.

The returned names can be passed to FindCustomStatus() to obtain the full CustomStatus structure.

Returns
The names of custom statuses, suitable for FindCustomStatus().
See also
FindCustomStatus()

◆ GetDefaultAvatar()

virtual QImage LC::Azoth::IProxyObject::GetDefaultAvatar ( int  size = -1) const
pure virtual

◆ GetEntry()

virtual QObject* LC::Azoth::IProxyObject::GetEntry ( const QString &  entryID,
const QString &  accID = {} 
) const
pure virtual

Returns the entry object for the given entry ID.

The accID may be empty, in which case all available accounts are queried.

Parameters
[in]entryIDThe entry ID.
[in]accIDThe account ID to which this entry belongs.
Returns
Entry object, or NULL if no such entry exists.

◆ GetFirstUnreadMessage()

virtual QObject* LC::Azoth::IProxyObject::GetFirstUnreadMessage ( QObject *  entryObj) const
pure virtual

◆ GetFormatterProxy()

virtual IFormatterProxyObject& LC::Azoth::IProxyObject::GetFormatterProxy ( )
pure virtual

◆ GetIconForState()

virtual QIcon LC::Azoth::IProxyObject::GetIconForState ( State  state) const
pure virtual

◆ GetResourceLoader()

virtual Util::ResourceLoader* LC::Azoth::IProxyObject::GetResourceLoader ( PublicResourceLoader  loader) const
pure virtual

◆ GetSettingsManager()

virtual QObject* LC::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.

◆ IsAutojoinAllowed()

virtual bool LC::Azoth::IProxyObject::IsAutojoinAllowed ( )
pure virtual

Queries whether autojoin is allowed.

Returns
Whether autojoin is allowed.

◆ IsMessageRead()

virtual bool LC::Azoth::IProxyObject::IsMessageRead ( QObject *  msgObj)
pure virtual

◆ MarkMessagesAsRead()

virtual void LC::Azoth::IProxyObject::MarkMessagesAsRead ( QObject *  entryObject)
pure virtual

◆ OpenChat()

virtual void LC::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 one 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.

◆ PrettyPrintDateTime()

virtual QString LC::Azoth::IProxyObject::PrettyPrintDateTime ( const QDateTime &  datetime)
pure virtual

Formats the datetime according to current locale.

This method returns the datetime formatted according to the current locale. The timezones are respected.

The primary difference from QLocale {}.toString (datetime) is that Boost.Locale backend is used if available to avoid nasty timezone-related problems.

Parameters
[in]datetimeThe timestamp to format.
Returns
The formatted datetime as string.

◆ RedrawItem()

virtual void LC::Azoth::IProxyObject::RedrawItem ( QObject *  ) const
pure virtual

◆ SetPassword()

virtual void LC::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

◆ StateToString()

virtual QString LC::Azoth::IProxyObject::StateToString ( State  state) const
pure virtual

Returns a human-readable string for the given state.

Returns
Human-readable string describing state.

◆ ToPlainBody()

virtual QString LC::Azoth::IProxyObject::ToPlainBody ( QString  body)
pure virtual

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