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

#include "globalsettings_templateparser.h"

#include <klocalizedstring.h>

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

using namespace TemplateParser;

namespace TemplateParser {

class TemplateParserSettingsHelper
{
  public:
    TemplateParserSettingsHelper() : q(nullptr) {}
    ~TemplateParserSettingsHelper() { delete q; q = nullptr; }
    TemplateParserSettingsHelper(const TemplateParserSettingsHelper&) = delete;
    TemplateParserSettingsHelper& operator=(const TemplateParserSettingsHelper&) = delete;
    TemplateParserSettings *q;
};

}
Q_GLOBAL_STATIC(TemplateParserSettingsHelper, s_globalTemplateParserSettings)
TemplateParserSettings *TemplateParserSettings::self()
{
  if (!s_globalTemplateParserSettings()->q) {
    new TemplateParserSettings;
    s_globalTemplateParserSettings()->q->read();
  }

  return s_globalTemplateParserSettings()->q;
}

TemplateParserSettings::TemplateParserSettings( )
  : KConfigSkeleton( QStringLiteral( "templateparserrc" ) )
{
  Q_ASSERT(!s_globalTemplateParserSettings()->q);
  s_globalTemplateParserSettings()->q = this;
  setCurrentGroup( QStringLiteral( "TemplateParser" ) );

  mStripSignatureItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "StripSignature" ), mStripSignature, true );
  mStripSignatureItem->setLabel( i18nd("libtemplateparser", "Remove the signature when replying") );
  addItem( mStripSignatureItem, QStringLiteral( "StripSignature" ) );
  mSmartQuoteItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "smart-quote" ), mSmartQuote, true );
  mSmartQuoteItem->setLabel( i18nd("libtemplateparser", "Use smart &quoting") );
  addItem( mSmartQuoteItem, QStringLiteral( "SmartQuote" ) );
  mReplyUsingVisualFormatItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "replyUsingVisualFormat" ), mReplyUsingVisualFormat, false );
  mReplyUsingVisualFormatItem->setLabel( i18nd("libtemplateparser", "Reply or forward using the same visual format as the original message (plain text or HTML)") );
  addItem( mReplyUsingVisualFormatItem, QStringLiteral( "ReplyUsingVisualFormat" ) );
  mCustomTemplatesItem = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "CustomTemplates" ), mCustomTemplates );
  mCustomTemplatesItem->setLabel( i18nd("libtemplateparser", "CustomTemplates") );
  addItem( mCustomTemplatesItem, QStringLiteral( "CustomTemplates" ) );
  mTemplateNewMessageItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateNewMessage" ), mTemplateNewMessage, DefaultTemplates::defaultNewMessage() );
  mTemplateNewMessageItem->setLabel( i18nd("libtemplateparser", "Message template for new message") );
  addItem( mTemplateNewMessageItem, QStringLiteral( "TemplateNewMessage" ) );
  mTemplateReplyItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateReply" ), mTemplateReply, DefaultTemplates::defaultReply() );
  mTemplateReplyItem->setLabel( i18nd("libtemplateparser", "Message template for reply") );
  addItem( mTemplateReplyItem, QStringLiteral( "TemplateReply" ) );
  mTemplateReplyAllItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateReplyAll" ), mTemplateReplyAll, DefaultTemplates::defaultReplyAll() );
  mTemplateReplyAllItem->setLabel( i18nd("libtemplateparser", "Message template for reply to all") );
  addItem( mTemplateReplyAllItem, QStringLiteral( "TemplateReplyAll" ) );
  mTemplateForwardItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateForward" ), mTemplateForward, DefaultTemplates::defaultForward() );
  mTemplateForwardItem->setLabel( i18nd("libtemplateparser", "Message template for forward") );
  addItem( mTemplateForwardItem, QStringLiteral( "TemplateForward" ) );
  mQuoteStringItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "QuoteString" ), mQuoteString, DefaultTemplates::defaultQuoteString() );
  mQuoteStringItem->setLabel( i18nd("libtemplateparser", "Quote characters") );
  addItem( mQuoteStringItem, QStringLiteral( "QuoteString" ) );
}

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

