// This file is generated by kconfig_compiler_kf5 from yakuake.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( "yakuakerc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Window" ) );

  mScreenItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Screen" ), mScreen, 0 );
  addItem( mScreenItem, QStringLiteral( "Screen" ) );
  mWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Width" ), mWidth, 90 );
  mWidthItem->setMinValue(10);
  mWidthItem->setMaxValue(100);
  addItem( mWidthItem, QStringLiteral( "Width" ) );
  mHeightItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Height" ), mHeight, 50 );
  mHeightItem->setMinValue(10);
  mHeightItem->setMaxValue(100);
  addItem( mHeightItem, QStringLiteral( "Height" ) );
  mPositionItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Position" ), mPosition, 50 );
  mPositionItem->setMinValue(0);
  mPositionItem->setMaxValue(100);
  addItem( mPositionItem, QStringLiteral( "Position" ) );
  mShowOnAllDesktopsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowOnAllDesktops" ), mShowOnAllDesktops, true );
  addItem( mShowOnAllDesktopsItem, QStringLiteral( "ShowOnAllDesktops" ) );
  mKeepOpenItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "KeepOpen" ), mKeepOpen, true );
  addItem( mKeepOpenItem, QStringLiteral( "KeepOpen" ) );
  mKeepOpenAfterLastSessionClosesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "KeepOpenAfterLastSessionCloses" ), mKeepOpenAfterLastSessionCloses, false );
  addItem( mKeepOpenAfterLastSessionClosesItem, QStringLiteral( "KeepOpenAfterLastSessionCloses" ) );
  mToggleToFocusItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ToggleToFocus" ), mToggleToFocus, false );
  addItem( mToggleToFocusItem, QStringLiteral( "ToggleToFocus" ) );
  mKeepAboveItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "KeepAbove" ), mKeepAbove, true );
  addItem( mKeepAboveItem, QStringLiteral( "KeepAbove" ) );
  mShowTitleBarItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowTitleBar" ), mShowTitleBar, true );
  addItem( mShowTitleBarItem, QStringLiteral( "ShowTitleBar" ) );
  mShowTabBarItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowTabBar" ), mShowTabBar, true );
  addItem( mShowTabBarItem, QStringLiteral( "ShowTabBar" ) );
  mDynamicTabTitlesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DynamicTabTitles" ), mDynamicTabTitles, false );
  addItem( mDynamicTabTitlesItem, QStringLiteral( "DynamicTabTitles" ) );
  mShowSystrayIconItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowSystrayIcon" ), mShowSystrayIcon, true );
  addItem( mShowSystrayIconItem, QStringLiteral( "ShowSystrayIcon" ) );

  setCurrentGroup( QStringLiteral( "Behavior" ) );

  mFocusFollowsMouseItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FocusFollowsMouse" ), mFocusFollowsMouse, false );
  addItem( mFocusFollowsMouseItem, QStringLiteral( "FocusFollowsMouse" ) );
  mOpenAfterStartItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "OpenAfterStart" ), mOpenAfterStart, false );
  addItem( mOpenAfterStartItem, QStringLiteral( "OpenAfterStart" ) );
  mRememberFullscreenItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RememberFullscreen" ), mRememberFullscreen, false );
  addItem( mRememberFullscreenItem, QStringLiteral( "RememberFullscreen" ) );

  setCurrentGroup( QStringLiteral( "Appearance" ) );

  mBlurItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Blur" ), mBlur, false );
  addItem( mBlurItem, QStringLiteral( "Blur" ) );
  mSkinItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Skin" ), mSkin, QStringLiteral( "default" ) );
  addItem( mSkinItem, QStringLiteral( "Skin" ) );
  mSkinInstalledWithKnsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SkinInstalledWithKns" ), mSkinInstalledWithKns, false );
  addItem( mSkinInstalledWithKnsItem, QStringLiteral( "SkinInstalledWithKns" ) );
  mTranslucencyItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Translucency" ), mTranslucency, false );
  addItem( mTranslucencyItem, QStringLiteral( "Translucency" ) );
  mBackgroundColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "BackgroundColor" ), mBackgroundColor, QColor( "#000000" ) );
  addItem( mBackgroundColorItem, QStringLiteral( "BackgroundColor" ) );
  mBackgroundColorOpacityItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "BackgroundColorOpacity" ), mBackgroundColorOpacity, 50 );
  mBackgroundColorOpacityItem->setMinValue(0);
  mBackgroundColorOpacityItem->setMaxValue(100);
  addItem( mBackgroundColorOpacityItem, QStringLiteral( "BackgroundColorOpacity" ) );
  mTerminalHighlightOnManualActivationItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TerminalHighlightOnManualActivation" ), mTerminalHighlightOnManualActivation, false );
  addItem( mTerminalHighlightOnManualActivationItem, QStringLiteral( "TerminalHighlightOnManualActivation" ) );
  mHideSkinBordersItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "HideSkinBorders" ), mHideSkinBorders, false );
  addItem( mHideSkinBordersItem, QStringLiteral( "HideSkinBorders" ) );
  mTerminalHighlightOpacityItem = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "TerminalHighlightOpacity" ), mTerminalHighlightOpacity, 0.4 );
  mTerminalHighlightOpacityItem->setMinValue(0);
  mTerminalHighlightOpacityItem->setMaxValue(1.0);
  addItem( mTerminalHighlightOpacityItem, QStringLiteral( "TerminalHighlightOpacity" ) );
  mTerminalHighlightDurationItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "TerminalHighlightDuration" ), mTerminalHighlightDuration, 250 );
  mTerminalHighlightDurationItem->setMinValue(0);
  mTerminalHighlightDurationItem->setMaxValue(86400000);
  addItem( mTerminalHighlightDurationItem, QStringLiteral( "TerminalHighlightDuration" ) );
  mKeyboardInputBlockIndicatorColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "KeyboardInputBlockIndicatorColor" ), mKeyboardInputBlockIndicatorColor, QColor( "#FF0000" ) );
  addItem( mKeyboardInputBlockIndicatorColorItem, QStringLiteral( "KeyboardInputBlockIndicatorColor" ) );
  mKeyboardInputBlockIndicatorOpacityItem = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "KeyboardInputBlockIndicatorOpacity" ), mKeyboardInputBlockIndicatorOpacity, 0.5 );
  mKeyboardInputBlockIndicatorOpacityItem->setMinValue(0);
  mKeyboardInputBlockIndicatorOpacityItem->setMaxValue(1.0);
  addItem( mKeyboardInputBlockIndicatorOpacityItem, QStringLiteral( "KeyboardInputBlockIndicatorOpacity" ) );
  mKeyboardInputBlockIndicatorDurationItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "KeyboardInputBlockIndicatorDuration" ), mKeyboardInputBlockIndicatorDuration, 250 );
  mKeyboardInputBlockIndicatorDurationItem->setMinValue(0);
  mKeyboardInputBlockIndicatorDurationItem->setMaxValue(86400000);
  addItem( mKeyboardInputBlockIndicatorDurationItem, QStringLiteral( "KeyboardInputBlockIndicatorDuration" ) );

  setCurrentGroup( QStringLiteral( "Animation" ) );

  mUseWMAssistItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseWMAssist" ), mUseWMAssist, true );
  addItem( mUseWMAssistItem, QStringLiteral( "UseWMAssist" ) );
  mFramesItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Frames" ), mFrames, 17 );
  mFramesItem->setMinValue(0);
  mFramesItem->setMaxValue(50);
  addItem( mFramesItem, QStringLiteral( "Frames" ) );

  setCurrentGroup( QStringLiteral( "AutoOpen" ) );

  mPollMouseItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PollMouse" ), mPollMouse, false );
  addItem( mPollMouseItem, QStringLiteral( "PollMouse" ) );
  mPollIntervalItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "PollInterval" ), mPollInterval, 500 );
  addItem( mPollIntervalItem, QStringLiteral( "PollInterval" ) );

  setCurrentGroup( QStringLiteral( "Dialogs" ) );

  mFirstRunItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FirstRun" ), mFirstRun, true );
  addItem( mFirstRunItem, QStringLiteral( "FirstRun" ) );
  mConfirmQuitItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ConfirmQuit" ), mConfirmQuit, true );
  addItem( mConfirmQuitItem, QStringLiteral( "ConfirmQuit" ) );
}

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

