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

#include "kscreensaversettingsbase.h"

#include <qglobal.h>
#include <QFile>

class KScreenSaverSettingsBaseHelper
{
  public:
    KScreenSaverSettingsBaseHelper() : q(nullptr) {}
    ~KScreenSaverSettingsBaseHelper() { delete q; q = nullptr; }
    KScreenSaverSettingsBaseHelper(const KScreenSaverSettingsBaseHelper&) = delete;
    KScreenSaverSettingsBaseHelper& operator=(const KScreenSaverSettingsBaseHelper&) = delete;
    KScreenSaverSettingsBase *q;
};
Q_GLOBAL_STATIC(KScreenSaverSettingsBaseHelper, s_globalKScreenSaverSettingsBase)
KScreenSaverSettingsBase *KScreenSaverSettingsBase::self()
{
  if (!s_globalKScreenSaverSettingsBase()->q) {
    new KScreenSaverSettingsBase;
    s_globalKScreenSaverSettingsBase()->q->read();
  }

  return s_globalKScreenSaverSettingsBase()->q;
}

KScreenSaverSettingsBase::KScreenSaverSettingsBase( )
  : KConfigSkeleton( QStringLiteral( "kscreenlockerrc" ) )
{
  Q_ASSERT(!s_globalKScreenSaverSettingsBase()->q);
  s_globalKScreenSaverSettingsBase()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&KScreenSaverSettingsBase::itemChanged);

  setCurrentGroup( QStringLiteral( "Daemon" ) );

  KConfigCompilerSignallingItem  *itemAutolock;
  KConfigSkeleton::ItemBool  *innerItemAutolock;
  innerItemAutolock = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Autolock" ), mAutolock, true );
  itemAutolock = new KConfigCompilerSignallingItem(innerItemAutolock, this, notifyFunction, signalAutolockChanged);
  addItem( itemAutolock, QStringLiteral( "Autolock" ) );
  KConfigCompilerSignallingItem  *itemTimeout;
  KConfigSkeleton::ItemDouble  *innerItemTimeout;
  innerItemTimeout = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "Timeout" ), mTimeout, 5 );
  itemTimeout = new KConfigCompilerSignallingItem(innerItemTimeout, this, notifyFunction, signalTimeoutChanged);
  addItem( itemTimeout, QStringLiteral( "Timeout" ) );
  KConfigCompilerSignallingItem  *itemLock;
  KConfigSkeleton::ItemBool  *innerItemLock;
  innerItemLock = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Lock" ), mLock, true );
  itemLock = new KConfigCompilerSignallingItem(innerItemLock, this, notifyFunction, signalLockChanged);
  addItem( itemLock, QStringLiteral( "Lock" ) );
  KConfigCompilerSignallingItem  *itemLockGrace;
  KConfigSkeleton::ItemInt  *innerItemLockGrace;
  innerItemLockGrace = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LockGrace" ), mLockGrace, 5 );
  itemLockGrace = new KConfigCompilerSignallingItem(innerItemLockGrace, this, notifyFunction, signalLockGraceChanged);
  addItem( itemLockGrace, QStringLiteral( "LockGrace" ) );
  KConfigCompilerSignallingItem  *itemRequirePassword;
  KConfigSkeleton::ItemBool  *innerItemRequirePassword;
  innerItemRequirePassword = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RequirePassword" ), mRequirePassword, true );
  itemRequirePassword = new KConfigCompilerSignallingItem(innerItemRequirePassword, this, notifyFunction, signalRequirePasswordChanged);
  addItem( itemRequirePassword, QStringLiteral( "RequirePassword" ) );
  KConfigCompilerSignallingItem  *itemLockOnResume;
  KConfigSkeleton::ItemBool  *innerItemLockOnResume;
  innerItemLockOnResume = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "LockOnResume" ), mLockOnResume, true );
  itemLockOnResume = new KConfigCompilerSignallingItem(innerItemLockOnResume, this, notifyFunction, signalLockOnResumeChanged);
  addItem( itemLockOnResume, QStringLiteral( "LockOnResume" ) );
  KConfigCompilerSignallingItem  *itemLockOnStart;
  KConfigSkeleton::ItemBool  *innerItemLockOnStart;
  innerItemLockOnStart = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "LockOnStart" ), mLockOnStart, false );
  itemLockOnStart = new KConfigCompilerSignallingItem(innerItemLockOnStart, this, notifyFunction, signalLockOnStartChanged);
  addItem( itemLockOnStart, QStringLiteral( "LockOnStart" ) );

  setCurrentGroup( QStringLiteral( "Greeter" ) );

  KConfigCompilerSignallingItem  *itemTheme;
  KConfigSkeleton::ItemString  *innerItemTheme;
  innerItemTheme = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Theme" ), mTheme );
  itemTheme = new KConfigCompilerSignallingItem(innerItemTheme, this, notifyFunction, signalThemeChanged);
  addItem( itemTheme, QStringLiteral( "Theme" ) );
  KConfigCompilerSignallingItem  *itemWallpaperPluginId;
  KConfigSkeleton::ItemString  *innerItemWallpaperPluginId;
  innerItemWallpaperPluginId = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "WallpaperPlugin" ), mWallpaperPluginId, QStringLiteral( "org.kde.image" ) );
  itemWallpaperPluginId = new KConfigCompilerSignallingItem(innerItemWallpaperPluginId, this, notifyFunction, signalWallpaperPluginIdChanged);
  addItem( itemWallpaperPluginId, QStringLiteral( "wallpaperPluginId" ) );
}

KScreenSaverSettingsBase::~KScreenSaverSettingsBase()
{
  if (s_globalKScreenSaverSettingsBase.exists() && !s_globalKScreenSaverSettingsBase.isDestroyed()) {
    s_globalKScreenSaverSettingsBase()->q = nullptr;
  }
}


void KScreenSaverSettingsBase::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalAutolockChanged:
    Q_EMIT AutolockChanged();
    break;
  case signalTimeoutChanged:
    Q_EMIT TimeoutChanged();
    break;
  case signalLockChanged:
    Q_EMIT LockChanged();
    break;
  case signalLockGraceChanged:
    Q_EMIT LockGraceChanged();
    break;
  case signalRequirePasswordChanged:
    Q_EMIT RequirePasswordChanged();
    break;
  case signalLockOnResumeChanged:
    Q_EMIT LockOnResumeChanged();
    break;
  case signalLockOnStartChanged:
    Q_EMIT LockOnStartChanged();
    break;
  case signalThemeChanged:
    Q_EMIT ThemeChanged();
    break;
  case signalWallpaperPluginIdChanged:
    Q_EMIT wallpaperPluginIdChanged();
    break;
  }
}
