1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef PLUGINSSETTING_H |
6 | #define PLUGINSSETTING_H |
7 | |
8 | #include "framework/lifecycle/pluginmetaobject.h" |
9 | #include "framework/framework_global.h" |
10 | |
11 | #include <QCoreApplication> |
12 | #include <QSettings> |
13 | |
14 | DPF_BEGIN_NAMESPACE |
15 | |
16 | const char ORGANIZATION[] = "deepin"; |
17 | const char ENABLED[] = "enabled"; |
18 | const char DISABLED_PLUGINS[] = "Plugins/Disabled"; |
19 | const char ENABLED_PLUGINS[] = "Plugins/Enabled"; |
20 | |
21 | class PluginSetting final : public QSettings |
22 | { |
23 | Q_OBJECT |
24 | public: |
25 | PluginSetting(Scope scope = Scope::UserScope, |
26 | const QString &organization = ORGANIZATION, |
27 | const QString &application = QCoreApplication::applicationName(), |
28 | QObject *parent = nullptr); |
29 | void setPluginEnable(const PluginMetaObject &meta, bool enabled); |
30 | Q_SIGNALS: |
31 | void pluginEnabled(const PluginMetaObject &meta, bool enabled); |
32 | }; |
33 | |
34 | DPF_END_NAMESPACE |
35 | |
36 | #endif // PLUGINSSETTING_H |
37 |