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