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

61 lines
1.3 KiB
C++

//
//
#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