|
Albert
|
#include <albert/plugininstance.h>
Abstract plugin instance class.
The class every plugin has to inherit.
If the plugin instantiation fails you are supposed to print errors in english to the logs and throw a localized message that will be shown to the user.
Public Member Functions | |
| virtual void | initialize () |
| Triggers the asynchronous initialization. | |
| virtual QWidget * | buildConfigWidget () |
| Creates a widget that can be used to configure the plugin properties. | |
| virtual std::vector< albert::Extension * > | extensions () |
| Returns the extensions provided by this plugin. | |
| const PluginLoader & | loader () const |
| Returns the loader of this plugin. | |
| std::filesystem::path | cacheLocation () const |
| Returns the writable cache location for this plugin. | |
| std::filesystem::path | configLocation () const |
| Returns the writable config location for this plugin. | |
| std::filesystem::path | dataLocation () const |
| Returns the writable data location for this plugin. | |
| std::vector< std::filesystem::path > | dataLocations () const |
| Returns the existing data locations for this plugin. | |
| std::unique_ptr< QSettings > | settings () const |
Creates a preconfigured QSettings object for plugin config data. | |
| std::unique_ptr< QSettings > | state () const |
Creates a preconfigured QSettings object for plugin state data. | |
Protected Member Functions | |
| PluginInstance () | |
| Constructs a plugin instance. | |
| virtual | ~PluginInstance () |
| Destructs the plugin instance. | |
Signals | |
| void | initialized () |
| Emitted when the plugin has completed initialization. | |
|
virtual |
Creates a widget that can be used to configure the plugin properties.
The caller takes ownership of the returned object.
| std::vector< std::filesystem::path > albert::PluginInstance::dataLocations | ( | ) | const |
Returns the existing data locations for this plugin.
This includes user, vendor, and system locations.
|
virtual |
Returns the extensions provided by this plugin.
The caller does not take ownership of the returned objects.
Reimplemented in albert::ExtensionPlugin.
|
virtual |
Triggers the asynchronous initialization.
Implementations have to emit initialized() or call base::initialize() when done initializing.
| std::unique_ptr< QSettings > albert::PluginInstance::settings | ( | ) | const |
Creates a preconfigured QSettings object for plugin config data.
Configured to use the group <plugin-id> in albert::config().
| std::unique_ptr< QSettings > albert::PluginInstance::state | ( | ) | const |
Creates a preconfigured QSettings object for plugin state data.
Configured to use the group <plugin-id> in albert::state().