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

#include <albert/plugininstance.h>

Inheritance diagram for albert::PluginInstance:
[legend]

Detailed Description

Abstract plugin instance class.

The class every plugin has to inherit.

Public Member Functions

virtual QWidget * buildConfigWidget ()
 The widget used to configure the plugin in the settings.
 
virtual std::vector< albert::Extension * > extensions ()
 The extensions provided by this plugin.
 
const PluginLoaderloader () const
 The PluginLoader of this instance.
 
std::filesystem::path cacheLocation () const
 The recommended cache location.
 
std::filesystem::path configLocation () const
 The recommended config location.
 
std::filesystem::path dataLocation () const
 The recommended data location.
 
std::vector< std::filesystem::path > dataLocations () const
 The existing data locations of this plugin.
 
std::unique_ptr< QSettings > settings () const
 Persistent plugin settings.
 
std::unique_ptr< QSettings > state () const
 Persistent plugin state.
 
void readKeychain (const QString &key, std::function< void(const QString &)> onSuccess, std::function< void(const QString &)> onError) const
 Reads the keychain value for key asynchronously.
 
void writeKeychain (const QString &key, const QString &value, std::function< void()> onSuccess, std::function< void(const QString &)> onError) const
 Sets the keychain value of key to value asynchronously.
 

Protected Member Functions

 PluginInstance ()
 
virtual ~PluginInstance ()
 

Constructor & Destructor Documentation

◆ PluginInstance()

albert::PluginInstance::PluginInstance ( )
protected

◆ ~PluginInstance()

virtual albert::PluginInstance::~PluginInstance ( )
protectedvirtual

Member Function Documentation

◆ buildConfigWidget()

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

The widget used to configure the plugin in the settings.

Returns
The config widget.

◆ cacheLocation()

std::filesystem::path albert::PluginInstance::cacheLocation ( ) const

The recommended cache location.

Returns
The recommended cache location.

◆ configLocation()

std::filesystem::path albert::PluginInstance::configLocation ( ) const

The recommended config location.

Returns
The recommended config location.

◆ dataLocation()

std::filesystem::path albert::PluginInstance::dataLocation ( ) const

The recommended data location.

Returns
The recommended data location.

◆ dataLocations()

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

The existing data locations of this plugin.

Returns
The existing data locations of this plugin.

◆ extensions()

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

The extensions provided by this plugin.

Returns
Weak references to the extensions.

Reimplemented in albert::util::ExtensionPlugin.

◆ loader()

const PluginLoader & albert::PluginInstance::loader ( ) const

The PluginLoader of this instance.

Returns
The PluginLoader of this instance.

◆ readKeychain()

void albert::PluginInstance::readKeychain ( const QString &  key,
std::function< void(const QString &)>  onSuccess,
std::function< void(const QString &)>  onError 
) const

Reads the keychain value for key asynchronously.

Calls onSuccess with the value on success and onError with an error message on failure.

◆ settings()

std::unique_ptr< QSettings > albert::PluginInstance::settings ( ) const

Persistent plugin settings.

Preconfigured according to albert conventions, i.e. using albert::settings() configured to write to a section titled <plugin-id>.

Returns
Preconfigured QSettings object for config storage.

◆ state()

std::unique_ptr< QSettings > albert::PluginInstance::state ( ) const

Persistent plugin state.

Preconfigured according to albert conventions, i.e. using albert::state() configured to write to a section titled <plugin-id>.

Returns
Preconfigured QSettings object for state storage.

◆ writeKeychain()

void albert::PluginInstance::writeKeychain ( const QString &  key,
const QString &  value,
std::function< void()>  onSuccess,
std::function< void(const QString &)>  onError 
) const

Sets the keychain value of key to value asynchronously.

Calls onSuccess on success and onError with an error message on failure.


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