![]() |
LeechCraft Azoth 0.6.70-18450-gabe19ee3b0
Modular multiprotocol IM plugin for LeechCraft
|
Interface representing a single account. More...
#include "iaccount.h"
Public Types | |
| enum | AccountFeature { FRenamable = 0x01 , FSupportsXA = 0x02 , FHasConfigurationDialog = 0x04 , FCanAddContactsInOffline = 0x08 , FCanViewContactsInfoInOffline = 0x10 , FMUCsSupportFileTransfers = 0x20 } |
Public Member Functions | |
| Emitters::Account & | GetAccountEmitter () |
| virtual QObject * | GetQObject ()=0 |
| Returns the account object as a QObject. | |
| virtual QObject * | GetParentProtocol () const =0 |
| Returns the pointer to the parent protocol that this account belongs to. | |
| virtual AccountFeatures | GetAccountFeatures () const =0 |
| Returns the OR-ed combination of features of this account. | |
| virtual QList< ICLEntry * > | GetCLEntries ()=0 |
| Returns the list of contact list entries of this account. | |
| virtual QString | GetAccountName () const =0 |
| Returns the human-readable name of this account. | |
| virtual QString | GetOurNick () const =0 |
| Returns the nickname of our user. | |
| virtual void | RenameAccount (const QString &name)=0 |
| Sets the human-readable name of this account to the new name. | |
| virtual QByteArray | GetAccountID () const =0 |
| Returns the ID of this account. | |
| virtual QList< QAction * > | GetActions () const =0 |
| Returns the list of actions for the account item. | |
| virtual void | OpenConfigurationDialog ()=0 |
| Requests the account to open its configuration dialog. | |
| virtual EntryStatus | GetState () const =0 |
| Returns the current status of this account. | |
| virtual void | ChangeState (const EntryStatus &status)=0 |
| Sets the status of this account. | |
| virtual void | Authorize (QObject *entry)=0 |
| Grants authorization to the given entry. | |
| virtual void | DenyAuth (QObject *entry)=0 |
| Denies authorization for the given entry. | |
| virtual void | RequestAuth (const QString &entry, const QString &msg=QString(), const QString &name=QString(), const QStringList &groups=QStringList())=0 |
| Requests authorization from the given entry. | |
| virtual void | RemoveEntry (QObject *entry)=0 |
| Removes the given entry from the contact list. | |
| virtual QObject * | GetTransferManager () const =0 |
| Returns the object responsible for file transfers in this account. | |
| virtual bool | IsShownInRoster () const |
| Whether the account should be shown in the roster. | |
| virtual void | SetShownInRoster (bool shown) |
| Sets whether the account should be shown in the roster. | |
Protected Member Functions | |
| virtual | ~IAccount ()=default |
Protected Attributes | |
| Emitters::Account | Emitter_ |
Interface representing a single account.
This interface represents an account — an entity within IProtocol owning some ICLEntry objects.
The account may also implement IHaveServiceDiscovery if it supports some XMPP's service discovery-like functionality. Look at that documentation for more information.
If the account supports something similar to XML console, it can also implement the IHaveConsole interface.
If the account supports publishing user tune, it may implement ISupportTune.
Definition at line 45 of file iaccount.h.
Represents the features that may be supported by an acoount.
| Enumerator | |
|---|---|
| FRenamable | This account can be renamed, so calls to RenameAccount() would not be senseless. |
| FSupportsXA | This account supports Extended Away statuses. |
| FHasConfigurationDialog | This account has configuration dialog. |
| FCanAddContactsInOffline | This account can add accounts to CL while being offline. |
| FCanViewContactsInfoInOffline | This account supports viewing contacts information while offline. |
| FMUCsSupportFileTransfers | This account supports sending and receiving files to or from MUCs. |
Definition at line 57 of file iaccount.h.
|
protectedvirtualdefault |
|
pure virtual |
Grants authorization to the given entry.
entry is expected to be deleted in this function.
| [in] | entry | Entry object implementing ICLEntry. |
References Authorize().
Referenced by Authorize().
|
pure virtual |
Sets the status of this account.
If the account was offline, it is expected to connect at this point automatically.
| [in] | status | The new status of this account. |
References ChangeState().
Referenced by ChangeState().
|
pure virtual |
Denies authorization for the given entry.
entry is expected to be deleted in this function.
| [in] | entry | Entry object implementing ICLEntry. |
References DenyAuth().
Referenced by DenyAuth().
|
inline |
Definition at line 53 of file iaccount.h.
References Emitter_.
|
pure virtual |
Returns the OR-ed combination of features of this account.
References GetAccountFeatures().
Referenced by GetAccountFeatures().
|
pure virtual |
Returns the ID of this account.
The returned ID should be unique among all accounts and should not depend on the value of GetAccountName() (the human-readable name of the account).
References GetAccountID().
Referenced by GetAccountID().
|
pure virtual |
Returns the human-readable name of this account.
References GetAccountName().
Referenced by GetAccountName().
|
pure virtual |
Returns the list of actions for the account item.
The list is showed, for example, when user calls the context menu on the account item, or such.
References GetActions().
Referenced by GetActions().
Returns the list of contact list entries of this account.
Typically this would be the list of contacts added to the account plus any entries that represent multiuser chatrooms, their participants and such, if applicable.
References GetCLEntries().
Referenced by GetCLEntries().
|
pure virtual |
Returns the nickname of our user.
References GetOurNick().
Referenced by GetOurNick().
|
pure virtual |
Returns the pointer to the parent protocol that this account belongs to.
References GetParentProtocol().
Referenced by GetParentProtocol().
|
pure virtual |
Returns the account object as a QObject.
References GetQObject().
Referenced by GetQObject().
|
pure virtual |
Returns the current status of this account.
References GetState().
Referenced by GetState().
|
pure virtual |
Returns the object responsible for file transfers in this account.
If file transfers aren't supported, NULL should be returned. The returned object, is not NULL, is expected to implement ITransferManager.
References GetTransferManager().
Referenced by GetTransferManager().
|
inlinevirtual |
Whether the account should be shown in the roster.
The default implementation simply returns the value of a the return variable set by SetShownInRoster().
By default, accounts should be shown in the roster.
Definition at line 265 of file iaccount.h.
References IsShownInRoster().
Referenced by IsShownInRoster().
|
pure virtual |
Requests the account to open its configuration dialog.
References OpenConfigurationDialog().
Referenced by OpenConfigurationDialog().
|
pure virtual |
Removes the given entry from the contact list.
Removes the entry from the contact list and automatically synchronizes the changes in the contact list, if applicable.
If the entry could not be removed at the moment, or if the parameter is invalid, this function should do nothing.
| [in] | entry | The entry to remove. |
References RemoveEntry().
Referenced by RemoveEntry().
|
pure virtual |
Sets the human-readable name of this account to the new name.
| [in] | name | The new name of the account. |
References RenameAccount().
Referenced by RenameAccount().
|
pure virtual |
Requests authorization from the given entry.
entry is a human-readable identifier of the remote, as returned by ICLEntry::GetHumanReadableID().
If applicable and msg is a non-empty string, the msg should be sent to the entry as the message sent along with the request.
name should be the name under which the entry is added to the contact list, if applicable. If name is an empty string, a sane default should be used, like the human-readable ID — entry.
groups is the list of groups that this entry is added to. If groups is an emptry list, the behavior should be defined by the plugin - the entry should either be added to some kind of default group or have no assigned groups at all. If protocol supports only one group per entry, the first one in the list should be used.
| [in] | entry | Human-readable ID of the remote. |
| [in] | msg | Optional request string to display to remote, if applicable. |
| [in] | name | The name under which the entry should be added to the contact list. May be blank. |
| [in] | groups | The groups to add the entry to, if applicable. May be blank. |
References RequestAuth().
Referenced by RequestAuth().
|
inlinevirtual |
Sets whether the account should be shown in the roster.
The default implementation simply sets the corresponding private variable that is returned from IsShownInRoster().
Calling this function does not have to result in any kind of account saving, signal emission and so on. This function (and its IsShownInRoster() counterpart) are provided solely for Azoth core convenience.
After calling this function the IsShownInRoster() method should return the last value of shown.
| [in] | shown | Whether the account should be shown in the roster. |
Definition at line 288 of file iaccount.h.
|
protected |
Definition at line 49 of file iaccount.h.
Referenced by GetAccountEmitter().