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

#include "prefs.h"

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

class PrefsHelper
{
  public:
    PrefsHelper() : q(0) {}
    ~PrefsHelper() { delete q; }
    Prefs *q;
};
Q_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
Prefs *Prefs::self()
{
  if (!s_globalPrefs()->q) {
    new Prefs;
    s_globalPrefs()->q->read();
  }

  return s_globalPrefs()->q;
}

Prefs::Prefs(  )
  : KConfigSkeleton( QLatin1String( "klettresrc" ) )
{
  Q_ASSERT(!s_globalPrefs()->q);
  s_globalPrefs()->q = this;
  setCurrentGroup( QLatin1String( "General" ) );

  KConfigSkeleton::ItemString  *itemLanguage;
  itemLanguage = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Language" ), mLanguage, QLatin1String( "en" ) );
  addItem( itemLanguage, QLatin1String( "Language" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesTheme;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QLatin1String("kid");
    valuesTheme.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QLatin1String("desert");
    valuesTheme.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QLatin1String("savannah");
    valuesTheme.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemTheme;
  itemTheme = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "myTheme" ), mTheme, valuesTheme, EnumTheme::kid );
  addItem( itemTheme, QLatin1String( "Theme" ) );
  KConfigSkeleton::ItemBool  *itemMenuBarBool;
  itemMenuBarBool = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "MenuBarBool" ), mMenuBarBool, true );
  addItem( itemMenuBarBool, QLatin1String( "MenuBarBool" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesMode;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QLatin1String("kid");
    valuesMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QLatin1String("grownup");
    valuesMode.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemMode;
  itemMode = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "myMode" ), mMode, valuesMode, EnumMode::grownup );
  addItem( itemMode, QLatin1String( "Mode" ) );
  KConfigSkeleton::ItemInt  *itemLevel;
  itemLevel = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "myLevel" ), mLevel, 1 );
  itemLevel->setMinValue(1);
  itemLevel->setMaxValue(4);
  addItem( itemLevel, QLatin1String( "Level" ) );
  KConfigSkeleton::ItemInt  *itemKidTimer;
  itemKidTimer = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "KidTimer" ), mKidTimer, 4 );
  addItem( itemKidTimer, QLatin1String( "KidTimer" ) );
  KConfigSkeleton::ItemInt  *itemGrownTimer;
  itemGrownTimer = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "GrownTimer" ), mGrownTimer, 2 );
  addItem( itemGrownTimer, QLatin1String( "GrownTimer" ) );

  setCurrentGroup( QLatin1String( "mFont" ) );

QFont defaultFont = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
            defaultFont.setPointSize(48);
            defaultFont.setBold(true);
      
  KConfigSkeleton::ItemFont  *itemFont;
  itemFont = new KConfigSkeleton::ItemFont( currentGroup(), QLatin1String( "mFont" ), mFont, defaultFont );
  addItem( itemFont, QLatin1String( "Font" ) );
}

Prefs::~Prefs()
{
  s_globalPrefs()->q = 0;
}

