| 1 |
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include <dtkgui_global.h> |
| 8 |
|
| 9 |
#include <QMetaType> |
| 10 |
#include <QUrl> |
| 11 |
|
| 12 |
DGUI_BEGIN_NAMESPACE |
| 13 |
|
| 14 |
class DDesktopServices |
| 15 |
{ |
| 16 |
public: |
| 17 |
|
| 18 |
enum SystemSoundEffect { |
| 19 |
SSE_Notifications, |
| 20 |
SEE_Screenshot, |
| 21 |
SSE_EmptyTrash, |
| 22 |
SSE_SendFileComplete, |
| 23 |
SSE_BootUp, |
| 24 |
SSE_Shutdown, |
| 25 |
SSE_Logout, |
| 26 |
SSE_WakeUp, |
| 27 |
SSE_VolumeChange, |
| 28 |
SSE_LowBattery, |
| 29 |
SSE_PlugIn, |
| 30 |
SSE_PlugOut, |
| 31 |
SSE_DeviceAdded, |
| 32 |
SSE_DeviceRemoved, |
| 33 |
SSE_Error, |
| 34 |
}; |
| 35 |
|
| 36 |
static bool showFolder(const QString &localFilePath, const QString &startupId = QString()); |
| 37 |
static bool showFolders(const QList<QString> &localFilePaths, const QString &startupId = QString()); |
| 38 |
static bool showFolder(const QUrl &url, const QString &startupId = QString()); |
| 39 |
static bool showFolders(const QList<QUrl> &urls, const QString &startupId = QString()); |
| 40 |
|
| 41 |
static bool showFileItemProperty(const QString &localFilePath, const QString &startupId = QString()); |
| 42 |
static bool showFileItemProperties(const QList<QString> &localFilePaths, const QString &startupId = QString()); |
| 43 |
static bool showFileItemProperty(const QUrl &url, const QString &startupId = QString()); |
| 44 |
static bool showFileItemProperties(const QList<QUrl> &urls, const QString &startupId = QString()); |
| 45 |
|
| 46 |
static bool showFileItem(const QString &localFilePath, const QString &startupId = QString()); |
| 47 |
static bool showFileItems(const QList<QString> &localFilePaths, const QString &startupId = QString()); |
| 48 |
static bool showFileItem(const QUrl &url, const QString &startupId = QString()); |
| 49 |
static bool showFileItems(const QList<QUrl> &urls, const QString &startupId = QString()); |
| 50 |
|
| 51 |
static bool trash(const QString &localFilePath); |
| 52 |
static bool trash(const QList<QString> &localFilePaths); |
| 53 |
static bool trash(const QUrl &url); |
| 54 |
static bool trash(const QList<QUrl> &urls); |
| 55 |
|
| 56 |
static bool playSystemSoundEffect(const SystemSoundEffect &effect); |
| 57 |
static bool playSystemSoundEffect(const QString &name); |
| 58 |
static bool previewSystemSoundEffect(const SystemSoundEffect &effect); |
| 59 |
static bool previewSystemSoundEffect(const QString &name); |
| 60 |
static QString getNameByEffectType(const SystemSoundEffect &effect); |
| 61 |
|
| 62 |
static QString errorMessage(); |
| 63 |
}; |
| 64 |
|
| 65 |
DGUI_END_NAMESPACE |
| 66 |
|
| 67 |
#ifdef Q_OS_LINUX |
| 68 |
Q_DECLARE_METATYPE(DTK_GUI_NAMESPACE::DDesktopServices::SystemSoundEffect) |
| 69 |
#endif |
| 70 |
|