#ifndef KEYBOARDINTERFACE_H
#define KEYBOARDINTERFACE_H

#include <QObject>
#include "universalinterface.h"

class KeyBoardInterface : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", "org.ukui.ukcc.session.KeyBoard")
    Q_PROPERTY(bool repeat READ getKeyRepeat)
    Q_PROPERTY(int delay READ getDelay)
    Q_PROPERTY(int rate READ getRate)
    Q_PROPERTY(bool showLockTip READ getShowLockTip)

public:
    KeyBoardInterface();
    ~KeyBoardInterface();

    void initConnect();

private:

    const QString    KEYREPEAT_KEY       = QString("repeat");
    const QString    DELAY_KEY           = QString("delay");
    const QString    SPEED_KEY           = QString("rate");

    const QString    KEYTIPS_KEY         = QString("showLockTip");

    QGSettings       *keyboardGsettings  = nullptr;
    QGSettings       *ukccOsdGsettings   = nullptr;

protected:
    // 对属性的访问函数
    const bool getKeyRepeat();
    const int  getDelay();
    const int  getRate();
    const bool getShowLockTip();

public Q_SLOTS:
    // 对属性的设置函数
    void setKeyRepeat(const bool checked);
    void setDelay(const int value);
    void setSpeed(const int value);
    void setKeyTips(const bool checked);

Q_SIGNALS:
    void changed(QString keyName);
};

#endif // KEYBOARDINTERFACE_H
