LeechCraft Azoth  0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
iaccount.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #ifndef PLUGINS_AZOTH_INTERFACES_IACCOUNT_H
10 #define PLUGINS_AZOTH_INTERFACES_IACCOUNT_H
11 #include <QFlags>
12 #include <QMetaType>
13 #include <QVariant>
14 #include <QStringList>
16 #include "iclentry.h"
17 
18 namespace LC
19 {
20 namespace Azoth
21 {
22  class IProtocol;
23  class ICLEntry;
24 
44  class IAccount
45  {
46  bool IsShown_ = true;
47  public:
48  virtual ~IAccount () {}
49 
52  enum AccountFeature
53  {
57  FRenamable = 0x01,
58 
61  FSupportsXA = 0x02,
62 
66 
70 
75 
80  };
81 
82  Q_DECLARE_FLAGS (AccountFeatures, AccountFeature)
83 
84 
88  virtual QObject* GetQObject () = 0;
89 
95  virtual QObject* GetParentProtocol () const = 0;
96 
102  virtual AccountFeatures GetAccountFeatures () const = 0;
103 
113  virtual QList<QObject*> GetCLEntries () = 0;
114 
121  virtual QString GetAccountName () const = 0;
122 
127  virtual QString GetOurNick () const = 0;
128 
136  virtual void RenameAccount (const QString& name) = 0;
137 
146  virtual QByteArray GetAccountID () const = 0;
147 
155  virtual QList<QAction*> GetActions () const = 0;
156 
159  virtual void OpenConfigurationDialog () = 0;
160 
165  virtual EntryStatus GetState () const = 0;
166 
174  virtual void ChangeState (const EntryStatus& status) = 0;
175 
182  virtual void Authorize (QObject *entry) = 0;
183 
190  virtual void DenyAuth (QObject *entry) = 0;
191 
221  virtual void RequestAuth (const QString& entry,
222  const QString& msg = QString (),
223  const QString& name = QString (),
224  const QStringList& groups = QStringList ()) = 0;
225 
236  virtual void RemoveEntry (QObject *entry) = 0;
237 
247  virtual QObject* GetTransferManager () const = 0;
248 
260  virtual bool IsShownInRoster () const
261  {
262  return IsShown_;
263  }
264 
283  virtual void SetShownInRoster (bool shown)
284  {
285  IsShown_ = shown;
286  }
287 
297  virtual void accountRenamed (const QString& newName) = 0;
298 
306  virtual void gotCLItems (const QList<QObject*>& items) = 0;
307 
319  virtual void removedCLItems (const QList<QObject*>& items) = 0;
320 
340  virtual void authorizationRequested (QObject *entry,
341  const QString& message) = 0;
342 
359  virtual void itemSubscribed (QObject *entry, const QString& message) = 0;
360 
378  virtual void itemUnsubscribed (QObject *entry, const QString& message) = 0;
379 
392  virtual void itemUnsubscribed (const QString& entryID, const QString& message) = 0;
393 
406  virtual void itemCancelledSubscription (QObject *entry, const QString& message) = 0;
407 
420  virtual void itemGrantedSubscription (QObject *entry, const QString& message) = 0;
421 
429  virtual void statusChanged (const EntryStatus& status) = 0;
430 
442  virtual void mucInvitationReceived (const QVariantMap& ident,
443  const QString& inviter, const QString& reason) = 0;
444  };
445 }
446 }
447 
448 Q_DECLARE_METATYPE (LC::Azoth::IAccount*)
449 Q_DECLARE_OPERATORS_FOR_FLAGS (LC::Azoth::IAccount::AccountFeatures)
450 Q_DECLARE_INTERFACE (LC::Azoth::IAccount,
451  "org.Deviant.LeechCraft.Azoth.IAccount/1.0")
452 
453 #endif
LC::Azoth::IAccount::GetQObject
virtual QObject * GetQObject()=0
Returns the account object as a QObject.
LC::Azoth::IAccount::GetAccountFeatures
virtual AccountFeatures GetAccountFeatures() const =0
Returns the OR-ed combination of features of this account.
LC::Azoth::IAccount::FMUCsSupportFileTransfers
@ FMUCsSupportFileTransfers
Definition: iaccount.h:91
LC::Azoth::IAccount::IsShownInRoster
virtual bool IsShownInRoster() const
Whether the account should be shown in the roster.
Definition: iaccount.h:272
LC::Azoth::IAccount::GetCLEntries
virtual QList< QObject * > GetCLEntries()=0
Returns the list of contact list entries of this account.
LC::Azoth::IAccount::GetTransferManager
virtual QObject * GetTransferManager() const =0
Returns the object responsible for file transfers in this account.
QList
Definition: iaccountactionsprovider.h:16
LC::Azoth::IAccount::SetShownInRoster
virtual void SetShownInRoster(bool shown)
Sets whether the account should be shown in the roster.
Definition: iaccount.h:295
LC::Azoth::IAccount::accountRenamed
virtual void accountRenamed(const QString &newName)=0
This signal should be emitted when account is renamed.
LC::Azoth::IAccount::itemUnsubscribed
virtual void itemUnsubscribed(QObject *entry, const QString &message)=0
This signal should be emitted when an already added entry has just unsubscribed from us.
LC::Azoth::IAccount::authorizationRequested
virtual void authorizationRequested(QObject *entry, const QString &message)=0
This signal should be emitted when another user requests authorization from this account.
LC::Azoth::IAccount::statusChanged
virtual void statusChanged(const EntryStatus &status)=0
This signal should be emitted when status of this account changes for whatever reason.
LC::Azoth::IAccount::~IAccount
virtual ~IAccount()
Definition: iaccount.h:60
LC::Azoth::IAccount::itemCancelledSubscription
virtual void itemCancelledSubscription(QObject *entry, const QString &message)=0
This signal should be emitted when a roster item cancels (or denies) our subscription.
LC::Azoth::IAccount::mucInvitationReceived
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.
LC::Azoth::IAccount::RequestAuth
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.
LC::Azoth::IAccount::RemoveEntry
virtual void RemoveEntry(QObject *entry)=0
Removes the given entry from the contact list.
LC::Azoth::IAccount::AccountFeature
AccountFeature
Definition: iaccount.h:64
LC::Azoth::IAccount::GetOurNick
virtual QString GetOurNick() const =0
Returns the nickname of our user.
LC::Azoth::IAccount::DenyAuth
virtual void DenyAuth(QObject *entry)=0
Denies authorization for the given entry.
LC::Azoth::IAccount::GetParentProtocol
virtual QObject * GetParentProtocol() const =0
Returns the pointer to the parent protocol that this account belongs to.
LC::Azoth::IAccount::itemSubscribed
virtual void itemSubscribed(QObject *entry, const QString &message)=0
This signal should be emitted when an already added entry has just subscribed to us.
LC::Azoth::IAccount::GetActions
virtual QList< QAction * > GetActions() const =0
Returns the list of actions for the account item.
LC::Azoth::IAccount::GetAccountName
virtual QString GetAccountName() const =0
Returns the human-readable name of this account.
LC::Azoth::IAccount::FCanViewContactsInfoInOffline
@ FCanViewContactsInfoInOffline
Definition: iaccount.h:86
LC::Azoth::IAccount::FRenamable
@ FRenamable
Definition: iaccount.h:69
LC::Azoth::IAccount::OpenConfigurationDialog
virtual void OpenConfigurationDialog()=0
Requests the account to open its configuration dialog.
LC
Definition: activityinfo.h:13
LC::Azoth::IAccount::gotCLItems
virtual void gotCLItems(const QList< QObject * > &items)=0
This signal should be emitted when new contact list items appear in this account.
LC::Azoth::IAccount::RenameAccount
virtual void RenameAccount(const QString &name)=0
Sets the human-readable name of this account to the new name.
LC::Azoth::IAccount::itemGrantedSubscription
virtual void itemGrantedSubscription(QObject *entry, const QString &message)=0
This signal should be emitted when a roster item grants us subscription.
LC::Azoth::IAccount::FHasConfigurationDialog
@ FHasConfigurationDialog
Definition: iaccount.h:77
azothcommon.h
LC::Azoth::IAccount::FCanAddContactsInOffline
@ FCanAddContactsInOffline
Definition: iaccount.h:81
LC::Azoth::IAccount::Authorize
virtual void Authorize(QObject *entry)=0
Grants authorization to the given entry.
iclentry.h
LC::Azoth::IAccount::GetAccountID
virtual QByteArray GetAccountID() const =0
Returns the ID of this account.
LC::Azoth::IAccount::ChangeState
virtual void ChangeState(const EntryStatus &status)=0
Sets the status of this account.
LC::Azoth::IAccount::FSupportsXA
@ FSupportsXA
Definition: iaccount.h:73
LC::Azoth::IAccount::GetState
virtual EntryStatus GetState() const =0
Returns the current status of this account.
LC::Azoth::IAccount
Interface representing a single account.
Definition: iaccount.h:56
LC::Azoth::EntryStatus
Describes an entry's status.
Definition: iclentry.h:34
LC::Azoth::IAccount::removedCLItems
virtual void removedCLItems(const QList< QObject * > &items)=0
This signal should be emitted after any contact list items are removed.