// This file is generated by kconfig_compiler_kf6 from keyboardmiscsettings.kcfg.
// All changes you do to this file will be lost.
#ifndef KEYBOARDMISCSETTINGS_H
#define KEYBOARDMISCSETTINGS_H

#include <qglobal.h>
#include <kconfigskeleton.h>
#include <QCoreApplication>
#include <QDebug>

#include <QtGlobal>

class KeyboardMiscSettings : public KConfigSkeleton
{
  Q_OBJECT
  public:

    KeyboardMiscSettings( QObject *parent = nullptr );
    ~KeyboardMiscSettings() override;

    /**
      Set KeyRepeat
    */
    void setKeyboardRepeat( const QString & v )
    {
      if (v != mKeyboardRepeat && !isKeyboardRepeatImmutable()) {
        mKeyboardRepeat = v;
        Q_EMIT keyboardRepeatChanged();
      }
    }

    Q_PROPERTY(QString keyboardRepeat READ keyboardRepeat WRITE setKeyboardRepeat NOTIFY keyboardRepeatChanged)
    Q_PROPERTY(bool isKeyboardRepeatImmutable READ isKeyboardRepeatImmutable CONSTANT)
    Q_PROPERTY(QString defaultKeyboardRepeatValue READ defaultKeyboardRepeatValue CONSTANT)
    /**
      Get KeyRepeat
    */
    QString keyboardRepeat() const
    {
      return mKeyboardRepeat;
    }

    /**
      Is KeyRepeat Immutable
    */
    bool isKeyboardRepeatImmutable() const
    {
      return isImmutable( QStringLiteral( "keyboardRepeat" ) );
    }

    /**
      Get KeyRepeat default value
    */
    QString defaultKeyboardRepeatValue() const
    {
        return defaultKeyboardRepeatValue_helper();
    }

    /**
      Set NumLock
    */
    void setNumLock( int v )
    {
      if (v != mNumLock && !isNumLockImmutable()) {
        mNumLock = v;
        Q_EMIT numLockChanged();
      }
    }

    Q_PROPERTY(int numLock READ numLock WRITE setNumLock NOTIFY numLockChanged)
    Q_PROPERTY(bool isNumLockImmutable READ isNumLockImmutable CONSTANT)
    Q_PROPERTY(int defaultNumLockValue READ defaultNumLockValue CONSTANT)
    /**
      Get NumLock
    */
    int numLock() const
    {
      return mNumLock;
    }

    /**
      Is NumLock Immutable
    */
    bool isNumLockImmutable() const
    {
      return isImmutable( QStringLiteral( "numLock" ) );
    }

    /**
      Get NumLock default value
    */
    int defaultNumLockValue() const
    {
        return defaultNumLockValue_helper();
    }

    /**
      Set RepeatDelay
    */
    void setRepeatDelay( int v )
    {
      if (v < 100)
      {
        qDebug() << "setRepeatDelay: value " << v << " is less than the minimum value of 100";
        v = 100;
      }

      if (v > 5000)
      {
        qDebug() << "setRepeatDelay: value " << v << " is greater than the maximum value of 5000";
        v = 5000;
      }

      if (v != mRepeatDelay && !isRepeatDelayImmutable()) {
        mRepeatDelay = v;
        Q_EMIT repeatDelayChanged();
      }
    }

    Q_PROPERTY(int repeatDelay READ repeatDelay WRITE setRepeatDelay NOTIFY repeatDelayChanged)
    Q_PROPERTY(bool isRepeatDelayImmutable READ isRepeatDelayImmutable CONSTANT)
    Q_PROPERTY(int defaultRepeatDelayValue READ defaultRepeatDelayValue CONSTANT)
    /**
      Get RepeatDelay
    */
    int repeatDelay() const
    {
      return mRepeatDelay;
    }

    /**
      Is RepeatDelay Immutable
    */
    bool isRepeatDelayImmutable() const
    {
      return isImmutable( QStringLiteral( "repeatDelay" ) );
    }

    /**
      Get RepeatDelay default value
    */
    int defaultRepeatDelayValue() const
    {
        return defaultRepeatDelayValue_helper();
    }

    /**
      Set RepeatRate
    */
    void setRepeatRate( double v )
    {
      if (v < 0.2)
      {
        qDebug() << "setRepeatRate: value " << v << " is less than the minimum value of 0.2";
        v = 0.2;
      }

      if (v > 200)
      {
        qDebug() << "setRepeatRate: value " << v << " is greater than the maximum value of 200";
        v = 200;
      }

      if (v != mRepeatRate && !isRepeatRateImmutable()) {
        mRepeatRate = v;
        Q_EMIT repeatRateChanged();
      }
    }

    Q_PROPERTY(double repeatRate READ repeatRate WRITE setRepeatRate NOTIFY repeatRateChanged)
    Q_PROPERTY(bool isRepeatRateImmutable READ isRepeatRateImmutable CONSTANT)
    Q_PROPERTY(double defaultRepeatRateValue READ defaultRepeatRateValue CONSTANT)
    /**
      Get RepeatRate
    */
    double repeatRate() const
    {
      return mRepeatRate;
    }

    /**
      Is RepeatRate Immutable
    */
    bool isRepeatRateImmutable() const
    {
      return isImmutable( QStringLiteral( "repeatRate" ) );
    }

    /**
      Get RepeatRate default value
    */
    double defaultRepeatRateValue() const
    {
        return defaultRepeatRateValue_helper();
    }


    enum {
      signalKeyboardRepeatChanged = 1,
      signalNumLockChanged = 2,
      signalRepeatDelayChanged = 3,
      signalRepeatRateChanged = 4
    };

  Q_SIGNALS:
    void keyboardRepeatChanged();

    void numLockChanged();

    void repeatDelayChanged();

    void repeatRateChanged();

  private:
    void itemChanged(quint64 signalFlag);

  protected:

    // Keyboard
    QString mKeyboardRepeat;
    QString defaultKeyboardRepeatValue_helper() const;
    int mNumLock;
    int defaultNumLockValue_helper() const;
    int mRepeatDelay;
    int defaultRepeatDelayValue_helper() const;
    double mRepeatRate;
    double defaultRepeatRateValue_helper() const;
};

#endif

