![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
This interface is used to represent LeechCraft's global plugin manager. More...
#include "ipluginsmanager.h"
Public Member Functions | |
virtual | ~IPluginsManager () |
virtual QObjectList | GetAllPlugins () const =0 |
Returns list of pointers to all present plugins. More... | |
template<typename T > | |
QObjectList | Filter (const QObjectList &source) const |
Filters the given list of plugins and returns only those that can be casted to the given template type. More... | |
template<typename T > | |
QObjectList | GetAllCastableRoots () const |
This is the same as Filter<T> (GetAllPlugins()). More... | |
template<typename T > | |
QList< T > | GetAllCastableTo () const |
Similar to GetAlLCastableRoots() and provided for convenience. More... | |
virtual QObject * | GetPluginByID (const QByteArray &id) const =0 |
Returns plugin identified by its id. More... | |
virtual QString | GetPluginLibraryPath (const QObject *object) const =0 |
Returns the library path from which plugin instance object has been loaded. More... | |
virtual void | InjectPlugin (QObject *object)=0 |
Injects the given plugin object. More... | |
virtual void | ReleasePlugin (QObject *object)=0 |
Releases and removes the given plugin object. More... | |
virtual QObject * | GetQObject ()=0 |
Returns the pointer to plugin manager as a QObject. More... | |
virtual void | OpenSettings (QObject *plugin)=0 |
Opens the settings page for the given plugin object. More... | |
virtual ILoadProgressReporter_ptr | CreateLoadProgressReporter (QObject *thisPlugin)=0 |
Creates an object for reporting progress of a long-running load-time operation. More... | |
virtual QIcon | GetPluginIcon (QObject *)=0 |
This interface is used to represent LeechCraft's global plugin manager.
Through is interface you can get information about currently installed and running plugins, communicate with them at low-level (for example, by getting a pointer to the corresponding QObject* and casting it to any interface you want). It is also possible to inject new plugins into LeechCraft via this interface and try to release already running ones.
This object also has the following signals:
Definition at line 34 of file ipluginsmanager.h.
|
inlinevirtual |
Definition at line 37 of file ipluginsmanager.h.
|
pure virtual |
Creates an object for reporting progress of a long-running load-time operation.
This method should be called by any plugin doing some long-running operation during LeechCraft load (like a DB migration) because of usability reasons.
[in] | thisPlugin | The pointer to the instance object of the plugin that runs the long-running operation (typically the plugin where the code invoking this function belongs). |
|
inline |
Filters the given list of plugins and returns only those that can be casted to the given template type.
Please note that you will almost always call it as Filter<T*> — note that you check against the pointer type.
[in] | source | The list of plugins to filter. |
Definition at line 55 of file ipluginsmanager.h.
|
inline |
This is the same as Filter<T> (GetAllPlugins()).
This function takes all available plugins from GetAllPlugins() and returns only those that can be casted to T via passing the result of GetAllPlugins() to Filter<T>().
Definition at line 74 of file ipluginsmanager.h.
|
inline |
Similar to GetAlLCastableRoots() and provided for convenience.
This function is almost the same as GetAllCastableRoots(), except it returns the list of pointers to the corresponding interface. Generally, it takes the result of GetAllCastableRoots() and converts each pointer from the list returned by GetAllCastableRoots() to the requested interface.
Definition at line 91 of file ipluginsmanager.h.
|
pure virtual |
Returns list of pointers to all present plugins.
|
pure virtual |
Returns plugin identified by its id.
If there is no such plugin with the given id, this function returns a null pointer.
[in] | id | The ID of the plugin. |
|
pure virtual |
|
pure virtual |
Returns the library path from which plugin instance object has been loaded.
If the path could not be determined for some reason (for example, if the plugin was injected or provided by a plugin adaptor, or if the given object is not a plugin instance) this function returns an empty string.
Please note that you cannot get library path for an arbitrary object. Only objects that are plugin instances ("root" objects in a plugin) are supported.
[in] | object | The object for which to get the library path. |
|
pure virtual |
Returns the pointer to plugin manager as a QObject.
You can connect to signals of the plugin manager with the use of this function, for example.
|
pure virtual |
Injects the given plugin object.
The object's semantics are the same as the semantics of the "root" plugin object (returned by QPluginLoader::instance()). Thus, object should be castable at least to IInfo interface in order to be successfully loaded.
[in] | object | The pointer to the "root" plugin object. |
|
pure virtual |
Opens the settings page for the given plugin object.
If the plugin doesn't implement IHaveSettings, this function does nothing.
[in] | plugin | The plugin for which to open the settings page. |
|
pure virtual |
Releases and removes the given plugin object.
This function tries to release and remove the given object plugin from LeechCraft. Because of that, object has to be injected earlier with InjectPlugin().
Usage of this function is discouraged as it may lead to instabilities, because other plugins may have established connections and kept pointers to the object.
[in] | object | The object previously injected with InjectPlugin(). |