Albert
Loading...
Searching...
No Matches
util.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>
7class NotificationPrivate;
8class QNetworkAccessManager;
9class QSettings;
10class QUrl;
11
12namespace albert
13{
14
20void restart();
21
27void quit();
28
31ALBERT_EXPORT QNetworkAccessManager *network();
32
35ALBERT_EXPORT void showSettings(QString plugin_id = {});
36
40ALBERT_EXPORT QString configLocation();
41
45ALBERT_EXPORT QString cacheLocation();
46
50ALBERT_EXPORT QString dataLocation();
51
54ALBERT_EXPORT std::unique_ptr<QSettings> settings();
55
58ALBERT_EXPORT std::unique_ptr<QSettings> state();
59
61ALBERT_EXPORT void openWebsite();
62
65ALBERT_EXPORT void openUrl(const QUrl &url);
66
69ALBERT_EXPORT void openUrl(const QString &url);
70
77ALBERT_EXPORT void open(const QUrl &url);
78
85ALBERT_EXPORT void open(const QString &path);
86
95ALBERT_EXPORT void open(const std::string &path);
96
99ALBERT_EXPORT void setClipboardText(const QString &text);
100
104ALBERT_EXPORT bool havePasteSupport();
105
109ALBERT_EXPORT void setClipboardTextAndPaste(const QString &text);
110
115ALBERT_EXPORT long long runDetachedProcess(const QStringList &commandline, const QString &working_dir = {});
116
117}
Definition action.h:10
QNetworkAccessManager * network()
The global QNetworkAccessManager.
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.
QString dataLocation()
The app data location.
void setClipboardText(const QString &text)
Set the system clipboard.
void open(const QUrl &url)
Open URL with default handler.
QString cacheLocation()
The app cache location.
void restart()
Restart the application.
QString configLocation()
The app config location.
void setClipboardTextAndPaste(const QString &text)
Set the system clipboard and paste the content to the front-most window.
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 QUrl &url)
Open the specified url in default browser.
void openWebsite()
Open the albert website in default browser.