Albert
Loading...
Searching...
No Matches
app.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
6
10
14
18
21
25
29
33
37
41
45
46#pragma once
47#include <QString>
48#include <albert/export.h>
49#include <filesystem>
50#include <memory>
51class QNetworkAccessManager;
52class QSettings;
53class QUrl;
54
55namespace albert
56{
58class UsageScoring;
59
65class ALBERT_EXPORT App
66{
67public:
71 virtual void show(const QString &input_text = {}) = 0;
72
76 virtual void showSettings(QString plugin_id = {}) = 0;
77
84 virtual const ExtensionRegistry &extensionRegistry() const = 0;
85
91 static void restart();
92
98 static void quit();
99
105 static const std::filesystem::path &configLocation();
106
112 static const std::filesystem::path &cacheLocation();
113
119 static const std::filesystem::path &dataLocation();
120
128 static std::unique_ptr<QSettings> settings();
129
137 static std::unique_ptr<QSettings> state();
138
142 static App &instance();
143
144protected:
145
147 virtual ~App();
148
149};
150
151} // namespace albert
The public app instance interface.
Definition app.h:66
static std::unique_ptr< QSettings > settings()
Returns a QSettings object initialized with the application configuration file path.
static const std::filesystem::path & configLocation()
Returns the path to the application config directory.
static const std::filesystem::path & dataLocation()
Returns the path to the application data directory.
static App & instance()
Returns the core app instance.
static void quit()
Quits the application.
virtual ~App()
virtual const ExtensionRegistry & extensionRegistry() const =0
Returns a const reference to the central extension registry.
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.
static std::unique_ptr< QSettings > state()
Returns a QSettings object initialized with the application state file path.
static const std::filesystem::path & cacheLocation()
Returns the path to the application cache directory.
static void restart()
Restarts the application.
The common extension pool.
Definition extensionregistry.h:23
Modifies match scores according to user usage history and preferences.
Definition usagescoring.h:29
Definition app.h:56