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

#include "keyboardmiscsettings.h"

KeyboardMiscSettings::KeyboardMiscSettings( QObject *parent )
  : KConfigSkeleton( QStringLiteral( "kcminputrc" ) )
{
  setParent(parent);
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&KeyboardMiscSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "Keyboard" ) );

  KConfigCompilerSignallingItem  *itemKeyboardRepeat;
  KConfigSkeleton::ItemString  *innerItemKeyboardRepeat;
  innerItemKeyboardRepeat = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "KeyRepeat" ), mKeyboardRepeat, qgetenv("QT_IM_MODULE") == "plasmaim" ? QStringLiteral("accent") : QStringLiteral("repeat") );
  itemKeyboardRepeat = new KConfigCompilerSignallingItem(innerItemKeyboardRepeat, this, notifyFunction, signalKeyboardRepeatChanged);
  itemKeyboardRepeat->setWriteFlags(KConfigBase::Notify);
  addItem( itemKeyboardRepeat, QStringLiteral( "keyboardRepeat" ) );
  KConfigCompilerSignallingItem  *itemNumLock;
  KConfigSkeleton::ItemInt  *innerItemNumLock;
  innerItemNumLock = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "NumLock" ), mNumLock, 2 );
  itemNumLock = new KConfigCompilerSignallingItem(innerItemNumLock, this, notifyFunction, signalNumLockChanged);
  addItem( itemNumLock, QStringLiteral( "numLock" ) );
  KConfigCompilerSignallingItem  *itemRepeatDelay;
  KConfigSkeleton::ItemInt  *innerItemRepeatDelay;
  innerItemRepeatDelay = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "RepeatDelay" ), mRepeatDelay, 600 );
  itemRepeatDelay = new KConfigCompilerSignallingItem(innerItemRepeatDelay, this, notifyFunction, signalRepeatDelayChanged);
  innerItemRepeatDelay->setMinValue(100);
  innerItemRepeatDelay->setMaxValue(5000);
  itemRepeatDelay->setWriteFlags(KConfigBase::Notify);
  addItem( itemRepeatDelay, QStringLiteral( "repeatDelay" ) );
  KConfigCompilerSignallingItem  *itemRepeatRate;
  KConfigSkeleton::ItemDouble  *innerItemRepeatRate;
  innerItemRepeatRate = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "RepeatRate" ), mRepeatRate, 25.0 );
  itemRepeatRate = new KConfigCompilerSignallingItem(innerItemRepeatRate, this, notifyFunction, signalRepeatRateChanged);
  innerItemRepeatRate->setMinValue(0.2);
  innerItemRepeatRate->setMaxValue(200);
  itemRepeatRate->setWriteFlags(KConfigBase::Notify);
  addItem( itemRepeatRate, QStringLiteral( "repeatRate" ) );
}

QString KeyboardMiscSettings::defaultKeyboardRepeatValue_helper() const
{

  return qgetenv("QT_IM_MODULE") == "plasmaim" ? QStringLiteral("accent") : QStringLiteral("repeat");
}

int KeyboardMiscSettings::defaultNumLockValue_helper() const
{

  return 2;
}

int KeyboardMiscSettings::defaultRepeatDelayValue_helper() const
{

  return 600;
}

double KeyboardMiscSettings::defaultRepeatRateValue_helper() const
{

  return 25.0;
}

KeyboardMiscSettings::~KeyboardMiscSettings()
{
}


void KeyboardMiscSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalKeyboardRepeatChanged:
    Q_EMIT keyboardRepeatChanged();
    break;
  case signalNumLockChanged:
    Q_EMIT numLockChanged();
    break;
  case signalRepeatDelayChanged:
    Q_EMIT repeatDelayChanged();
    break;
  case signalRepeatRateChanged:
    Q_EMIT repeatRateChanged();
    break;
  }
}
