Albert
Loading...
Searching...
No Matches
albert::PluginInstance Class Reference

#include <albert/plugininstance.h>

Description

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.

Inheritance diagram for albert::PluginInstance:
[legend]

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 PluginLoaderloader () 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.
 

Member Function Documentation

◆ buildConfigWidget()

virtual QWidget * albert::PluginInstance::buildConfigWidget ( )
virtual

Creates a widget that can be used to configure the plugin properties.

The caller takes ownership of the returned object.

◆ dataLocations()

std::vector< std::filesystem::path > albert::PluginInstance::dataLocations ( ) const

Returns the existing data locations for this plugin.

This includes user, vendor, and system locations.

◆ extensions()

virtual std::vector< albert::Extension * > albert::PluginInstance::extensions ( )
virtual

Returns the extensions provided by this plugin.

The caller does not take ownership of the returned objects.

Reimplemented in albert::ExtensionPlugin.

◆ initialize()

virtual void albert::PluginInstance::initialize ( )
virtual

Triggers the asynchronous initialization.

Implementations have to emit initialized() or call base::initialize() when done initializing.

◆ settings()

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().

◆ state()

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().


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