![]() |
LeechCraft Azoth
0.6.70-15082-g543737046d
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 | |
virtual | ~IAccount () |
virtual QObject * | GetQObject ()=0 |
Returns the account object as a QObject. More... | |
virtual QObject * | GetParentProtocol () const =0 |
Returns the pointer to the parent protocol that this account belongs to. More... | |
virtual AccountFeatures | GetAccountFeatures () const =0 |
Returns the OR-ed combination of features of this account. More... | |
virtual QList< QObject * > | GetCLEntries ()=0 |
Returns the list of contact list entries of this account. More... | |
virtual QString | GetAccountName () const =0 |
Returns the human-readable name of this account. More... | |
virtual QString | GetOurNick () const =0 |
Returns the nickname of our user. More... | |
virtual void | RenameAccount (const QString &name)=0 |
Sets the human-readable name of this account to the new name. More... | |
virtual QByteArray | GetAccountID () const =0 |
Returns the ID of this account. More... | |
virtual QList< QAction * > | GetActions () const =0 |
Returns the list of actions for the account item. More... | |
virtual void | OpenConfigurationDialog ()=0 |
Requests the account to open its configuration dialog. More... | |
virtual EntryStatus | GetState () const =0 |
Returns the current status of this account. More... | |
virtual void | ChangeState (const EntryStatus &status)=0 |
Sets the status of this account. More... | |
virtual void | Authorize (QObject *entry)=0 |
Grants authorization to the given entry. More... | |
virtual void | DenyAuth (QObject *entry)=0 |
Denies authorization for the given entry. More... | |
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. More... | |
virtual void | RemoveEntry (QObject *entry)=0 |
Removes the given entry from the contact list. More... | |
virtual QObject * | GetTransferManager () const =0 |
Returns the object responsible for file transfers in this account. More... | |
virtual bool | IsShownInRoster () const |
Whether the account should be shown in the roster. More... | |
virtual void | SetShownInRoster (bool shown) |
Sets whether the account should be shown in the roster. More... | |
virtual void | accountRenamed (const QString &newName)=0 |
This signal should be emitted when account is renamed. More... | |
virtual void | gotCLItems (const QList< QObject * > &items)=0 |
This signal should be emitted when new contact list items appear in this account. More... | |
virtual void | removedCLItems (const QList< QObject * > &items)=0 |
This signal should be emitted after any contact list items are removed. More... | |
virtual void | authorizationRequested (QObject *entry, const QString &message)=0 |
This signal should be emitted when another user requests authorization from this account. More... | |
virtual void | itemSubscribed (QObject *entry, const QString &message)=0 |
This signal should be emitted when an already added entry has just subscribed to us. More... | |
virtual void | itemUnsubscribed (QObject *entry, const QString &message)=0 |
This signal should be emitted when an already added entry has just unsubscribed from us. More... | |
virtual void | itemUnsubscribed (const QString &entryID, const QString &message)=0 |
This signal should be emitted when a non-roster item has just unsubscribed from us. More... | |
virtual void | itemCancelledSubscription (QObject *entry, const QString &message)=0 |
This signal should be emitted when a roster item cancels (or denies) our subscription. More... | |
virtual void | itemGrantedSubscription (QObject *entry, const QString &message)=0 |
This signal should be emitted when a roster item grants us subscription. More... | |
virtual void | statusChanged (const EntryStatus &status)=0 |
This signal should be emitted when status of this account changes for whatever reason. More... | |
virtual void | mucInvitationReceived (const QVariantMap &ident, const QString &inviter, const QString &reason)=0 |
This signal should be emitted whenever a MUC invitation has been received. More... | |
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 56 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 64 of file iaccount.h.
|
inlinevirtual |
Definition at line 60 of file iaccount.h.
|
pure virtual |
This signal should be emitted when account is renamed.
This signal should be emitted even after an explicit call to RenameAccount().
[out] | newName | The new name of this account. |
|
pure virtual |
This signal should be emitted when another user requests authorization from this account.
When a remote user requests authorization (or subscription in terms of XMPP, for example) from this account, this signal should be emitted. The entry is expected to represent the remote that requested the authorization and it must implement ICLEntry.
[out] | entry | The object representing the requesting entry, must be an ICLEntry. |
[out] | message | Optional request message, if applicable. |
|
pure virtual |
Grants authorization to the given entry.
entry is expected to be deleted in this function.
[in] | entry | Entry object implementing ICLEntry. |
|
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. |
|
pure virtual |
Denies authorization for the given entry.
entry is expected to be deleted in this function.
[in] | entry | Entry object implementing ICLEntry. |
|
pure virtual |
Returns the OR-ed combination of features of this account.
|
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).
|
pure virtual |
Returns the human-readable name of this account.
|
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.
|
pure virtual |
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.
|
pure virtual |
Returns the nickname of our user.
|
pure virtual |
Returns the pointer to the parent protocol that this account belongs to.
|
pure virtual |
Returns the account object as a QObject.
|
pure virtual |
Returns the current status of this account.
|
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.
|
pure virtual |
This signal should be emitted when new contact list items appear in this account.
[out] | items | The list of newly appeared items. |
|
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 272 of file iaccount.h.
|
pure virtual |
This signal should be emitted when a roster item cancels (or denies) our subscription.
[out] | entry | The object representing the entry that granted the subscription, must be an ICLEntry. |
[out] | message | Optional reason message. |
|
pure virtual |
This signal should be emitted when a roster item grants us subscription.
[out] | entry | The object representing the entry that granted the subscription, must be an ICLEntry. |
[out] | message | Optional reason message. |
|
pure virtual |
This signal should be emitted when an already added entry has just subscribed to us.
If the item didn't previously exist, the proper gotCLItems() signal should be emitted before this one, of course.
[out] | entry | The object representing the just subscribed entry in the contact list, must be an ICLEntry. |
[out] | message | An optional reason message. |
|
pure virtual |
This signal should be emitted when a non-roster item has just unsubscribed from us.
[out] | entryID | The ID of just unsubscribed entry. |
[out] | message | An optional reason message. |
|
pure virtual |
This signal should be emitted when an already added entry has just unsubscribed from us.
If the item didn't exist in the roster, another overload of itemUnsubscribed() should be used, which takes the entry's ID as first parameter.
[out] | entry | The object representing the unsubscribed entry in the contact list, must be an ICLEntry. |
[out] | message | An optional reason message. |
|
pure virtual |
This signal should be emitted whenever a MUC invitation has been received.
The ident parameter contains the map with the identifying data suitable for the IMUCJoinWidget of this account. Refer to IMUCJoinWidget documentation for more information.
[out] | ident | MUC identifying data for IMUCJoinWidget. |
[out] | inviter | The inviter's source ID or nickname. |
[out] | reason | An optional reason string. |
|
pure virtual |
Requests the account to open its configuration dialog.
|
pure virtual |
This signal should be emitted after any contact list items are removed.
The reason for removal doesn't matter. It could be a groupchat participant that exited or changed nickname, or some other stuff.
[out] | items | The list of removed items. |
|
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. |
|
pure virtual |
Sets the human-readable name of this account to the new name.
[in] | name | The new name of the account. |
|
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. |
|
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 295 of file iaccount.h.
|
pure virtual |
This signal should be emitted when status of this account changes for whatever reason.
[out] | status | New status of this account. |