LeechCraft Azoth 0.6.70-14794-g33744ae6ce
Modular multiprotocol IM plugin for LeechCraft
Loading...
Searching...
No Matches
iprotocol.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#pragma once
10
11#include <QFlags>
12#include <QMetaType>
13
14class QObject;
15class QIcon;
16
17namespace LC
18{
19namespace Azoth
20{
21 class IAccount;
22 class IProtocolPlugin;
23
42 {
43 public:
44 virtual ~IProtocol () {}
45
50 {
53 PFNone = 0x0,
54
58
65
72
79 };
80
81 Q_DECLARE_FLAGS (ProtocolFeatures, ProtocolFeature)
82
83
87 {
91
97 };
98
99 Q_DECLARE_FLAGS (AccountAddOptions, AccountAddOption)
100
101
105 virtual QObject* GetQObject () = 0;
106
109 virtual ProtocolFeatures GetFeatures () const = 0;
110
117 virtual QList<QObject*> GetRegisteredAccounts () = 0;
118
125 virtual QObject* GetParentProtocolPlugin () const = 0;
126
132 virtual QString GetProtocolName () const = 0;
133
138 virtual QIcon GetProtocolIcon () const = 0;
139
145 virtual QByteArray GetProtocolID () const = 0;
146
166 virtual QList<QWidget*> GetAccountRegistrationWidgets (AccountAddOptions options) = 0;
167
192 virtual void RegisterAccount (const QString& name, const QList<QWidget*>& widgets) = 0;
193
207 virtual void RemoveAccount (QObject *account) = 0;
208
219 virtual void accountAdded (QObject *account) = 0;
220
232 virtual void accountRemoved (QObject *account) = 0;
233 };
234}
235}
236
237Q_DECLARE_METATYPE (LC::Azoth::IProtocol*)
238Q_DECLARE_OPERATORS_FOR_FLAGS (LC::Azoth::IProtocol::ProtocolFeatures)
239Q_DECLARE_INTERFACE (LC::Azoth::IProtocol,
240 "org.Deviant.LeechCraft.Azoth.IProtocol/1.0")
Represents a protocol.
Definition: iprotocol.h:42
virtual QList< QWidget * > GetAccountRegistrationWidgets(AccountAddOptions options)=0
Returns the widgets used for account addition.
virtual QIcon GetProtocolIcon() const =0
Returns the icon of this protocol.
virtual void RemoveAccount(QObject *account)=0
Removes the given account.
virtual void RegisterAccount(const QString &name, const QList< QWidget * > &widgets)=0
Adds an account with the given name and widgets.
virtual void accountRemoved(QObject *account)=0
Notifies about an account having been removed.
virtual QByteArray GetProtocolID() const =0
Returns the protocol ID, which must be unique among all the protocols.
virtual QString GetProtocolName() const =0
Returns the human-readable name of this protocol, like "Jabber" or "ICQ".
virtual ~IProtocol()
Definition: iprotocol.h:44
virtual QObject * GetQObject()=0
Returns the protocol object as a QObject.
virtual void accountAdded(QObject *account)=0
Notifies about new account.
virtual QObject * GetParentProtocolPlugin() const =0
Returns the pointer to the parent protocol plugin that this protocol belongs to.
virtual QList< QObject * > GetRegisteredAccounts()=0
Returns the accounts within this protocol.
virtual ProtocolFeatures GetFeatures() const =0