Files
CalibratorLauncher/utils/configmanager.h
2026-01-02 19:20:35 +09:00

38 lines
850 B
C++

#ifndef CONFIGMANAGER_H
#define CONFIGMANAGER_H
#include <QObject>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QVector>
#include "../widgets/appicon.h"
#include "../widgets/launcherpage.h"
class ConfigManager : public QObject
{
Q_OBJECT
public:
explicit ConfigManager(QObject *parent = nullptr);
~ConfigManager();
bool loadFromFile(const QString &filePath);
bool loadDefaultConfig();
bool saveToFile(const QString &filePath);
QVector<PageConfig> getPages() const;
QVector<AppIconData> getDockApps() const;
QJsonObject getColorSystem() const;
QJsonObject getAnimations() const;
private:
AppIconData parseAppData(const QJsonObject &obj) const;
PageConfig parsePageConfig(const QJsonObject &obj) const;
QJsonDocument m_configDoc;
QJsonObject m_config;
};
#endif // CONFIGMANAGER_H