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

#include "settings.h"

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

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

  return s_globalSettings()->q;
}

Settings::Settings( )
  : KConfigSkeleton( QStringLiteral( "ktikzrc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General Options" ) );

  KConfigSkeleton::ItemBool  *itemCommandsInDock;
  itemCommandsInDock = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "CommandsInDock" ), mCommandsInDock, false );
  addItem( itemCommandsInDock, QStringLiteral( "CommandsInDock" ) );
  KConfigSkeleton::ItemBool  *itemBuildAutomatically;
  itemBuildAutomatically = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "BuildAutomatically" ), mBuildAutomatically, true );
  addItem( itemBuildAutomatically, QStringLiteral( "BuildAutomatically" ) );
  KConfigSkeleton::ItemBool  *itemWatchFile;
  itemWatchFile = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "WatchFile" ), mWatchFile, true );
  addItem( itemWatchFile, QStringLiteral( "WatchFile" ) );
  KConfigSkeleton::ItemPath  *itemLatexCommand;
  itemLatexCommand = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "LatexCommand" ), mLatexCommand, QStringLiteral( "pdflatex" ) );
  addItem( itemLatexCommand, QStringLiteral( "LatexCommand" ) );
  KConfigSkeleton::ItemPath  *itemPdftopsCommand;
  itemPdftopsCommand = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "PdftopsCommand" ), mPdftopsCommand, QStringLiteral( "pdftops" ) );
  addItem( itemPdftopsCommand, QStringLiteral( "PdftopsCommand" ) );
  KConfigSkeleton::ItemPath  *itemTikzDocumentation;
  itemTikzDocumentation = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "TikzDocumentation" ), mTikzDocumentation );
  addItem( itemTikzDocumentation, QStringLiteral( "TikzDocumentation" ) );
  KConfigSkeleton::ItemBool  *itemUseShellEscaping;
  itemUseShellEscaping = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseShellEscaping" ), mUseShellEscaping, false );
  addItem( itemUseShellEscaping, QStringLiteral( "UseShellEscaping" ) );
  KConfigSkeleton::ItemPath  *itemTemplateFile;
  itemTemplateFile = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "TemplateFile" ), mTemplateFile );
  addItem( itemTemplateFile, QStringLiteral( "TemplateFile" ) );
  KConfigSkeleton::ItemPathList  *itemTemplateRecent;
  itemTemplateRecent = new KConfigSkeleton::ItemPathList( currentGroup(), QStringLiteral( "TemplateRecent" ), mTemplateRecent );
  addItem( itemTemplateRecent, QStringLiteral( "TemplateRecent" ) );
  KConfigSkeleton::ItemString  *itemTemplateReplaceText;
  itemTemplateReplaceText = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateReplaceText" ), mTemplateReplaceText, QStringLiteral( "<>" ) );
  addItem( itemTemplateReplaceText, QStringLiteral( "TemplateReplaceText" ) );
  KConfigSkeleton::ItemPath  *itemTemplateEditor;
  itemTemplateEditor = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "TemplateEditor" ), mTemplateEditor, QStringLiteral( "kwrite" ) );
  addItem( itemTemplateEditor, QStringLiteral( "TemplateEditor" ) );

  setCurrentGroup( QStringLiteral( "Editor" ) );

  KConfigSkeleton::ItemFont  *itemGeneralFont;
  itemGeneralFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "GeneralFont" ), mGeneralFont, QFontDatabase::systemFont( QFontDatabase::FixedFont ) );
  addItem( itemGeneralFont, QStringLiteral( "GeneralFont" ) );
  KConfigSkeleton::ItemBool  *itemShowWhiteSpaces;
  itemShowWhiteSpaces = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowWhiteSpaces" ), mShowWhiteSpaces, false );
  addItem( itemShowWhiteSpaces, QStringLiteral( "ShowWhiteSpaces" ) );
  KConfigSkeleton::ItemBool  *itemShowTabulators;
  itemShowTabulators = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowTabulators" ), mShowTabulators, false );
  addItem( itemShowTabulators, QStringLiteral( "ShowTabulators" ) );
  KConfigSkeleton::ItemBool  *itemShowMatchingBrackets;
  itemShowMatchingBrackets = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowMatchingBrackets" ), mShowMatchingBrackets, true );
  addItem( itemShowMatchingBrackets, QStringLiteral( "ShowMatchingBrackets" ) );
  KConfigSkeleton::ItemColor  *itemColorWhiteSpaces;
  itemColorWhiteSpaces = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "ColorWhiteSpaces" ), mColorWhiteSpaces, 0xB0B0B0 );
  addItem( itemColorWhiteSpaces, QStringLiteral( "ColorWhiteSpaces" ) );
  KConfigSkeleton::ItemColor  *itemColorTabulators;
  itemColorTabulators = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "ColorTabulators" ), mColorTabulators, 0xB0B0B0 );
  addItem( itemColorTabulators, QStringLiteral( "ColorTabulators" ) );
  KConfigSkeleton::ItemColor  *itemColorMatchingBrackets;
  itemColorMatchingBrackets = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "ColorMatchingBrackets" ), mColorMatchingBrackets, 0xC8C800 );
  addItem( itemColorMatchingBrackets, QStringLiteral( "ColorMatchingBrackets" ) );
  KConfigSkeleton::ItemBool  *itemUseCompletion;
  itemUseCompletion = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseCompletion" ), mUseCompletion, true );
  addItem( itemUseCompletion, QStringLiteral( "UseCompletion" ) );

  setCurrentGroup( QStringLiteral( "Highlighting" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuesCustomize;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Standard");
    valuesCustomize.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Custom");
    valuesCustomize.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemCustomize;
  itemCustomize = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "Customize" ), mCustomize, valuesCustomize, EnumCustomize::Standard );
  addItem( itemCustomize, QStringLiteral( "Customize" ) );

  setCurrentGroup( QStringLiteral( "Preview" ) );

  KConfigSkeleton::ItemDouble  *itemZoomFactor;
  itemZoomFactor = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "ZoomFactor" ), mZoomFactor, 1.0 );
  itemZoomFactor->setMinValue(0.1);
  itemZoomFactor->setMaxValue(6.0);
  addItem( itemZoomFactor, QStringLiteral( "ZoomFactor" ) );
}

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

