LeechCraft Azoth  %{LEECHCRAFT_VERSION}
Modular multiprotocol IM plugin for LeechCraft
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
iaccount.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2013 Georg Rudoy
4  *
5  * Boost Software License - Version 1.0 - August 17th, 2003
6  *
7  * Permission is hereby granted, free of charge, to any person or organization
8  * obtaining a copy of the software and accompanying documentation covered by
9  * this license (the "Software") to use, reproduce, display, distribute,
10  * execute, and transmit the Software, and to prepare derivative works of the
11  * Software, and to permit third-parties to whom the Software is furnished to
12  * do so, all subject to the following:
13  *
14  * The copyright notices in the Software and this entire statement, including
15  * the above license grant, this restriction and the following disclaimer,
16  * must be included in all copies of the Software, in whole or in part, and
17  * all derivative works of the Software, unless such copies or derivative
18  * works are solely in the form of machine-executable object code generated by
19  * a source language processor.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  **********************************************************************/
29 
30 #ifndef PLUGINS_AZOTH_INTERFACES_IACCOUNT_H
31 #define PLUGINS_AZOTH_INTERFACES_IACCOUNT_H
32 #include <QFlags>
33 #include <QMetaType>
34 #include <QVariant>
35 #include <QStringList>
37 #include "iclentry.h"
38 
39 namespace LeechCraft
40 {
41 namespace Azoth
42 {
43  class IProtocol;
44  class ICLEntry;
45 
65  class IAccount
66  {
67  bool IsShown_;
68  public:
70  : IsShown_ (true)
71  {
72  }
73 
74  virtual ~IAccount () {}
75 
79  {
83  FRenamable = 0x01,
84 
87  FSupportsXA = 0x02,
88 
92 
96 
101 
106  };
107 
108  Q_DECLARE_FLAGS (AccountFeatures, AccountFeature)
109 
110 
114  virtual QObject* GetQObject () = 0;
115 
121  virtual QObject* GetParentProtocol () const = 0;
122 
128  virtual AccountFeatures GetAccountFeatures () const = 0;
129 
139  virtual QList<QObject*> GetCLEntries () = 0;
140 
147  virtual QString GetAccountName () const = 0;
148 
153  virtual QString GetOurNick () const = 0;
154 
162  virtual void RenameAccount (const QString& name) = 0;
163 
172  virtual QByteArray GetAccountID () const = 0;
173 
181  virtual QList<QAction*> GetActions () const = 0;
182 
190  virtual void QueryInfo (const QString& address) = 0;
191 
194  virtual void OpenConfigurationDialog () = 0;
195 
200  virtual EntryStatus GetState () const = 0;
201 
209  virtual void ChangeState (const EntryStatus& status) = 0;
210 
217  virtual void Authorize (QObject *entry) = 0;
218 
225  virtual void DenyAuth (QObject *entry) = 0;
226 
252  virtual void RequestAuth (const QString& entry,
253  const QString& msg = QString (),
254  const QString& name = QString (),
255  const QStringList& groups = QStringList ()) = 0;
256 
267  virtual void RemoveEntry (QObject *entry) = 0;
268 
278  virtual QObject* GetTransferManager () const = 0;
279 
280  virtual bool IsShownInRoster () const
281  {
282  return IsShown_;
283  }
284 
285  virtual void SetShownInRoster (bool shown)
286  {
287  IsShown_ = shown;
288  }
289 
299  virtual void accountRenamed (const QString& newName) = 0;
300 
308  virtual void gotCLItems (const QList<QObject*>& items) = 0;
309 
321  virtual void removedCLItems (const QList<QObject*>& items) = 0;
322 
342  virtual void authorizationRequested (QObject *entry,
343  const QString& message) = 0;
344 
361  virtual void itemSubscribed (QObject *entry, const QString& message) = 0;
362 
380  virtual void itemUnsubscribed (QObject *entry, const QString& message) = 0;
381 
394  virtual void itemUnsubscribed (const QString& entryID, const QString& message) = 0;
395 
408  virtual void itemCancelledSubscription (QObject *entry, const QString& message) = 0;
409 
422  virtual void itemGrantedSubscription (QObject *entry, const QString& message) = 0;
423 
431  virtual void statusChanged (const EntryStatus&) = 0;
432 
444  virtual void mucInvitationReceived (const QVariantMap& ident,
445  const QString& inviter, const QString& reason) = 0;
446  };
447 
448  Q_DECLARE_OPERATORS_FOR_FLAGS (IAccount::AccountFeatures);
449 }
450 }
451 
454  "org.Deviant.LeechCraft.Azoth.IAccount/1.0");
455 
456 #endif
virtual void gotCLItems(const QList< QObject * > &items)=0
This signal should be emitted when new contact list items appear in this account. ...
virtual QString GetOurNick() const =0
Returns the nickname of our user.
virtual void itemSubscribed(QObject *entry, const QString &message)=0
This signal should be emitted when an already added entry has just subscribed to us.
virtual void DenyAuth(QObject *entry)=0
Denies authorization for the given entry.
virtual void itemGrantedSubscription(QObject *entry, const QString &message)=0
This signal should be emitted when a roster item grants us subscription.
Q_DECLARE_METATYPE(LeechCraft::Azoth::State)
virtual QObject * GetTransferManager() const =0
Returns the object responsible for file transfers in this account.
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.
Q_DECLARE_INTERFACE(LeechCraft::Azoth::IAccount,"org.Deviant.LeechCraft.Azoth.IAccount/1.0")
virtual QString GetAccountName() const =0
Returns the human-readable name of this account.
virtual void SetShownInRoster(bool shown)
Definition: iaccount.h:285
virtual QObject * GetQObject()=0
Returns the account object as a QObject.
virtual void QueryInfo(const QString &address)=0
Request message w/ info/vcard information for the given address.
virtual QList< QObject * > GetCLEntries()=0
Returns the list of contact list entries of this account.
virtual AccountFeatures GetAccountFeatures() const =0
Returns the OR-ed combination of features of this account.
Definition: iclentry.h:47
virtual QList< QAction * > GetActions() const =0
Returns the list of actions for the account item.
Q_DECLARE_OPERATORS_FOR_FLAGS(IAccount::AccountFeatures)
virtual void accountRenamed(const QString &newName)=0
This signal should be emitted when account is renamed.
virtual void RenameAccount(const QString &name)=0
Sets the human-readable name of this account to the new name.
virtual bool IsShownInRoster() const
Definition: iaccount.h:280
virtual void itemCancelledSubscription(QObject *entry, const QString &message)=0
This signal should be emitted when a roster item cancels (or denies) our subscription.
virtual void RemoveEntry(QObject *entry)=0
Removes the given entry from the contact list.
virtual void OpenConfigurationDialog()=0
Requests the account to open its configuration dialog.
Interface representing a single account.
Definition: iaccount.h:65
virtual EntryStatus GetState() const =0
Returns the current status of this account.
virtual void authorizationRequested(QObject *entry, const QString &message)=0
This signal should be emitted when another user requests authorization from this account.
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 QObject * GetParentProtocol() const =0
Returns the pointer to the parent protocol that this account belongs to.
virtual void removedCLItems(const QList< QObject * > &items)=0
This signal should be emitted after any contact list items are removed.
virtual void statusChanged(const EntryStatus &)=0
This signal should be emitted when state of this account changes for whatever reason.
virtual void itemUnsubscribed(QObject *entry, const QString &message)=0
This signal should be emitted when an already added entry has just unsubscribed from us...
virtual QByteArray GetAccountID() const =0
Returns the ID 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.