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

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

class NightTimeSettings : public KConfigSkeleton
{
  Q_OBJECT
  public:
    enum Source { Location, Times };
    Q_ENUM(Source)

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

    /**
      Set Source
    */
    void setSource( int v )
    {
      if (v != mSource && !isSourceImmutable()) {
        mSource = v;
        Q_EMIT sourceChanged();
      }
    }

    Q_PROPERTY(int source READ source WRITE setSource NOTIFY sourceChanged)
    Q_PROPERTY(bool isSourceImmutable READ isSourceImmutable CONSTANT)
    /**
      Get Source
    */
    int source() const
    {
      return mSource;
    }

    /**
      Is Source Immutable
    */
    bool isSourceImmutable() const
    {
      return isImmutable( QStringLiteral( "source" ) );
    }

    /**
      Set Automatic
    */
    void setAutomaticLocation( bool v )
    {
      if (v != mAutomaticLocation && !isAutomaticLocationImmutable()) {
        mAutomaticLocation = v;
        Q_EMIT automaticLocationChanged();
      }
    }

    Q_PROPERTY(bool automaticLocation READ automaticLocation WRITE setAutomaticLocation NOTIFY automaticLocationChanged)
    Q_PROPERTY(bool isAutomaticLocationImmutable READ isAutomaticLocationImmutable CONSTANT)
    /**
      Get Automatic
    */
    bool automaticLocation() const
    {
      return mAutomaticLocation;
    }

    /**
      Is Automatic Immutable
    */
    bool isAutomaticLocationImmutable() const
    {
      return isImmutable( QStringLiteral( "automaticLocation" ) );
    }

    /**
      Set Latitude
    */
    void setManualLatitude( double v )
    {
      if (v != mManualLatitude && !isManualLatitudeImmutable()) {
        mManualLatitude = v;
        Q_EMIT manualLatitudeChanged();
      }
    }

    Q_PROPERTY(double manualLatitude READ manualLatitude WRITE setManualLatitude NOTIFY manualLatitudeChanged)
    Q_PROPERTY(bool isManualLatitudeImmutable READ isManualLatitudeImmutable CONSTANT)
    /**
      Get Latitude
    */
    double manualLatitude() const
    {
      return mManualLatitude;
    }

    /**
      Is Latitude Immutable
    */
    bool isManualLatitudeImmutable() const
    {
      return isImmutable( QStringLiteral( "manualLatitude" ) );
    }

    /**
      Set Longitude
    */
    void setManualLongitude( double v )
    {
      if (v != mManualLongitude && !isManualLongitudeImmutable()) {
        mManualLongitude = v;
        Q_EMIT manualLongitudeChanged();
      }
    }

    Q_PROPERTY(double manualLongitude READ manualLongitude WRITE setManualLongitude NOTIFY manualLongitudeChanged)
    Q_PROPERTY(bool isManualLongitudeImmutable READ isManualLongitudeImmutable CONSTANT)
    /**
      Get Longitude
    */
    double manualLongitude() const
    {
      return mManualLongitude;
    }

    /**
      Is Longitude Immutable
    */
    bool isManualLongitudeImmutable() const
    {
      return isImmutable( QStringLiteral( "manualLongitude" ) );
    }

    /**
      Set SunsetStart
    */
    void setSunsetStart( QTime v )
    {
      if (v != mSunsetStart && !isSunsetStartImmutable()) {
        mSunsetStart = v;
        Q_EMIT sunsetStartChanged();
      }
    }

    Q_PROPERTY(QTime sunsetStart READ sunsetStart WRITE setSunsetStart NOTIFY sunsetStartChanged)
    Q_PROPERTY(bool isSunsetStartImmutable READ isSunsetStartImmutable CONSTANT)
    /**
      Get SunsetStart
    */
    QTime sunsetStart() const
    {
      return mSunsetStart;
    }

    /**
      Is SunsetStart Immutable
    */
    bool isSunsetStartImmutable() const
    {
      return isImmutable( QStringLiteral( "sunsetStart" ) );
    }

    /**
      Set SunriseStart
    */
    void setSunriseStart( QTime v )
    {
      if (v != mSunriseStart && !isSunriseStartImmutable()) {
        mSunriseStart = v;
        Q_EMIT sunriseStartChanged();
      }
    }

    Q_PROPERTY(QTime sunriseStart READ sunriseStart WRITE setSunriseStart NOTIFY sunriseStartChanged)
    Q_PROPERTY(bool isSunriseStartImmutable READ isSunriseStartImmutable CONSTANT)
    /**
      Get SunriseStart
    */
    QTime sunriseStart() const
    {
      return mSunriseStart;
    }

    /**
      Is SunriseStart Immutable
    */
    bool isSunriseStartImmutable() const
    {
      return isImmutable( QStringLiteral( "sunriseStart" ) );
    }

    /**
      Set TransitionDuration
    */
    void setTransitionDuration( uint v )
    {
      if (v != mTransitionDuration && !isTransitionDurationImmutable()) {
        mTransitionDuration = v;
        Q_EMIT transitionDurationChanged();
      }
    }

    Q_PROPERTY(uint transitionDuration READ transitionDuration WRITE setTransitionDuration NOTIFY transitionDurationChanged)
    Q_PROPERTY(bool isTransitionDurationImmutable READ isTransitionDurationImmutable CONSTANT)
    /**
      Get TransitionDuration
    */
    uint transitionDuration() const
    {
      return mTransitionDuration;
    }

    /**
      Is TransitionDuration Immutable
    */
    bool isTransitionDurationImmutable() const
    {
      return isImmutable( QStringLiteral( "transitionDuration" ) );
    }


    enum {
      signalSourceChanged = 1,
      signalAutomaticLocationChanged = 2,
      signalManualLatitudeChanged = 3,
      signalManualLongitudeChanged = 4,
      signalSunsetStartChanged = 5,
      signalSunriseStartChanged = 6,
      signalTransitionDurationChanged = 7
    };

  Q_SIGNALS:
    void sourceChanged();

    void automaticLocationChanged();

    void manualLatitudeChanged();

    void manualLongitudeChanged();

    void sunsetStartChanged();

    void sunriseStartChanged();

    void transitionDurationChanged();

  private:
    void itemChanged(quint64 signalFlag);

  protected:

    // General
    int mSource;

    // Location
    bool mAutomaticLocation;
    double mManualLatitude;
    double mManualLongitude;

    // Times
    QTime mSunsetStart;
    QTime mSunriseStart;
    uint mTransitionDuration;
};

#endif

