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

#include "globalsettings_messagecore.h"

#include <klocalizedstring.h>

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

using namespace MessageCore;

namespace MessageCore {

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

}
Q_GLOBAL_STATIC(MessageCoreSettingsBaseHelper, s_globalMessageCoreSettingsBase)
MessageCoreSettingsBase *MessageCoreSettingsBase::self()
{
  if (!s_globalMessageCoreSettingsBase()->q) {
    new MessageCoreSettingsBase;
    s_globalMessageCoreSettingsBase()->q->read();
  }

  return s_globalMessageCoreSettingsBase()->q;
}

MessageCoreSettingsBase::MessageCoreSettingsBase( )
  : KConfigSkeleton( QStringLiteral( "messagecorerc" ) )
{
  Q_ASSERT(!s_globalMessageCoreSettingsBase()->q);
  s_globalMessageCoreSettingsBase()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  mDateFormatItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "dateFormat" ), mDateFormat, int( KMime::DateFormatter::Fancy ) );
  mDateFormatItem->setLabel( i18nd("libmessagecore", "dateFormat") );
  addItem( mDateFormatItem, QStringLiteral( "dateFormat" ) );
  mCustomDateFormatItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "customDateFormat" ), mCustomDateFormat );
  mCustomDateFormatItem->setLabel( i18nd("libmessagecore", "customDateFormat") );
  addItem( mCustomDateFormatItem, QStringLiteral( "customDateFormat" ) );

  setCurrentGroup( QStringLiteral( "Fonts" ) );

  mUseDefaultFontsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "defaultFonts" ), mUseDefaultFonts, true );
  mUseDefaultFontsItem->setLabel( i18nd("libmessagecore", "defaultFonts") );
  addItem( mUseDefaultFontsItem, QStringLiteral( "UseDefaultFonts" ) );

  setCurrentGroup( QStringLiteral( "Reader" ) );

  mUseDefaultColorsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "defaultColors" ), mUseDefaultColors, true );
  mUseDefaultColorsItem->setLabel( i18nd("libmessagecore", "defaultColors") );
  addItem( mUseDefaultColorsItem, QStringLiteral( "UseDefaultColors" ) );
  mUseRealHtmlMailColorItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "realHtmlMailColor" ), mUseRealHtmlMailColor, false );
  mUseRealHtmlMailColorItem->setLabel( i18nd("libmessagecore", "realHtmlMailColor") );
  addItem( mUseRealHtmlMailColorItem, QStringLiteral( "UseRealHtmlMailColor" ) );
  mOverrideCharacterEncodingItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "encoding" ), mOverrideCharacterEncoding );
  mOverrideCharacterEncodingItem->setLabel( i18nd("libmessagecore", "encoding") );
  mOverrideCharacterEncodingItem->setWhatsThis( i18nd("libmessagecore", "Changing this from its default 'Auto' will force the use of the specified encoding for all emails, regardless of what they specify themselves.") );
  addItem( mOverrideCharacterEncodingItem, QStringLiteral( "OverrideCharacterEncoding" ) );
  mQuotedText3Item = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "QuotedText3" ), mQuotedText3, MessageCore::ColorUtil::self()->quoteLevel3DefaultTextColor() );
  mQuotedText3Item->setLabel( i18nd("libmessagecore", "This is the color used in the 3rd level of quoted text") );
  addItem( mQuotedText3Item, QStringLiteral( "QuotedText3" ) );
  mQuotedText2Item = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "QuotedText2" ), mQuotedText2, MessageCore::ColorUtil::self()->quoteLevel2DefaultTextColor() );
  mQuotedText2Item->setLabel( i18nd("libmessagecore", "This is the color used in the 2nd level of quoted text") );
  addItem( mQuotedText2Item, QStringLiteral( "QuotedText2" ) );
  mQuotedText1Item = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "QuotedText1" ), mQuotedText1, MessageCore::ColorUtil::self()->quoteLevel1DefaultTextColor() );
  mQuotedText1Item->setLabel( i18nd("libmessagecore", "This is the color used in the 1st level of quoted text") );
  addItem( mQuotedText1Item, QStringLiteral( "QuotedText1" ) );

  setCurrentGroup( QStringLiteral( "Composer" ) );

  QStringList defaultReplyPrefixes;
  defaultReplyPrefixes.append( QString::fromUtf8( "Re\\s*:" ) );
  defaultReplyPrefixes.append( QString::fromUtf8( "Re\\[\\d+\\]:" ) );
  defaultReplyPrefixes.append( QString::fromUtf8( "Re\\d+:" ) );

  mReplyPrefixesItem = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "reply-prefixes" ), mReplyPrefixes, defaultReplyPrefixes );
  mReplyPrefixesItem->setLabel( i18nd("libmessagecore", "reply-prefixes") );
  addItem( mReplyPrefixesItem, QStringLiteral( "ReplyPrefixes" ) );
  mReplaceReplyPrefixItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "replace-reply-prefix" ), mReplaceReplyPrefix, true );
  mReplaceReplyPrefixItem->setLabel( i18nd("libmessagecore", "Replace recognized prefi&x with \"Re:\"") );
  addItem( mReplaceReplyPrefixItem, QStringLiteral( "ReplaceReplyPrefix" ) );
  QStringList defaultForwardPrefixes;
  defaultForwardPrefixes.append( QString::fromUtf8( "Fwd:" ) );
  defaultForwardPrefixes.append( QString::fromUtf8( "FW:" ) );

  mForwardPrefixesItem = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "forward-prefixes" ), mForwardPrefixes, defaultForwardPrefixes );
  mForwardPrefixesItem->setLabel( i18nd("libmessagecore", "forward-prefixes") );
  addItem( mForwardPrefixesItem, QStringLiteral( "ForwardPrefixes" ) );
  mReplaceForwardPrefixItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "replace-forward-prefix" ), mReplaceForwardPrefix, true );
  mReplaceForwardPrefixItem->setLabel( i18nd("libmessagecore", "Replace recognized prefix with \"&Fwd:\"") );
  addItem( mReplaceForwardPrefixItem, QStringLiteral( "ReplaceForwardPrefix" ) );
  mMaximumAttachmentSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MaximumAttachmentSize" ), mMaximumAttachmentSize, -1 );
  mMaximumAttachmentSizeItem->setLabel( i18nd("libmessagecore", "The maximum size in bits that email attachments are allowed to have (-1 for no limit)") );
  addItem( mMaximumAttachmentSizeItem, QStringLiteral( "MaximumAttachmentSize" ) );
}

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

