Albert
Loading...
Searching...
No Matches
albert.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <QString>
6#include <albert/export.h>
7#include <filesystem>
8class NotificationPrivate;
9class QNetworkAccessManager;
10class QSettings;
11class QUrl;
12
13namespace albert
14{
15class ExtensionRegistry;
16
22ALBERT_EXPORT void restart();
23
29ALBERT_EXPORT void quit();
30
37ALBERT_EXPORT QNetworkAccessManager &network();
38
41ALBERT_EXPORT void showSettings(QString plugin_id = {});
42
46ALBERT_EXPORT std::filesystem::path configLocation();
47
51ALBERT_EXPORT std::filesystem::path cacheLocation();
52
56ALBERT_EXPORT std::filesystem::path dataLocation();
57
60ALBERT_EXPORT std::unique_ptr<QSettings> settings();
61
64ALBERT_EXPORT std::unique_ptr<QSettings> state();
65
67ALBERT_EXPORT void openWebsite();
68
71ALBERT_EXPORT void openUrl(const QString &url);
72
79ALBERT_EXPORT void open(const QUrl &url);
80
87ALBERT_EXPORT void open(const QString &path);
88
97ALBERT_EXPORT void open(const std::string &path);
98
101ALBERT_EXPORT void setClipboardText(const QString &text);
102
106ALBERT_EXPORT bool havePasteSupport();
107
111ALBERT_EXPORT void setClipboardTextAndPaste(const QString &text);
112
117ALBERT_EXPORT long long runDetachedProcess(const QStringList &commandline, const QString &working_dir = {});
118
131
142ALBERT_EXPORT void tryCreateDirectory(const std::filesystem::path &path);
143
144} // namespace albert
145
The common extension pool.
Definition extensionregistry.h:23
Definition action.h:10
std::unique_ptr< QSettings > settings()
Persistent app settings storage.
bool havePasteSupport()
Check paste support of the platform.
std::unique_ptr< QSettings > state()
The persistent app state storage.
void setClipboardText(const QString &text)
Set the system clipboard.
void open(const QUrl &url)
Open URL with default handler.
QNetworkAccessManager & network()
The threadlocal, global QNetworkAccessManager.
void restart()
Restart the application.
std::filesystem::path dataLocation()
The app data location.
void setClipboardTextAndPaste(const QString &text)
Set the system clipboard and paste the content to the front-most window.
std::filesystem::path cacheLocation()
The app cache location.
std::filesystem::path configLocation()
The app config location.
void showSettings(QString plugin_id={})
Open/Show the settings window (of plugin).
void quit()
Quit the application.
long long runDetachedProcess(const QStringList &commandline, const QString &working_dir={})
Run a detached process.
void openUrl(const QString &url)
Open the specified url in default browser.
const ExtensionRegistry & extensionRegistry()
The extension registry.
void openWebsite()
Open the albert website in default browser.
void tryCreateDirectory(const std::filesystem::path &path)
Create a directory if it does not exist yet.