LeechCraft
0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
iinfo.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 <memory>
12
#include <QString>
13
#include <QStringList>
14
#include <QtPlugin>
15
#include "
structures.h
"
16
17
class
ICoreProxy
;
18
typedef
std::shared_ptr<ICoreProxy>
ICoreProxy_ptr
;
19
47
class
Q_DECL_EXPORT
IInfo
48
{
49
public
:
74
virtual
void
Init
(
ICoreProxy_ptr
proxy) = 0;
75
91
virtual
void
SecondInit
() = 0;
92
107
virtual
QByteArray
GetUniqueID
()
const
= 0;
108
121
virtual
QString
GetName
()
const
= 0;
122
134
virtual
QString
GetInfo
()
const
= 0;
135
153
virtual
QStringList
Provides
()
const
154
{
155
return
QStringList ();
156
}
157
181
virtual
QStringList
Needs
()
const
182
{
183
return
QStringList ();
184
}
185
208
virtual
QStringList
Uses
()
const
209
{
210
return
QStringList ();
211
}
212
229
virtual
void
SetProvider
(QObject*
object
,
230
const
QString& feature)
231
{
232
Q_UNUSED (
object
);
233
Q_UNUSED (feature);
234
}
235
246
virtual
void
Release
() = 0;
247
260
virtual
QIcon
GetIcon
()
const
= 0;
261
264
virtual
~IInfo
() {}
265
266
// implementation details
267
virtual
void
SetProxy
(
ICoreProxy_ptr
) = 0;
268
virtual
const
ICoreProxy_ptr
&
GetProxy
() = 0;
269
virtual
void
SetPluginInstance
(QObject*) = 0;
270
};
271
272
Q_DECLARE_INTERFACE (
IInfo
,
"org.Deviant.LeechCraft.IInfo/1.0"
)
273
274
#define CURRENT_API_LEVEL 21
275
276
#define LC_EXPORT_PLUGIN(file,klass) \
277
ICoreProxy_ptr klass::S_Proxy_; \
278
QObject* klass::S_Plugin_; \
279
const ICoreProxy_ptr& GetProxyHolder () { return klass::S_Proxy_; } \
280
QObject* GetPluginInstance () { return klass::S_Plugin_; } \
281
\
282
extern "C"\
283
{\
284
Q_DECL_EXPORT quint64 GetAPILevels () { return CURRENT_API_LEVEL; } \
285
}
286
287
const
ICoreProxy_ptr
&
GetProxyHolder
();
288
289
QObject*
GetPluginInstance
();
290
291
#ifdef __clang__
292
#define LC_PUSH_OVERRIDE_WARNING \
293
_Pragma("clang diagnostic push") \
294
_Pragma("clang diagnostic ignored \"-Winconsistent-missing-override\"")
295
#define LC_POP_OVERRIDE_WARNING \
296
_Pragma("clang diagnostic pop")
297
#else
298
#define LC_PUSH_OVERRIDE_WARNING
299
#define LC_POP_OVERRIDE_WARNING
300
#endif
301
302
#define DEFINE_PROXY \
303
static ICoreProxy_ptr S_Proxy_; \
304
static QObject *S_Plugin_; \
305
LC_PUSH_OVERRIDE_WARNING \
306
void SetProxy (ICoreProxy_ptr proxy) { S_Proxy_ = std::move (proxy); } \
307
const ICoreProxy_ptr& GetProxy () { return S_Proxy_; } \
308
void SetPluginInstance (QObject *instance) { S_Plugin_ = instance; } \
309
LC_POP_OVERRIDE_WARNING \
310
friend const ICoreProxy_ptr& ::GetProxyHolder (); \
311
friend QObject* ::GetPluginInstance ();
312
313
#define LC_PLUGIN_METADATA(id) \
314
Q_PLUGIN_METADATA (IID id) \
315
DEFINE_PROXY
ICoreProxy
Proxy class for the communication with LeechCraft.
Definition
icoreproxy.h:47
IInfo
Required interface for every plugin.
Definition
iinfo.h:48
IInfo::SetProxy
virtual void SetProxy(ICoreProxy_ptr)=0
IInfo::GetInfo
virtual QString GetInfo() const =0
Returns the information string about the plugin.
IInfo::SetProvider
virtual void SetProvider(QObject *object, const QString &feature)
Sets the provider plugin for a given feature.
Definition
iinfo.h:229
IInfo::SetPluginInstance
virtual void SetPluginInstance(QObject *)=0
IInfo::~IInfo
virtual ~IInfo()
Virtual destructor.
Definition
iinfo.h:264
IInfo::GetIcon
virtual QIcon GetIcon() const =0
Returns the plugin icon.
IInfo::GetUniqueID
virtual QByteArray GetUniqueID() const =0
Returns the unique ID of the plugin.
IInfo::Init
virtual void Init(ICoreProxy_ptr proxy)=0
Initializes the plugin.
IInfo::Needs
virtual QStringList Needs() const
Returns the list of needed features.
Definition
iinfo.h:181
IInfo::GetProxy
virtual const ICoreProxy_ptr & GetProxy()=0
IInfo::GetName
virtual QString GetName() const =0
Returns the name of the plugin.
IInfo::Release
virtual void Release()=0
Destroys the plugin.
IInfo::SecondInit
virtual void SecondInit()=0
Performs second stage of initialization.
IInfo::Provides
virtual QStringList Provides() const
Returns the list of provided features.
Definition
iinfo.h:153
IInfo::Uses
virtual QStringList Uses() const
Returns the list of used features.
Definition
iinfo.h:208
ICoreProxy_ptr
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
Definition
icoreproxy.h:177
GetProxyHolder
const ICoreProxy_ptr & GetProxyHolder()
GetPluginInstance
QObject * GetPluginInstance()
ICoreProxy_ptr
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
Definition
iinfo.h:18
structures.h
src
interfaces
iinfo.h
Generated by
1.18.0