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

#include "flipswitchconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

class FlipSwitchConfigHelper
{
  public:
    FlipSwitchConfigHelper() : q(nullptr) {}
    ~FlipSwitchConfigHelper() { delete q; }
    FlipSwitchConfigHelper(const FlipSwitchConfigHelper&) = delete;
    FlipSwitchConfigHelper& operator=(const FlipSwitchConfigHelper&) = delete;
    FlipSwitchConfig *q;
};
}

Q_GLOBAL_STATIC(FlipSwitchConfigHelper, s_globalFlipSwitchConfig)
FlipSwitchConfig *FlipSwitchConfig::self()
{
  if (!s_globalFlipSwitchConfig()->q)
     qFatal("you need to call FlipSwitchConfig::instance before using");
  return s_globalFlipSwitchConfig()->q;
}

void FlipSwitchConfig::instance(const QString& cfgfilename)
{
  if (s_globalFlipSwitchConfig()->q) {
     qDebug() << "FlipSwitchConfig::instance called after the first use - ignoring";
     return;
  }
  new FlipSwitchConfig(KSharedConfig::openConfig(cfgfilename));
  s_globalFlipSwitchConfig()->q->read();
}

void FlipSwitchConfig::instance(KSharedConfig::Ptr config)
{
  if (s_globalFlipSwitchConfig()->q) {
     qDebug() << "FlipSwitchConfig::instance called after the first use - ignoring";
     return;
  }
  new FlipSwitchConfig(config);
  s_globalFlipSwitchConfig()->q->read();
}

FlipSwitchConfig::FlipSwitchConfig(  KSharedConfig::Ptr config  )
  : KConfigSkeleton( config )
{
  Q_ASSERT(!s_globalFlipSwitchConfig()->q);
  s_globalFlipSwitchConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-FlipSwitch" ) );

  KConfigSkeleton::ItemBool  *itemTabBox;
  itemTabBox = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TabBox" ), mTabBox, false );
  addItem( itemTabBox, QStringLiteral( "TabBox" ) );
  KConfigSkeleton::ItemBool  *itemTabBoxAlternative;
  itemTabBoxAlternative = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TabBoxAlternative" ), mTabBoxAlternative, false );
  addItem( itemTabBoxAlternative, QStringLiteral( "TabBoxAlternative" ) );
  KConfigSkeleton::ItemInt  *itemDuration;
  itemDuration = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Duration" ), mDuration, 0 );
  addItem( itemDuration, QStringLiteral( "Duration" ) );
  KConfigSkeleton::ItemInt  *itemAngle;
  itemAngle = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Angle" ), mAngle, 30 );
  addItem( itemAngle, QStringLiteral( "Angle" ) );
  KConfigSkeleton::ItemInt  *itemXPosition;
  itemXPosition = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "XPosition" ), mXPosition, 33 );
  addItem( itemXPosition, QStringLiteral( "XPosition" ) );
  KConfigSkeleton::ItemInt  *itemYPosition;
  itemYPosition = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "YPosition" ), mYPosition, 100 );
  addItem( itemYPosition, QStringLiteral( "YPosition" ) );
  KConfigSkeleton::ItemBool  *itemWindowTitle;
  itemWindowTitle = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "WindowTitle" ), mWindowTitle, true );
  addItem( itemWindowTitle, QStringLiteral( "WindowTitle" ) );
}

FlipSwitchConfig::~FlipSwitchConfig()
{
  s_globalFlipSwitchConfig()->q = nullptr;
}

