Albert
Loading...
Searching...
No Matches
albert::PluginLoader Class Referenceabstract

#include <albert/pluginloader.h>

Description

Asynchronous plugin loader.

Turns a physical plugin into a logical plugin instance.

Errors are intentionally not logged. Thats the responsibility of the plugin implementation. On errors, implementations are expected to throw a localized message and print english logs using their logging category.

Implementations have to set current_loader before calling the constructor of the plugin instance. This avoids injection mechanisms and therefore reduces boilerplate for PluginInstance implementations.

Implementations have to emit finished(), when the loading process finished. On success instance() returns a valid PluginInstance. info contains additional information. On error instance() returns a nullptr, i.e. the plugin failed to load, info is an error message.

Inherits QObject.

Public Member Functions

virtual QString path () const =0
 Returns the path to the plugin.
 
virtual const PluginMetadatametadata () const =0
 Returns the plugin metadata.
 
virtual void load ()=0
 Starts asynchronous loading process of the plugin.
 
virtual void unload ()=0
 Unloads the plugin.
 
virtual albert::PluginInstanceinstance ()=0
 Returns the PluginInstance if the plugin is loaded, else nullptr.
 

Static Public Attributes

static thread_local PluginLoadercurrent_loader
 The static injection pointer.
 

Signals

void finished (QString info)
 Emitted when the loading process finished.
 

The documentation for this class was generated from the following file: