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

#include "windowviewconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

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

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

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

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

WindowViewConfig::WindowViewConfig( KSharedConfig::Ptr config )
  : KConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalWindowViewConfig()->q);
  s_globalWindowViewConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-windowview" ) );

  KConfigSkeleton::ItemInt  *itemLayoutMode;
  itemLayoutMode = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LayoutMode" ), mLayoutMode, 1 );
  addItem( itemLayoutMode, QStringLiteral( "LayoutMode" ) );
  KConfigSkeleton::ItemBool  *itemIgnoreMinimized;
  itemIgnoreMinimized = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "IgnoreMinimized" ), mIgnoreMinimized, false );
  addItem( itemIgnoreMinimized, QStringLiteral( "IgnoreMinimized" ) );
  QList<int> defaultBorderActivate;

  KConfigSkeleton::ItemIntList  *itemBorderActivate;
  itemBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivate" ), mBorderActivate, defaultBorderActivate );
  addItem( itemBorderActivate, QStringLiteral( "BorderActivate" ) );
  KConfigSkeleton::ItemIntList  *itemBorderActivateAll;
  itemBorderActivateAll = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivateAll" ), mBorderActivateAll, QList<int>() << int(ElectricTopLeft) );
  addItem( itemBorderActivateAll, QStringLiteral( "BorderActivateAll" ) );
  QList<int> defaultBorderActivateClass;

  KConfigSkeleton::ItemIntList  *itemBorderActivateClass;
  itemBorderActivateClass = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivateClass" ), mBorderActivateClass, defaultBorderActivateClass );
  addItem( itemBorderActivateClass, QStringLiteral( "BorderActivateClass" ) );
  QList<int> defaultBorderActivateClassCurrentDesktop;

  KConfigSkeleton::ItemIntList  *itemBorderActivateClassCurrentDesktop;
  itemBorderActivateClassCurrentDesktop = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivateClassCurrentDesktop" ), mBorderActivateClassCurrentDesktop, defaultBorderActivateClassCurrentDesktop );
  addItem( itemBorderActivateClassCurrentDesktop, QStringLiteral( "BorderActivateClassCurrentDesktop" ) );
  QList<int> defaultTouchBorderActivate;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivate;
  itemTouchBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivate" ), mTouchBorderActivate, defaultTouchBorderActivate );
  addItem( itemTouchBorderActivate, QStringLiteral( "TouchBorderActivate" ) );
  QList<int> defaultTouchBorderActivateAll;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivateAll;
  itemTouchBorderActivateAll = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivateAll" ), mTouchBorderActivateAll, defaultTouchBorderActivateAll );
  addItem( itemTouchBorderActivateAll, QStringLiteral( "TouchBorderActivateAll" ) );
  QList<int> defaultTouchBorderActivateClass;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivateClass;
  itemTouchBorderActivateClass = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivateClass" ), mTouchBorderActivateClass, defaultTouchBorderActivateClass );
  addItem( itemTouchBorderActivateClass, QStringLiteral( "TouchBorderActivateClass" ) );
  QList<int> defaultTouchBorderActivateClassCurrentDesktop;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivateClassCurrentDesktop;
  itemTouchBorderActivateClassCurrentDesktop = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivateClassCurrentDesktop" ), mTouchBorderActivateClassCurrentDesktop, defaultTouchBorderActivateClassCurrentDesktop );
  addItem( itemTouchBorderActivateClassCurrentDesktop, QStringLiteral( "TouchBorderActivateClassCurrentDesktop" ) );
}

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

