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

#include <albert/app.h>

Description

The public app instance interface.

Inherits QObject.

Public Member Functions

Main window
virtual void show (const QString &input_text={})=0
 Shows the frontend and optionally sets the text to input_text.
 
virtual void showSettings (QString plugin_id={})=0
 Shows the settings window and optionally selects the plugin with plugin_id.
 
Plugins and extensions
virtual bool localizationEnabled () const =0
 Returns true when a PluginLoader should load translations, false otherwise.
 
virtual const std::map< QString, Extension * > & extensions () const =0
 Get map of all registered extensions.
 
template<typename T >
std::map< QString, T * > extensions () const
 Get map of all extensions of type T
 
template<typename T >
T * extension (const QString &id) const
 Get extension by id implicitly dynamic_cast'ed to type T.
 
Persistence
virtual std::unique_ptr< QSettings > settings ()=0
 Returns a QSettings object initialized with the application configuration file path.
 
virtual std::unique_ptr< QSettings > state ()=0
 Returns a QSettings object initialized with the application state file path.
 
virtual const std::filesystem::path & cacheLocation ()=0
 Returns the path to the application cache directory.
 
virtual const std::filesystem::path & configLocation ()=0
 Returns the path to the application config directory.
 
virtual const std::filesystem::path & dataLocation ()=0
 Returns the path to the application data directory.
 

Static Public Member Functions

Application control
static void restart ()
 Restarts the application.
 
static void quit ()
 Quits the application.
 

Signals

void added (albert::Extension *)
 Emitted when an extension has been registered.
 
void removed (albert::Extension *)
 Emitted when an extension has been deregistered.
 

Member Function Documentation

◆ cacheLocation()

virtual const std::filesystem::path & albert::App::cacheLocation ( )
pure virtual

Returns the path to the application cache directory.

This function is thread-safe.

◆ configLocation()

virtual const std::filesystem::path & albert::App::configLocation ( )
pure virtual

Returns the path to the application config directory.

This function is thread-safe.

◆ dataLocation()

virtual const std::filesystem::path & albert::App::dataLocation ( )
pure virtual

Returns the path to the application data directory.

This function is thread-safe.

◆ quit()

static void albert::App::quit ( )
static

Quits the application.

This function is thread-safe.

◆ restart()

static void albert::App::restart ( )
static

Restarts the application.

This function is thread-safe.

◆ settings()

virtual std::unique_ptr< QSettings > albert::App::settings ( )
pure virtual

Returns a QSettings object initialized with the application configuration file path.

As unique_ptr for the sake of movability.

This function is thread-safe.

◆ state()

virtual std::unique_ptr< QSettings > albert::App::state ( )
pure virtual

Returns a QSettings object initialized with the application state file path.

As unique_ptr for the sake of movability.

This function is thread-safe.


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