ukui-notification/libukui-notification/notification-settings/settings-manager.h

78 lines
2.0 KiB
C
Raw Normal View History

2023-04-17 11:15:11 +08:00
/*
* Copyright (C) 2023, 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: iaom <zhangpengfei@kylinos.cn>
*/
#ifndef SETTINGS_MANAGER_H
#define SETTINGS_MANAGER_H
#include <QObject>
#include "settings-properties.h"
namespace UkuiNotification {
class SettingsManagerPrivate;
class SettingsManager : public QObject
{
Q_OBJECT
public:
static SettingsManager *self();
~SettingsManager() = default;
/**
*
*/
QJsonObject getGlobalSettings();
/**
* @brief getAllAppSettings
*
*/
QJsonObject getAllAppSettings();
/**
* @brief getAppSettings
*
* @param appDesktopName "default"
*/
QJsonObject getAppSettings(const QString &appDesktopName);
/**
*
* @return
*/
QJsonObject getAppDefaultSettings();
bool setGlobalSettings(SettingsProperty::Property key, const QVariant &value);
bool setAppSettings(const QString &appDesktopName, SettingsProperty::Property key, const QVariant &value);
Q_SIGNALS:
void settingsDataChanged();
void newAppInstalled(const QString &desktopEntry);
void appUninstalled(const QString &desktopEntry);
private:
SettingsManager(QObject *parent = nullptr);
SettingsManagerPrivate * d = nullptr;
};
}
#endif