#ifndef CONFIGMANAGER_H
#define CONFIGMANAGER_H
#include "uosai_global.h"

#include <QObject>
#include <QVariant>

namespace  uos_ai {

#define WORDWIZARD_GROUP "WordWizard"
#define WORDWIZARD_ISFIRSTCLOSE "isFirstClose"
#define WORDWIZARD_ISHIDDEN "isHidden"

#define AIBAR_GROUP "AiBar"
#define AIBAR_ENABLEFILEDRAG "enableFileDrag"

#define AIQUICK_GROUP "aiquick"
#define AIQUICK_NOTFIRSTFILL "notfirstfill"

#define AUDIOWIZARD_GROUP "AudioWizard"
#define AUDIOWIZARD_IAT_NOSPEAK_DELAY_MS "iatNoSpeakDelayMs"

class ConfigManagerPrivate;
class ConfigManager : public QObject
{
    Q_OBJECT
public:
    static ConfigManager *instance();
    void init();

    QVariant value(const QString &group, const QString &key) const;
    void setValue(const QString &group, const QString &key, const QVariant &value);

protected Q_SLOTS:
    void onFileChanged(const QString &file);
    void loadConfig();

private:
    explicit ConfigManager(QObject *parent = nullptr);
    void checkConfigValue();

private:
    ConfigManagerPrivate *d { nullptr };
};
}

#endif   // CONFIGMANAGER_H
