#ifndef GSETTINGS_MONITOR_H
#define GSETTINGS_MONITOR_H

#include <QObject>
#include <QGSettings>


class GsettingsMonitor : public QObject
{
    Q_OBJECT

public:
    enum StyleStatus{
        NONE = 0,
        LIGHT,
        DARK
    };

    GsettingsMonitor(/* args */);
    ~GsettingsMonitor() override;
    int transparency() const;
    StyleStatus styleStatus() const;

signals:
    void transparencyUpdate(int transparency);
    void styleStatusUpdate(StyleStatus styleStatus);

private:
    bool gsettingsCheck();
    void initGsettings();
    void getTransparency();
    void getStyleStatus();

    StyleStatus styleNameConvert(const QString &styleName);
private:
    const char *UKUI_STYLE = "org.ukui.style";
    const char *UKUI_FONT_SIZE = "systemFontSize";
    const char *UKUI_FONT = "systemFont";
    const char *UKUI_MENU_TRANSPARENCY = "menuTransparency";
    const char *UKUI_STYLE_NAME = "styleName";
private:
    QGSettings *m_ukuiStyle;

    int m_menuTrans = -1;
    StyleStatus m_styleStatus = NONE;
};

#endif // GSETTINGS_MONITOR_H
