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

#include <powerdevilcore_export.h>

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

#include <powerdevilenums.h>
#include <powerdevilsettingsdefaults.h>

namespace PowerDevil {

class POWERDEVILCORE_EXPORT GlobalSettings : public KConfigSkeleton
{
  Q_OBJECT
  public:

    GlobalSettings( bool CanSuspend, bool CanHibernate, QObject *parent = nullptr );
    ~GlobalSettings() override;

    /**
      Set pausePlayersOnSuspend
    */
    void setPausePlayersOnSuspend( bool v )
    {
      if (v != mPausePlayersOnSuspend && !isPausePlayersOnSuspendImmutable()) {
        mPausePlayersOnSuspend = v;
        Q_EMIT pausePlayersOnSuspendChanged();
      }
    }

    Q_PROPERTY(bool pausePlayersOnSuspend READ pausePlayersOnSuspend WRITE setPausePlayersOnSuspend NOTIFY pausePlayersOnSuspendChanged)
    Q_PROPERTY(bool isPausePlayersOnSuspendImmutable READ isPausePlayersOnSuspendImmutable CONSTANT)
    Q_PROPERTY(bool defaultPausePlayersOnSuspendValue READ defaultPausePlayersOnSuspendValue CONSTANT)
    /**
      Get pausePlayersOnSuspend
    */
    bool pausePlayersOnSuspend() const
    {
      return mPausePlayersOnSuspend;
    }

    /**
      Is pausePlayersOnSuspend Immutable
    */
    bool isPausePlayersOnSuspendImmutable() const
    {
      return isImmutable( QStringLiteral( "pausePlayersOnSuspend" ) );
    }

    /**
      Get pausePlayersOnSuspend default value
    */
    bool defaultPausePlayersOnSuspendValue() const
    {
        return defaultPausePlayersOnSuspendValue_helper();
    }

    /**
      Set BatteryLowLevel
    */
    void setBatteryLowLevel( int v )
    {
      if (v != mBatteryLowLevel && !isBatteryLowLevelImmutable()) {
        mBatteryLowLevel = v;
        Q_EMIT BatteryLowLevelChanged();
      }
    }

    Q_PROPERTY(int batteryLowLevel READ batteryLowLevel WRITE setBatteryLowLevel NOTIFY BatteryLowLevelChanged)
    Q_PROPERTY(bool isBatteryLowLevelImmutable READ isBatteryLowLevelImmutable CONSTANT)
    Q_PROPERTY(int defaultBatteryLowLevelValue READ defaultBatteryLowLevelValue CONSTANT)
    /**
      Get BatteryLowLevel
    */
    int batteryLowLevel() const
    {
      return mBatteryLowLevel;
    }

    /**
      Is BatteryLowLevel Immutable
    */
    bool isBatteryLowLevelImmutable() const
    {
      return isImmutable( QStringLiteral( "BatteryLowLevel" ) );
    }

    /**
      Get BatteryLowLevel default value
    */
    int defaultBatteryLowLevelValue() const
    {
        return defaultBatteryLowLevelValue_helper();
    }

    /**
      Set BatteryCriticalLevel
    */
    void setBatteryCriticalLevel( int v )
    {
      if (v != mBatteryCriticalLevel && !isBatteryCriticalLevelImmutable()) {
        mBatteryCriticalLevel = v;
        Q_EMIT BatteryCriticalLevelChanged();
      }
    }

    Q_PROPERTY(int batteryCriticalLevel READ batteryCriticalLevel WRITE setBatteryCriticalLevel NOTIFY BatteryCriticalLevelChanged)
    Q_PROPERTY(bool isBatteryCriticalLevelImmutable READ isBatteryCriticalLevelImmutable CONSTANT)
    Q_PROPERTY(int defaultBatteryCriticalLevelValue READ defaultBatteryCriticalLevelValue CONSTANT)
    /**
      Get BatteryCriticalLevel
    */
    int batteryCriticalLevel() const
    {
      return mBatteryCriticalLevel;
    }

    /**
      Is BatteryCriticalLevel Immutable
    */
    bool isBatteryCriticalLevelImmutable() const
    {
      return isImmutable( QStringLiteral( "BatteryCriticalLevel" ) );
    }

    /**
      Get BatteryCriticalLevel default value
    */
    int defaultBatteryCriticalLevelValue() const
    {
        return defaultBatteryCriticalLevelValue_helper();
    }

    /**
      Set BatteryCriticalAction
    */
    void setBatteryCriticalAction( uint v )
    {
      if (v != mBatteryCriticalAction && !isBatteryCriticalActionImmutable()) {
        mBatteryCriticalAction = v;
        Q_EMIT BatteryCriticalActionChanged();
      }
    }

    Q_PROPERTY(uint batteryCriticalAction READ batteryCriticalAction WRITE setBatteryCriticalAction NOTIFY BatteryCriticalActionChanged)
    Q_PROPERTY(bool isBatteryCriticalActionImmutable READ isBatteryCriticalActionImmutable CONSTANT)
    Q_PROPERTY(uint defaultBatteryCriticalActionValue READ defaultBatteryCriticalActionValue CONSTANT)
    /**
      Get BatteryCriticalAction
    */
    uint batteryCriticalAction() const
    {
      return mBatteryCriticalAction;
    }

    /**
      Is BatteryCriticalAction Immutable
    */
    bool isBatteryCriticalActionImmutable() const
    {
      return isImmutable( QStringLiteral( "BatteryCriticalAction" ) );
    }

    /**
      Get BatteryCriticalAction default value
    */
    uint defaultBatteryCriticalActionValue() const
    {
        return defaultBatteryCriticalActionValue_helper();
    }

    /**
      Set PeripheralBatteryLowLevel
    */
    void setPeripheralBatteryLowLevel( int v )
    {
      if (v != mPeripheralBatteryLowLevel && !isPeripheralBatteryLowLevelImmutable()) {
        mPeripheralBatteryLowLevel = v;
        Q_EMIT PeripheralBatteryLowLevelChanged();
      }
    }

    Q_PROPERTY(int peripheralBatteryLowLevel READ peripheralBatteryLowLevel WRITE setPeripheralBatteryLowLevel NOTIFY PeripheralBatteryLowLevelChanged)
    Q_PROPERTY(bool isPeripheralBatteryLowLevelImmutable READ isPeripheralBatteryLowLevelImmutable CONSTANT)
    Q_PROPERTY(int defaultPeripheralBatteryLowLevelValue READ defaultPeripheralBatteryLowLevelValue CONSTANT)
    /**
      Get PeripheralBatteryLowLevel
    */
    int peripheralBatteryLowLevel() const
    {
      return mPeripheralBatteryLowLevel;
    }

    /**
      Is PeripheralBatteryLowLevel Immutable
    */
    bool isPeripheralBatteryLowLevelImmutable() const
    {
      return isImmutable( QStringLiteral( "PeripheralBatteryLowLevel" ) );
    }

    /**
      Get PeripheralBatteryLowLevel default value
    */
    int defaultPeripheralBatteryLowLevelValue() const
    {
        return defaultPeripheralBatteryLowLevelValue_helper();
    }

    /**
      Set BlockedInhibitions
    */
    void setBlockedInhibitions( const QStringList & v )
    {
      if (v != mBlockedInhibitions && !isBlockedInhibitionsImmutable()) {
        mBlockedInhibitions = v;
        Q_EMIT BlockedInhibitionsChanged();
      }
    }

    Q_PROPERTY(QStringList blockedInhibitions READ blockedInhibitions WRITE setBlockedInhibitions NOTIFY BlockedInhibitionsChanged)
    Q_PROPERTY(bool isBlockedInhibitionsImmutable READ isBlockedInhibitionsImmutable CONSTANT)
    /**
      Get BlockedInhibitions
    */
    QStringList blockedInhibitions() const
    {
      return mBlockedInhibitions;
    }

    /**
      Is BlockedInhibitions Immutable
    */
    bool isBlockedInhibitionsImmutable() const
    {
      return isImmutable( QStringLiteral( "BlockedInhibitions" ) );
    }


    enum {
      signalPausePlayersOnSuspendChanged = 1,
      signalBatteryLowLevelChanged = 2,
      signalBatteryCriticalLevelChanged = 3,
      signalBatteryCriticalActionChanged = 4,
      signalPeripheralBatteryLowLevelChanged = 5,
      signalBlockedInhibitionsChanged = 6
    };

  Q_SIGNALS:
    void pausePlayersOnSuspendChanged();

    void BatteryLowLevelChanged();

    void BatteryCriticalLevelChanged();

    void BatteryCriticalActionChanged();

    void PeripheralBatteryLowLevelChanged();

    void BlockedInhibitionsChanged();

  private:
    void itemChanged(quint64 signalFlag);

  protected:
    bool mParamCanSuspend;
    bool mParamCanHibernate;

    // General
    bool mPausePlayersOnSuspend;
    bool defaultPausePlayersOnSuspendValue_helper() const;

    // BatteryManagement
    int mBatteryLowLevel;
    int defaultBatteryLowLevelValue_helper() const;
    int mBatteryCriticalLevel;
    int defaultBatteryCriticalLevelValue_helper() const;
    uint mBatteryCriticalAction;
    uint defaultBatteryCriticalActionValue_helper() const;
    int mPeripheralBatteryLowLevel;
    int defaultPeripheralBatteryLowLevelValue_helper() const;

    // Inhibitions
    QStringList mBlockedInhibitions;
    QStringList defaultBlockedInhibitionsValue_helper() const;
};

}

#endif

