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

#include "nightcolorsettings.h"

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

  setCurrentGroup( QStringLiteral( "NightColor" ) );

  KConfigCompilerSignallingItem  *itemActive;
  KConfigSkeleton::ItemBool  *innerItemActive;
  innerItemActive = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Active" ), mActive, false );
  itemActive = new KConfigCompilerSignallingItem(innerItemActive, this, notifyFunction, signalActiveChanged);
  itemActive->setWriteFlags(KConfigBase::Notify);
  addItem( itemActive, QStringLiteral( "Active" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesMode;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Constant");
    valuesMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("DarkLight");
    valuesMode.append( choice );
  }
  KConfigCompilerSignallingItem  *itemMode;
  KConfigSkeleton::ItemEnum  *innerItemMode;
  innerItemMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "Mode" ), mMode, valuesMode, ColorCorrect::DarkLight );
  itemMode = new KConfigCompilerSignallingItem(innerItemMode, this, notifyFunction, signalModeChanged);
  itemMode->setWriteFlags(KConfigBase::Notify);
  addItem( itemMode, QStringLiteral( "Mode" ) );
  KConfigCompilerSignallingItem  *itemDayTemperature;
  KConfigSkeleton::ItemInt  *innerItemDayTemperature;
  innerItemDayTemperature = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "DayTemperature" ), mDayTemperature, 6500 );
  itemDayTemperature = new KConfigCompilerSignallingItem(innerItemDayTemperature, this, notifyFunction, signalDayTemperatureChanged);
  itemDayTemperature->setWriteFlags(KConfigBase::Notify);
  addItem( itemDayTemperature, QStringLiteral( "DayTemperature" ) );
  KConfigCompilerSignallingItem  *itemNightTemperature;
  KConfigSkeleton::ItemInt  *innerItemNightTemperature;
  innerItemNightTemperature = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "NightTemperature" ), mNightTemperature, 4500 );
  itemNightTemperature = new KConfigCompilerSignallingItem(innerItemNightTemperature, this, notifyFunction, signalNightTemperatureChanged);
  itemNightTemperature->setWriteFlags(KConfigBase::Notify);
  addItem( itemNightTemperature, QStringLiteral( "NightTemperature" ) );
}

bool NightColorSettings::defaultActiveValue_helper() const
{

  return false;
}

int NightColorSettings::defaultModeValue_helper() const
{

  return ColorCorrect::DarkLight;
}

int NightColorSettings::defaultDayTemperatureValue_helper() const
{

  return 6500;
}

int NightColorSettings::defaultNightTemperatureValue_helper() const
{

  return 4500;
}

NightColorSettings::~NightColorSettings()
{
}


void NightColorSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalActiveChanged:
    Q_EMIT ActiveChanged();
    break;
  case signalModeChanged:
    Q_EMIT ModeChanged();
    break;
  case signalDayTemperatureChanged:
    Q_EMIT DayTemperatureChanged();
    break;
  case signalNightTemperatureChanged:
    Q_EMIT NightTemperatureChanged();
    break;
  }
}
