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

#include "nighttimesettings.h"

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

  setCurrentGroup( QStringLiteral( "General" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuessource;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Location");
    valuessource.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Times");
    valuessource.append( choice );
  }
  KConfigCompilerSignallingItem  *itemSource;
  KConfigSkeleton::ItemEnum  *innerItemSource;
  innerItemSource = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "Source" ), mSource, valuessource, Location );
  itemSource = new KConfigCompilerSignallingItem(innerItemSource, this, notifyFunction, signalSourceChanged);
  itemSource->setWriteFlags(KConfigBase::Notify);
  addItem( itemSource, QStringLiteral( "source" ) );

  setCurrentGroup( QStringLiteral( "Location" ) );

  KConfigCompilerSignallingItem  *itemAutomaticLocation;
  KConfigSkeleton::ItemBool  *innerItemAutomaticLocation;
  innerItemAutomaticLocation = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Automatic" ), mAutomaticLocation, true );
  itemAutomaticLocation = new KConfigCompilerSignallingItem(innerItemAutomaticLocation, this, notifyFunction, signalAutomaticLocationChanged);
  itemAutomaticLocation->setWriteFlags(KConfigBase::Notify);
  addItem( itemAutomaticLocation, QStringLiteral( "automaticLocation" ) );
  KConfigCompilerSignallingItem  *itemManualLatitude;
  KConfigSkeleton::ItemDouble  *innerItemManualLatitude;
  innerItemManualLatitude = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "Latitude" ), mManualLatitude, 0 );
  itemManualLatitude = new KConfigCompilerSignallingItem(innerItemManualLatitude, this, notifyFunction, signalManualLatitudeChanged);
  itemManualLatitude->setWriteFlags(KConfigBase::Notify);
  addItem( itemManualLatitude, QStringLiteral( "manualLatitude" ) );
  KConfigCompilerSignallingItem  *itemManualLongitude;
  KConfigSkeleton::ItemDouble  *innerItemManualLongitude;
  innerItemManualLongitude = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "Longitude" ), mManualLongitude, 0 );
  itemManualLongitude = new KConfigCompilerSignallingItem(innerItemManualLongitude, this, notifyFunction, signalManualLongitudeChanged);
  itemManualLongitude->setWriteFlags(KConfigBase::Notify);
  addItem( itemManualLongitude, QStringLiteral( "manualLongitude" ) );

  setCurrentGroup( QStringLiteral( "Times" ) );

  KConfigCompilerSignallingItem  *itemSunsetStart;
  KConfigSkeleton::ItemTime  *innerItemSunsetStart;
  innerItemSunsetStart = new KConfigSkeleton::ItemTime( currentGroup(), QStringLiteral( "SunsetStart" ), mSunsetStart, QTime(18, 0, 0) );
  itemSunsetStart = new KConfigCompilerSignallingItem(innerItemSunsetStart, this, notifyFunction, signalSunsetStartChanged);
  itemSunsetStart->setWriteFlags(KConfigBase::Notify);
  addItem( itemSunsetStart, QStringLiteral( "sunsetStart" ) );
  KConfigCompilerSignallingItem  *itemSunriseStart;
  KConfigSkeleton::ItemTime  *innerItemSunriseStart;
  innerItemSunriseStart = new KConfigSkeleton::ItemTime( currentGroup(), QStringLiteral( "SunriseStart" ), mSunriseStart, QTime(6, 0, 0) );
  itemSunriseStart = new KConfigCompilerSignallingItem(innerItemSunriseStart, this, notifyFunction, signalSunriseStartChanged);
  itemSunriseStart->setWriteFlags(KConfigBase::Notify);
  addItem( itemSunriseStart, QStringLiteral( "sunriseStart" ) );
  KConfigCompilerSignallingItem  *itemTransitionDuration;
  KConfigSkeleton::ItemUInt  *innerItemTransitionDuration;
  innerItemTransitionDuration = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "TransitionDuration" ), mTransitionDuration, 1800 );
  itemTransitionDuration = new KConfigCompilerSignallingItem(innerItemTransitionDuration, this, notifyFunction, signalTransitionDurationChanged);
  itemTransitionDuration->setWriteFlags(KConfigBase::Notify);
  addItem( itemTransitionDuration, QStringLiteral( "transitionDuration" ) );
}

NightTimeSettings::~NightTimeSettings()
{
}


void NightTimeSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalSourceChanged:
    Q_EMIT sourceChanged();
    break;
  case signalAutomaticLocationChanged:
    Q_EMIT automaticLocationChanged();
    break;
  case signalManualLatitudeChanged:
    Q_EMIT manualLatitudeChanged();
    break;
  case signalManualLongitudeChanged:
    Q_EMIT manualLongitudeChanged();
    break;
  case signalSunsetStartChanged:
    Q_EMIT sunsetStartChanged();
    break;
  case signalSunriseStartChanged:
    Q_EMIT sunriseStartChanged();
    break;
  case signalTransitionDurationChanged:
    Q_EMIT transitionDurationChanged();
    break;
  }
}
