|
Albert
|
#include <albert/pluginloader.h>
Asynchronous plugin loader turning a physical plugin into a logical plugin instance.
Inherits QObject.
Public Member Functions | |
| virtual QString | path () const =0 |
| Returns the path to the plugin. | |
| virtual const PluginMetadata & | metadata () const =0 |
| Returns the plugin metadata. | |
| virtual void | load ()=0 |
| Starts loading the plugin. | |
| virtual void | unload ()=0 |
| Unloads the plugin. | |
| virtual albert::PluginInstance * | instance ()=0 |
Returns the PluginInstance if the plugin is loaded, else nullptr. | |
Static Public Attributes | |
| static thread_local PluginLoader * | current_loader |
| Used to set the plugin loader while plugin instatiation. | |
Protected Member Functions | |
| virtual | ~PluginLoader () |
Signals | |
| void | finished (QString info) |
| Emitted when the loading process finished. | |
|
protectedvirtual |
|
signal |
Emitted when the loading process finished.
On success instance() returns a valid PluginInstance. info contains additional information about the finished loading proc instance() returns a nullptr, i.e. the plugin failed to load, info is interpreted as error message.
|
pure virtual |
Returns the PluginInstance if the plugin is loaded, else nullptr.
|
pure virtual |
Starts loading the plugin.
|
pure virtual |
Returns the plugin metadata.
|
pure virtual |
Returns the path to the plugin.
|
pure virtual |
Unloads the plugin.
|
static |
Used to set the plugin loader while plugin instatiation.
This avoids injection mechanisms and therefore reduces boilerplate for PluginInstance implementations. Implementations have to set this before calling the constructor of the plugin instance.