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

#include "settings.h"

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

class SettingsHelper
{
  public:
    SettingsHelper() noexcept : q(nullptr) {}
    ~SettingsHelper() noexcept { 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( "kmplotrc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Coordinate System" ) );

  KConfigSkeleton::ItemDouble  *itemAxesLineWidth;
  itemAxesLineWidth = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "AxesLineWidth" ), mAxesLineWidth, 0.2 );
  addItem( itemAxesLineWidth, QStringLiteral( "AxesLineWidth" ) );
  KConfigSkeleton::ItemBool  *itemShowLabel;
  itemShowLabel = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowLabel" ), mShowLabel, true );
  addItem( itemShowLabel, QStringLiteral( "ShowLabel" ) );
  KConfigSkeleton::ItemBool  *itemShowAxes;
  itemShowAxes = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowAxes" ), mShowAxes, true );
  addItem( itemShowAxes, QStringLiteral( "ShowAxes" ) );
  KConfigSkeleton::ItemBool  *itemShowArrows;
  itemShowArrows = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowArrows" ), mShowArrows, true );
  addItem( itemShowArrows, QStringLiteral( "ShowArrows" ) );
  KConfigSkeleton::ItemDouble  *itemGridLineWidth;
  itemGridLineWidth = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "GridLineWidth" ), mGridLineWidth, 0.1 );
  addItem( itemGridLineWidth, QStringLiteral( "GridLineWidth" ) );
  KConfigSkeleton::ItemInt  *itemGridStyle;
  itemGridStyle = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "GridStyle" ), mGridStyle, 1 );
  addItem( itemGridStyle, QStringLiteral( "GridStyle" ) );
  KConfigSkeleton::ItemDouble  *itemTicLength;
  itemTicLength = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "TicLength" ), mTicLength, 0.5 );
  addItem( itemTicLength, QStringLiteral( "TicLength" ) );
  KConfigSkeleton::ItemDouble  *itemTicWidth;
  itemTicWidth = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "TicWidth" ), mTicWidth, 0.3 );
  addItem( itemTicWidth, QStringLiteral( "TicWidth" ) );
  KConfigSkeleton::ItemString  *itemXMin;
  itemXMin = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "XMin" ), mXMin, QStringLiteral( "-8" ) );
  addItem( itemXMin, QStringLiteral( "XMin" ) );
  KConfigSkeleton::ItemString  *itemXMax;
  itemXMax = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "XMax" ), mXMax, QStringLiteral( "8" ) );
  addItem( itemXMax, QStringLiteral( "XMax" ) );
  KConfigSkeleton::ItemString  *itemYMin;
  itemYMin = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "YMin" ), mYMin, QStringLiteral( "-8" ) );
  addItem( itemYMin, QStringLiteral( "YMin" ) );
  KConfigSkeleton::ItemString  *itemYMax;
  itemYMax = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "YMax" ), mYMax, QStringLiteral( "8" ) );
  addItem( itemYMax, QStringLiteral( "YMax" ) );
  KConfigSkeleton::ItemString  *itemLabelHorizontalAxis;
  itemLabelHorizontalAxis = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "LabelHorizontalAxis" ), mLabelHorizontalAxis, QStringLiteral( "X" ) );
  addItem( itemLabelHorizontalAxis, QStringLiteral( "LabelHorizontalAxis" ) );
  KConfigSkeleton::ItemString  *itemLabelVerticalAxis;
  itemLabelVerticalAxis = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "LabelVerticalAxis" ), mLabelVerticalAxis, QStringLiteral( "Y" ) );
  addItem( itemLabelVerticalAxis, QStringLiteral( "LabelVerticalAxis" ) );

  setCurrentGroup( QStringLiteral( "Scaling" ) );

  KConfigSkeleton::ItemInt  *itemXScalingMode;
  itemXScalingMode = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "XScalingMode" ), mXScalingMode, 0 );
  addItem( itemXScalingMode, QStringLiteral( "XScalingMode" ) );
  KConfigSkeleton::ItemInt  *itemYScalingMode;
  itemYScalingMode = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "YScalingMode" ), mYScalingMode, 0 );
  addItem( itemYScalingMode, QStringLiteral( "YScalingMode" ) );
  KConfigSkeleton::ItemString  *itemXScaling;
  itemXScaling = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "XScaling" ), mXScaling, QStringLiteral( "1" ) );
  addItem( itemXScaling, QStringLiteral( "XScaling" ) );
  KConfigSkeleton::ItemString  *itemYScaling;
  itemYScaling = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "YScaling" ), mYScaling, QStringLiteral( "1" ) );
  addItem( itemYScaling, QStringLiteral( "YScaling" ) );

  setCurrentGroup( QStringLiteral( "Fonts" ) );

  KConfigSkeleton::ItemFont  *itemAxesFont;
  itemAxesFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "AxesFont" ), mAxesFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  addItem( itemAxesFont, QStringLiteral( "AxesFont" ) );
  KConfigSkeleton::ItemFont  *itemHeaderTableFont;
  itemHeaderTableFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "HeaderTableFont" ), mHeaderTableFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  addItem( itemHeaderTableFont, QStringLiteral( "HeaderTableFont" ) );
  KConfigSkeleton::ItemFont  *itemLabelFont;
  itemLabelFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "LabelFont" ), mLabelFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  addItem( itemLabelFont, QStringLiteral( "LabelFont" ) );

  setCurrentGroup( QStringLiteral( "Colors" ) );

  KConfigSkeleton::ItemColor  *itemAxesColor;
  itemAxesColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "AxesColor" ), mAxesColor, QColor( "#282828" ) );
  addItem( itemAxesColor, QStringLiteral( "AxesColor" ) );
  KConfigSkeleton::ItemColor  *itemGridColor;
  itemGridColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "GridColor" ), mGridColor, QColor( "#AEAEAE" ) );
  addItem( itemGridColor, QStringLiteral( "GridColor" ) );
  KConfigSkeleton::ItemColor  *itemColor0;
  itemColor0 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color0" ), mColor0, QColor( "#191970" ) );
  addItem( itemColor0, QStringLiteral( "Color0" ) );
  KConfigSkeleton::ItemColor  *itemColor1;
  itemColor1 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color1" ), mColor1, QColor( "#006400" ) );
  addItem( itemColor1, QStringLiteral( "Color1" ) );
  KConfigSkeleton::ItemColor  *itemColor2;
  itemColor2 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color2" ), mColor2, QColor( "#FF4500" ) );
  addItem( itemColor2, QStringLiteral( "Color2" ) );
  KConfigSkeleton::ItemColor  *itemColor3;
  itemColor3 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color3" ), mColor3, QColor( "#808000" ) );
  addItem( itemColor3, QStringLiteral( "Color3" ) );
  KConfigSkeleton::ItemColor  *itemColor4;
  itemColor4 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color4" ), mColor4, QColor( "#FF1493" ) );
  addItem( itemColor4, QStringLiteral( "Color4" ) );
  KConfigSkeleton::ItemColor  *itemColor5;
  itemColor5 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color5" ), mColor5, QColor( "#B111DD" ) );
  addItem( itemColor5, QStringLiteral( "Color5" ) );
  KConfigSkeleton::ItemColor  *itemColor6;
  itemColor6 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color6" ), mColor6, QColor( "#800000" ) );
  addItem( itemColor6, QStringLiteral( "Color6" ) );
  KConfigSkeleton::ItemColor  *itemColor7;
  itemColor7 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color7" ), mColor7, QColor( "#0000CD" ) );
  addItem( itemColor7, QStringLiteral( "Color7" ) );
  KConfigSkeleton::ItemColor  *itemColor8;
  itemColor8 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color8" ), mColor8, QColor( "#FF8C00" ) );
  addItem( itemColor8, QStringLiteral( "Color8" ) );
  KConfigSkeleton::ItemColor  *itemColor9;
  itemColor9 = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color9" ), mColor9, QColor( "#3CB400" ) );
  addItem( itemColor9, QStringLiteral( "Color9" ) );

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemInt  *itemAnglemode;
  itemAnglemode = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "anglemode" ), mAnglemode, 0 );
  addItem( itemAnglemode, QStringLiteral( "anglemode" ) );
  KConfigSkeleton::ItemColor  *itemBackgroundcolor;
  itemBackgroundcolor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "backgroundcolor" ), mBackgroundcolor, QColor( "#FFFFFF" ) );
  addItem( itemBackgroundcolor, QStringLiteral( "backgroundcolor" ) );
  KConfigSkeleton::ItemInt  *itemZoomInStep;
  itemZoomInStep = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "zoomInStep" ), mZoomInStep, 20 );
  addItem( itemZoomInStep, QStringLiteral( "zoomInStep" ) );
  KConfigSkeleton::ItemInt  *itemZoomOutStep;
  itemZoomOutStep = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "zoomOutStep" ), mZoomOutStep, 25 );
  addItem( itemZoomOutStep, QStringLiteral( "zoomOutStep" ) );
  KConfigSkeleton::ItemBool  *itemDetailedTracing;
  itemDetailedTracing = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DetailedTracing" ), mDetailedTracing, false );
  addItem( itemDetailedTracing, QStringLiteral( "DetailedTracing" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesDefaultEquationForm;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Function");
    valuesDefaultEquationForm.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Implicit");
    valuesDefaultEquationForm.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemDefaultEquationForm;
  itemDefaultEquationForm = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "DefaultEquationForm" ), mDefaultEquationForm, valuesDefaultEquationForm, EnumDefaultEquationForm::Function );
  addItem( itemDefaultEquationForm, QStringLiteral( "DefaultEquationForm" ) );
}

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

