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

#include "kcmaccessibilitymouse.h"

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

  setCurrentGroup( QStringLiteral( "Mouse" ) );

  KConfigCompilerSignallingItem  *itemMouseKeys;
  KConfigSkeleton::ItemBool  *innerItemMouseKeys;
  innerItemMouseKeys = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "MouseKeys" ), mMouseKeys, false );
  itemMouseKeys = new KConfigCompilerSignallingItem(innerItemMouseKeys, this, notifyFunction, signalMouseKeysChanged);
  itemMouseKeys->setWriteFlags(KConfigBase::Notify);
  addItem( itemMouseKeys, QStringLiteral( "MouseKeys" ) );
  KConfigCompilerSignallingItem  *itemAccelerationDelay;
  KConfigSkeleton::ItemInt  *innerItemAccelerationDelay;
  innerItemAccelerationDelay = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MKDelay" ), mAccelerationDelay, 160 );
  itemAccelerationDelay = new KConfigCompilerSignallingItem(innerItemAccelerationDelay, this, notifyFunction, signalAccelerationDelayChanged);
  itemAccelerationDelay->setWriteFlags(KConfigBase::Notify);
  addItem( itemAccelerationDelay, QStringLiteral( "AccelerationDelay" ) );
  KConfigCompilerSignallingItem  *itemRepetitionInterval;
  KConfigSkeleton::ItemInt  *innerItemRepetitionInterval;
  innerItemRepetitionInterval = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MKInterval" ), mRepetitionInterval, 40 );
  itemRepetitionInterval = new KConfigCompilerSignallingItem(innerItemRepetitionInterval, this, notifyFunction, signalRepetitionIntervalChanged);
  itemRepetitionInterval->setWriteFlags(KConfigBase::Notify);
  addItem( itemRepetitionInterval, QStringLiteral( "RepetitionInterval" ) );
  KConfigCompilerSignallingItem  *itemAccelerationTime;
  KConfigSkeleton::ItemInt  *innerItemAccelerationTime;
  innerItemAccelerationTime = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MKTimeToMax" ), mAccelerationTime, 30 );
  itemAccelerationTime = new KConfigCompilerSignallingItem(innerItemAccelerationTime, this, notifyFunction, signalAccelerationTimeChanged);
  itemAccelerationTime->setWriteFlags(KConfigBase::Notify);
  addItem( itemAccelerationTime, QStringLiteral( "AccelerationTime" ) );
  KConfigCompilerSignallingItem  *itemMaxSpeed;
  KConfigSkeleton::ItemInt  *innerItemMaxSpeed;
  innerItemMaxSpeed = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MKMaxSpeed" ), mMaxSpeed, 30 );
  itemMaxSpeed = new KConfigCompilerSignallingItem(innerItemMaxSpeed, this, notifyFunction, signalMaxSpeedChanged);
  itemMaxSpeed->setWriteFlags(KConfigBase::Notify);
  addItem( itemMaxSpeed, QStringLiteral( "MaxSpeed" ) );
  KConfigCompilerSignallingItem  *itemProfileCurve;
  KConfigSkeleton::ItemInt  *innerItemProfileCurve;
  innerItemProfileCurve = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MKCurve" ), mProfileCurve, 0 );
  itemProfileCurve = new KConfigCompilerSignallingItem(innerItemProfileCurve, this, notifyFunction, signalProfileCurveChanged);
  itemProfileCurve->setWriteFlags(KConfigBase::Notify);
  addItem( itemProfileCurve, QStringLiteral( "ProfileCurve" ) );
}

bool MouseSettings::defaultMouseKeysValue_helper() const
{

  return false;
}

int MouseSettings::defaultAccelerationDelayValue_helper() const
{

  return 160;
}

int MouseSettings::defaultRepetitionIntervalValue_helper() const
{

  return 40;
}

int MouseSettings::defaultAccelerationTimeValue_helper() const
{

  return 30;
}

int MouseSettings::defaultMaxSpeedValue_helper() const
{

  return 30;
}

int MouseSettings::defaultProfileCurveValue_helper() const
{

  return 0;
}

MouseSettings::~MouseSettings()
{
}


void MouseSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalMouseKeysChanged:
    Q_EMIT MouseKeysChanged();
    break;
  case signalAccelerationDelayChanged:
    Q_EMIT AccelerationDelayChanged();
    break;
  case signalRepetitionIntervalChanged:
    Q_EMIT RepetitionIntervalChanged();
    break;
  case signalAccelerationTimeChanged:
    Q_EMIT AccelerationTimeChanged();
    break;
  case signalMaxSpeedChanged:
    Q_EMIT MaxSpeedChanged();
    break;
  case signalProfileCurveChanged:
    Q_EMIT ProfileCurveChanged();
    break;
  }
}
