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
14DPF_BEGIN_NAMESPACE
15
16const char ORGANIZATION[] = "deepin";
17const char ENABLED[] = "enabled";
18const char DISABLED_PLUGINS[] = "Plugins/Disabled";
19const char ENABLED_PLUGINS[] = "Plugins/Enabled";
20
21class PluginSetting final : public QSettings
22{
23 Q_OBJECT
24public:
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);
30Q_SIGNALS:
31 void pluginEnabled(const PluginMetaObject &meta, bool enabled);
32};
33
34DPF_END_NAMESPACE
35
36#endif // PLUGINSSETTING_H
37