13 #include <QStringList> 77 virtual void SecondInit () = 0;
93 virtual QByteArray GetUniqueID ()
const = 0;
107 virtual QString GetName ()
const = 0;
120 virtual QString GetInfo ()
const = 0;
141 return QStringList ();
169 return QStringList ();
194 virtual QStringList
Uses ()
const 196 return QStringList ();
216 const QString& feature)
232 virtual void Release () = 0;
246 virtual QIcon GetIcon ()
const = 0;
255 virtual void SetPluginInstance (QObject*) = 0;
258 Q_DECLARE_INTERFACE (
IInfo,
"org.Deviant.LeechCraft.IInfo/1.0")
260 #define CURRENT_API_LEVEL 21 262 #define LC_EXPORT_PLUGIN(file,klass) \ 263 ICoreProxy_ptr klass::S_Proxy_; \ 264 QObject* klass::S_Plugin_; \ 265 const ICoreProxy_ptr& GetProxyHolder () { return klass::S_Proxy_; } \ 266 QObject* GetPluginInstance () { return klass::S_Plugin_; } \ 270 Q_DECL_EXPORT quint64 GetAPILevels () { return CURRENT_API_LEVEL; } \ 278 #define LC_PUSH_OVERRIDE_WARNING \ 279 _Pragma("clang diagnostic push") \ 280 _Pragma("clang diagnostic ignored \"-Winconsistent-missing-override\"") 281 #define LC_POP_OVERRIDE_WARNING \ 282 _Pragma("clang diagnostic pop") 284 #define LC_PUSH_OVERRIDE_WARNING 285 #define LC_POP_OVERRIDE_WARNING 288 #define DEFINE_PROXY \ 289 static ICoreProxy_ptr S_Proxy_; \ 290 static QObject *S_Plugin_; \ 291 LC_PUSH_OVERRIDE_WARNING \ 292 void SetProxy (ICoreProxy_ptr proxy) { S_Proxy_ = std::move (proxy); } \ 293 const ICoreProxy_ptr& GetProxy () { return S_Proxy_; } \ 294 void SetPluginInstance (QObject *instance) { S_Plugin_ = instance; } \ 295 LC_POP_OVERRIDE_WARNING \ 296 friend const ICoreProxy_ptr& ::GetProxyHolder (); \ 297 friend QObject* ::GetPluginInstance (); 299 #define LC_PLUGIN_METADATA(id) \ 300 Q_PLUGIN_METADATA (IID id) \ Proxy class for the communication with LeechCraft.
QObject * GetPluginInstance()
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
virtual QStringList Provides() const
Returns the list of provided features.
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
const ICoreProxy_ptr & GetProxyHolder()
virtual QStringList Uses() const
Returns the list of used features.
virtual ~IInfo()
Virtual destructor.
Required interface for every plugin.
virtual void SetProvider(QObject *object, const QString &feature)
Sets the provider plugin for a given feature.
virtual QStringList Needs() const
Returns the list of needed features.