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.
 
Extensions
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.
 

Static Public Member Functions

static Appinstance ()
 Returns the global app instance.
 
Application control
static void restart ()
 Restarts the application.
 
static void quit ()
 Quits the application.
 
Persistence
static std::unique_ptr< QSettings > settings ()
 Returns a QSettings object initialized with the application configuration file path.
 
static std::unique_ptr< QSettings > state ()
 Returns a QSettings object initialized with the application state file path.
 
static const std::filesystem::path & configLocation ()
 Returns the path to the application config directory.
 
static const std::filesystem::path & cacheLocation ()
 Returns the path to the application cache directory.
 
static const std::filesystem::path & dataLocation ()
 Returns the path to the application data directory.
 

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

static const std::filesystem::path & albert::App::cacheLocation ( )
static

Returns the path to the application cache directory.

This function is thread-safe.

◆ configLocation()

static const std::filesystem::path & albert::App::configLocation ( )
static

Returns the path to the application config directory.

This function is thread-safe.

◆ dataLocation()

static const std::filesystem::path & albert::App::dataLocation ( )
static

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

static std::unique_ptr< QSettings > albert::App::settings ( )
static

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

static std::unique_ptr< QSettings > albert::App::state ( )
static

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: