2021-01-29 11:43:07 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020, KylinSoft Co., Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Authors: zhangzihao <zhangzihao@kylinos.cn>
|
|
|
|
* Modified by: zhangpengfei <zhangpengfei@kylinos.cn>
|
|
|
|
*
|
|
|
|
*/
|
2020-12-28 20:29:13 +08:00
|
|
|
#ifndef GLOBALSETTINGS_H
|
|
|
|
#define GLOBALSETTINGS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2023-05-31 17:59:20 +08:00
|
|
|
#include <QString>
|
|
|
|
#include <QVariant>
|
2021-01-04 14:21:45 +08:00
|
|
|
#include "libsearch_global.h"
|
2020-12-28 20:29:13 +08:00
|
|
|
|
2023-05-31 17:59:20 +08:00
|
|
|
namespace UkuiSearch {
|
2021-01-04 14:21:45 +08:00
|
|
|
|
2023-05-31 17:59:20 +08:00
|
|
|
const static QString TRANSPARENCY_KEY = "transparency";
|
|
|
|
const static QString STYLE_NAME_KEY = "styleName";
|
|
|
|
const static QString FONT_SIZE_KEY = "systemFontSize";
|
|
|
|
const static QString ICON_THEME_KEY = "iconThemeName";
|
2021-03-20 15:37:54 +08:00
|
|
|
|
2023-05-31 17:59:20 +08:00
|
|
|
class GlobalSettingsPrivate;
|
2022-11-28 18:11:55 +08:00
|
|
|
/**
|
|
|
|
* @brief The GlobalSettings class
|
|
|
|
* 用于同步搜索应用的全局设置
|
|
|
|
* 不要作为文件索引或应用数据等服务设置使用
|
|
|
|
*/
|
2021-04-26 15:06:47 +08:00
|
|
|
class LIBSEARCH_EXPORT GlobalSettings : public QObject {
|
2020-12-28 20:29:13 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-05-31 17:59:20 +08:00
|
|
|
static GlobalSettings& getInstance();
|
|
|
|
const QVariant getValue(const QString& key);
|
2021-01-03 16:58:26 +08:00
|
|
|
|
2022-11-28 18:11:55 +08:00
|
|
|
Q_SIGNALS:
|
2023-05-31 17:59:20 +08:00
|
|
|
void valueChanged(const QString& key, QVariant value);
|
2022-11-28 18:11:55 +08:00
|
|
|
|
2021-01-03 16:58:26 +08:00
|
|
|
private:
|
|
|
|
explicit GlobalSettings(QObject *parent = nullptr);
|
2023-05-31 17:59:20 +08:00
|
|
|
GlobalSettings(const GlobalSettings&) = delete;
|
|
|
|
GlobalSettings& operator =(const GlobalSettings&) = delete;
|
2021-01-03 16:58:26 +08:00
|
|
|
|
2023-05-31 17:59:20 +08:00
|
|
|
GlobalSettingsPrivate *d;
|
2020-12-28 20:29:13 +08:00
|
|
|
};
|
|
|
|
|
2021-04-30 16:28:50 +08:00
|
|
|
}
|
|
|
|
|
2020-12-28 20:29:13 +08:00
|
|
|
#endif // GLOBALSETTINGS_H
|