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

  QList<KConfigSkeleton::ItemEnum::Choice> valuesonLaunchAction;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TakeFullscreenScreenshot");
    valuesonLaunchAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseLastUsedCapturemode");
    valuesonLaunchAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("DoNotTakeScreenshot");
    valuesonLaunchAction.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemOnLaunchAction;
  itemOnLaunchAction = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "onLaunchAction" ), mOnLaunchAction, valuesonLaunchAction, TakeFullscreenScreenshot );
  addItem( itemOnLaunchAction, QStringLiteral( "onLaunchAction" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesprintKeyActionRunning;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TakeNewScreenshot");
    valuesprintKeyActionRunning.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("StartNewInstance");
    valuesprintKeyActionRunning.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("FocusWindow");
    valuesprintKeyActionRunning.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemPrintKeyActionRunning;
  itemPrintKeyActionRunning = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "printKeyActionRunning" ), mPrintKeyActionRunning, valuesprintKeyActionRunning, TakeNewScreenshot );
  addItem( itemPrintKeyActionRunning, QStringLiteral( "printKeyActionRunning" ) );
  KConfigSkeleton::ItemBool  *itemAutoSaveImage;
  itemAutoSaveImage = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "autoSaveImage" ), mAutoSaveImage, false );
  addItem( itemAutoSaveImage, QStringLiteral( "autoSaveImage" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesclipboardGroup;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PostScreenshotDoNothing");
    valuesclipboardGroup.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PostScreenshotCopyImage");
    valuesclipboardGroup.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PostScreenshotCopyLocation");
    valuesclipboardGroup.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemClipboardGroup;
  itemClipboardGroup = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "clipboardGroup" ), mClipboardGroup, valuesclipboardGroup, PostScreenshotDoNothing );
  addItem( itemClipboardGroup, QStringLiteral( "clipboardGroup" ) );
  KConfigSkeleton::ItemBool  *itemUseLightMaskColour;
  itemUseLightMaskColour = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useLightMaskColour" ), mUseLightMaskColour, false );
  addItem( itemUseLightMaskColour, QStringLiteral( "useLightMaskColour" ) );
  KConfigSkeleton::ItemBool  *itemShowMagnifier;
  itemShowMagnifier = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showMagnifier" ), mShowMagnifier, false );
  addItem( itemShowMagnifier, QStringLiteral( "showMagnifier" ) );
  KConfigSkeleton::ItemBool  *itemUseReleaseToCapture;
  itemUseReleaseToCapture = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useReleaseToCapture" ), mUseReleaseToCapture, false );
  addItem( itemUseReleaseToCapture, QStringLiteral( "useReleaseToCapture" ) );
  KConfigSkeleton::ItemBool  *itemShowCaptureInstructions;
  itemShowCaptureInstructions = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showCaptureInstructions" ), mShowCaptureInstructions, true );
  addItem( itemShowCaptureInstructions, QStringLiteral( "showCaptureInstructions" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesrememberLastRectangularRegion;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Never");
    valuesrememberLastRectangularRegion.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Always");
    valuesrememberLastRectangularRegion.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UntilSpectacleIsClosed");
    valuesrememberLastRectangularRegion.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemRememberLastRectangularRegion;
  itemRememberLastRectangularRegion = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "rememberLastRectangularRegion" ), mRememberLastRectangularRegion, valuesrememberLastRectangularRegion, Never );
  addItem( itemRememberLastRectangularRegion, QStringLiteral( "rememberLastRectangularRegion" ) );

  setCurrentGroup( QStringLiteral( "GuiConfig" ) );

  QList<int> defaultcropRegion;
  defaultcropRegion.append( 0 );
  defaultcropRegion.append( 0 );
  defaultcropRegion.append( 0 );
  defaultcropRegion.append( 0 );

  KConfigSkeleton::ItemIntList  *itemCropRegion;
  itemCropRegion = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "cropRegion" ), mCropRegion, defaultcropRegion );
  addItem( itemCropRegion, QStringLiteral( "cropRegion" ) );
  KConfigSkeleton::ItemBool  *itemOnClickChecked;
  itemOnClickChecked = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "onClickChecked" ), mOnClickChecked, false );
  addItem( itemOnClickChecked, QStringLiteral( "onClickChecked" ) );
  KConfigSkeleton::ItemBool  *itemIncludePointer;
  itemIncludePointer = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "includePointer" ), mIncludePointer, false );
  addItem( itemIncludePointer, QStringLiteral( "includePointer" ) );
  KConfigSkeleton::ItemBool  *itemIncludeDecorations;
  itemIncludeDecorations = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "includeDecorations" ), mIncludeDecorations, true );
  addItem( itemIncludeDecorations, QStringLiteral( "includeDecorations" ) );
  KConfigSkeleton::ItemBool  *itemTransientOnly;
  itemTransientOnly = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "transientOnly" ), mTransientOnly, false );
  addItem( itemTransientOnly, QStringLiteral( "transientOnly" ) );
  KConfigSkeleton::ItemBool  *itemQuitAfterSaveCopyExport;
  itemQuitAfterSaveCopyExport = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "quitAfterSaveCopyExport" ), mQuitAfterSaveCopyExport, false );
  addItem( itemQuitAfterSaveCopyExport, QStringLiteral( "quitAfterSaveCopyExport" ) );
  KConfigSkeleton::ItemDouble  *itemCaptureDelay;
  itemCaptureDelay = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "captureDelay" ), mCaptureDelay, 0 );
  addItem( itemCaptureDelay, QStringLiteral( "captureDelay" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuescaptureMode;
  KConfigSkeleton::ItemEnum  *itemCaptureMode;
  itemCaptureMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "captureMode" ), mCaptureMode, valuescaptureMode, Spectacle::CaptureMode::AllScreens );
  addItem( itemCaptureMode, QStringLiteral( "captureMode" ) );

  setCurrentGroup( QStringLiteral( "Save" ) );

  KConfigSkeleton::ItemUrl  *itemDefaultSaveLocation;
  itemDefaultSaveLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "defaultSaveLocation" ), mDefaultSaveLocation, 
            QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)+QLatin1Char('/')) 
         );
  addItem( itemDefaultSaveLocation, QStringLiteral( "defaultSaveLocation" ) );
  KConfigSkeleton::ItemUInt  *itemCompressionQuality;
  itemCompressionQuality = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "compressionQuality" ), mCompressionQuality, 90 );
  addItem( itemCompressionQuality, QStringLiteral( "compressionQuality" ) );
  KConfigSkeleton::ItemString  *itemDefaultSaveImageFormat;
  itemDefaultSaveImageFormat = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "defaultSaveImageFormat" ), mDefaultSaveImageFormat, QStringLiteral( "PNG" ) );
  addItem( itemDefaultSaveImageFormat, QStringLiteral( "defaultSaveImageFormat" ) );
  KConfigSkeleton::ItemString  *itemSaveFilenameFormat;
  itemSaveFilenameFormat = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "saveFilenameFormat" ), mSaveFilenameFormat, QStringLiteral( "Screenshot_%Y%M%D_%H%m%S" ) );
  addItem( itemSaveFilenameFormat, QStringLiteral( "saveFilenameFormat" ) );
  KConfigSkeleton::ItemUrl  *itemLastSaveLocation;
  itemLastSaveLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "lastSaveLocation" ), mLastSaveLocation, defaultSaveLocation() );
  addItem( itemLastSaveLocation, QStringLiteral( "lastSaveLocation" ) );
  KConfigSkeleton::ItemUrl  *itemLastSaveAsLocation;
  itemLastSaveAsLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "lastSaveAsLocation" ), mLastSaveAsLocation, defaultSaveLocation() );
  addItem( itemLastSaveAsLocation, QStringLiteral( "lastSaveAsLocation" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valueslastUsedSaveMode;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SaveAs");
    valueslastUsedSaveMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Save");
    valueslastUsedSaveMode.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemLastUsedSaveMode;
  itemLastUsedSaveMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "lastUsedSaveMode" ), mLastUsedSaveMode, valueslastUsedSaveMode, SaveAs );
  addItem( itemLastUsedSaveMode, QStringLiteral( "lastUsedSaveMode" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valueslastUsedCopyMode;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("CopyLocation");
    valueslastUsedCopyMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("CopyImage");
    valueslastUsedCopyMode.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemLastUsedCopyMode;
  itemLastUsedCopyMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "lastUsedCopyMode" ), mLastUsedCopyMode, valueslastUsedCopyMode, CopyImage );
  addItem( itemLastUsedCopyMode, QStringLiteral( "lastUsedCopyMode" ) );
}

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

