Albert
Loading...
Searching...
No Matches
systemutil.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 <QtGlobal>
6#include <albert/export.h>
7#include <filesystem>
8class QString;
9class QUrl;
10template <typename T> class QList;
12
13namespace albert::util
14{
15
18ALBERT_EXPORT void openUrl(const QString &url);
19
21ALBERT_EXPORT void open(const QUrl &url);
22
24ALBERT_EXPORT void open(const QString &path);
25
27ALBERT_EXPORT void open(const std::filesystem::path &path);
28
30ALBERT_EXPORT void setClipboardText(const QString &text);
31
33ALBERT_EXPORT bool havePasteSupport();
34
37ALBERT_EXPORT void setClipboardTextAndPaste(const QString &text);
38
40ALBERT_EXPORT long long runDetachedProcess(const QStringList &commandline);
41
43ALBERT_EXPORT long long runDetachedProcess(const QStringList &commandline, const QString &working_dir);
44
48ALBERT_EXPORT void tryCreateDirectory(const std::filesystem::path &path);
49
51ALBERT_EXPORT QString toQString(const std::filesystem::path &path);
52
53#ifdef Q_OS_MAC
56ALBERT_EXPORT QString runAppleScript(const QString &script);
57#endif
58}
Definition systemutil.h:10
Albert utility namespace.
Definition albert.h:14
bool havePasteSupport()
Returns the true if the platform supports pasting, else false.
void open(const QUrl &url)
Opens url with the default handler for the scheme.
void setClipboardTextAndPaste(const QString &text)
Sets the system clipboard to text and pastes text to the front-most window.
QString toQString(const std::filesystem::path &path)
Returns a QString representation of path.
void openUrl(const QString &url)
Opens url with the default handler for the scheme.
void tryCreateDirectory(const std::filesystem::path &path)
Tries to create a directory at path.
void setClipboardText(const QString &text)
Sets the system clipboard to text.
long long runDetachedProcess(const QStringList &commandline)
Run the commandline as detached process. Returns the process id.
QList< QString > QStringList
Definition systemutil.h:11