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

#include "messagelistsettings.h"

#include <klocalizedstring.h>

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

using namespace MessageList;

namespace MessageList {

class MessageListSettingsPrivate
{
  public:

    // MessageListView
    bool messageToolTipEnabled;
    bool showQuickSearch;
    QString tagSelected;

    // QuickSearchWarning
    bool quickSearchWarningDoNotShowAgain;

    // MessageListView::Colors
    QColor unreadMessageColor;
    QColor importantMessageColor;
    QColor todoMessageColor;

    // MessageListView::Fonts
    QFont messageListFont;
    QFont unreadMessageFont;
    QFont importantMessageFont;
    QFont todoMessageFont;

    // items
    KConfigSkeleton::ItemBool *messageToolTipEnabledItem;
    KConfigSkeleton::ItemBool *showQuickSearchItem;
    KConfigSkeleton::ItemString *tagSelectedItem;
    KConfigSkeleton::ItemBool *quickSearchWarningDoNotShowAgainItem;
    KConfigSkeleton::ItemColor *unreadMessageColorItem;
    KConfigSkeleton::ItemColor *importantMessageColorItem;
    KConfigSkeleton::ItemColor *todoMessageColorItem;
    KConfigSkeleton::ItemFont *messageListFontItem;
    KConfigSkeleton::ItemFont *unreadMessageFontItem;
    KConfigSkeleton::ItemFont *importantMessageFontItem;
    KConfigSkeleton::ItemFont *todoMessageFontItem;
};


}
namespace MessageList {

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

}
Q_GLOBAL_STATIC(MessageListSettingsHelper, s_globalMessageListSettings)
MessageListSettings *MessageListSettings::self()
{
  if (!s_globalMessageListSettings()->q) {
    new MessageListSettings;
    s_globalMessageListSettings()->q->read();
  }

  return s_globalMessageListSettings()->q;
}

MessageListSettings::MessageListSettings( )
  : KConfigSkeleton()
{
  d = new MessageListSettingsPrivate;
  Q_ASSERT(!s_globalMessageListSettings()->q);
  s_globalMessageListSettings()->q = this;
  setCurrentGroup( QStringLiteral( "MessageListView" ) );

  d->messageToolTipEnabledItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "MessageToolTipEnabled" ), d->messageToolTipEnabled, false );
  d->messageToolTipEnabledItem->setLabel( i18nd("libmessagelist", "Display tooltips for messages and group headers") );
  d->messageToolTipEnabledItem->setWhatsThis( i18nd("libmessagelist", "Enable this option to display tooltips when hovering over an item in the message list.") );
  addItem( d->messageToolTipEnabledItem, QStringLiteral( "MessageToolTipEnabled" ) );
  d->showQuickSearchItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowQuickSearch" ), d->showQuickSearch, true );
  d->showQuickSearchItem->setLabel( i18nd("libmessagelist", "ShowQuickSearch") );
  addItem( d->showQuickSearchItem, QStringLiteral( "ShowQuickSearch" ) );
  d->tagSelectedItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TagSelected" ), d->tagSelected );
  d->tagSelectedItem->setLabel( i18nd("libmessagelist", "TagSelected") );
  addItem( d->tagSelectedItem, QStringLiteral( "TagSelected" ) );

  setCurrentGroup( QStringLiteral( "QuickSearchWarning" ) );

  d->quickSearchWarningDoNotShowAgainItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "QuickSearchWarningDoNotShowAgain" ), d->quickSearchWarningDoNotShowAgain, false );
  d->quickSearchWarningDoNotShowAgainItem->setLabel( i18nd("libmessagelist", "QuickSearchWarningDoNotShowAgain") );
  addItem( d->quickSearchWarningDoNotShowAgainItem, QStringLiteral( "QuickSearchWarningDoNotShowAgain" ) );

  setCurrentGroup( QStringLiteral( "MessageListView::Colors" ) );

  d->unreadMessageColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "UnreadMessageColor" ), d->unreadMessageColor, MessageList::Util::unreadDefaultMessageColor() );
  d->unreadMessageColorItem->setLabel( i18nd("libmessagelist", "UnreadMessageColor") );
  addItem( d->unreadMessageColorItem, QStringLiteral( "UnreadMessageColor" ) );
  d->importantMessageColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "ImportantMessageColor" ), d->importantMessageColor, MessageList::Util::importantDefaultMessageColor() );
  d->importantMessageColorItem->setLabel( i18nd("libmessagelist", "ImportantMessageColor") );
  addItem( d->importantMessageColorItem, QStringLiteral( "ImportantMessageColor" ) );
  d->todoMessageColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "TodoMessageColor" ), d->todoMessageColor, MessageList::Util::todoDefaultMessageColor() );
  d->todoMessageColorItem->setLabel( i18nd("libmessagelist", "TodoMessageColor") );
  addItem( d->todoMessageColorItem, QStringLiteral( "TodoMessageColor" ) );

  setCurrentGroup( QStringLiteral( "MessageListView::Fonts" ) );

  d->messageListFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "MessageListFont" ), d->messageListFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  d->messageListFontItem->setLabel( i18nd("libmessagelist", "MessageListFont") );
  addItem( d->messageListFontItem, QStringLiteral( "MessageListFont" ) );
  d->unreadMessageFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "UnreadMessageFont" ), d->unreadMessageFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  d->unreadMessageFontItem->setLabel( i18nd("libmessagelist", "UnreadMessageFont") );
  addItem( d->unreadMessageFontItem, QStringLiteral( "UnreadMessageFont" ) );
  d->importantMessageFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "ImportantMessageFont" ), d->importantMessageFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  d->importantMessageFontItem->setLabel( i18nd("libmessagelist", "ImportantMessageFont") );
  addItem( d->importantMessageFontItem, QStringLiteral( "ImportantMessageFont" ) );
  d->todoMessageFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "TodoMessageFont" ), d->todoMessageFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  d->todoMessageFontItem->setLabel( i18nd("libmessagelist", "TodoMessageFont") );
  addItem( d->todoMessageFontItem, QStringLiteral( "TodoMessageFont" ) );
}

void MessageListSettings::setMessageToolTipEnabled( bool v )
{
    if (!self()->MessageListSettings::isMessageToolTipEnabledImmutable())
      self()->d->messageToolTipEnabled = v;
}

bool MessageListSettings::messageToolTipEnabled()
{
  return self()->d->messageToolTipEnabled;
}

bool  MessageListSettings::isMessageToolTipEnabledImmutable()
{
    return self()->isImmutable( QStringLiteral( "MessageToolTipEnabled" ) );
}


KConfigSkeleton::ItemBool *MessageListSettings::messageToolTipEnabledItem()
{
  return d->messageToolTipEnabledItem;
}

void MessageListSettings::setShowQuickSearch( bool v )
{
    if (!self()->MessageListSettings::isShowQuickSearchImmutable())
      self()->d->showQuickSearch = v;
}

bool MessageListSettings::showQuickSearch()
{
  return self()->d->showQuickSearch;
}

bool  MessageListSettings::isShowQuickSearchImmutable()
{
    return self()->isImmutable( QStringLiteral( "ShowQuickSearch" ) );
}


KConfigSkeleton::ItemBool *MessageListSettings::showQuickSearchItem()
{
  return d->showQuickSearchItem;
}

void MessageListSettings::setTagSelected( const QString & v )
{
    if (!self()->MessageListSettings::isTagSelectedImmutable())
      self()->d->tagSelected = v;
}

QString MessageListSettings::tagSelected()
{
  return self()->d->tagSelected;
}

bool  MessageListSettings::isTagSelectedImmutable()
{
    return self()->isImmutable( QStringLiteral( "TagSelected" ) );
}


KConfigSkeleton::ItemString *MessageListSettings::tagSelectedItem()
{
  return d->tagSelectedItem;
}

void MessageListSettings::setQuickSearchWarningDoNotShowAgain( bool v )
{
    if (!self()->MessageListSettings::isQuickSearchWarningDoNotShowAgainImmutable())
      self()->d->quickSearchWarningDoNotShowAgain = v;
}

bool MessageListSettings::quickSearchWarningDoNotShowAgain()
{
  return self()->d->quickSearchWarningDoNotShowAgain;
}

bool  MessageListSettings::isQuickSearchWarningDoNotShowAgainImmutable()
{
    return self()->isImmutable( QStringLiteral( "QuickSearchWarningDoNotShowAgain" ) );
}


KConfigSkeleton::ItemBool *MessageListSettings::quickSearchWarningDoNotShowAgainItem()
{
  return d->quickSearchWarningDoNotShowAgainItem;
}

void MessageListSettings::setUnreadMessageColor( const QColor & v )
{
    if (!self()->MessageListSettings::isUnreadMessageColorImmutable())
      self()->d->unreadMessageColor = v;
}

QColor MessageListSettings::unreadMessageColor()
{
  return self()->d->unreadMessageColor;
}

bool  MessageListSettings::isUnreadMessageColorImmutable()
{
    return self()->isImmutable( QStringLiteral( "UnreadMessageColor" ) );
}


KConfigSkeleton::ItemColor *MessageListSettings::unreadMessageColorItem()
{
  return d->unreadMessageColorItem;
}

void MessageListSettings::setImportantMessageColor( const QColor & v )
{
    if (!self()->MessageListSettings::isImportantMessageColorImmutable())
      self()->d->importantMessageColor = v;
}

QColor MessageListSettings::importantMessageColor()
{
  return self()->d->importantMessageColor;
}

bool  MessageListSettings::isImportantMessageColorImmutable()
{
    return self()->isImmutable( QStringLiteral( "ImportantMessageColor" ) );
}


KConfigSkeleton::ItemColor *MessageListSettings::importantMessageColorItem()
{
  return d->importantMessageColorItem;
}

void MessageListSettings::setTodoMessageColor( const QColor & v )
{
    if (!self()->MessageListSettings::isTodoMessageColorImmutable())
      self()->d->todoMessageColor = v;
}

QColor MessageListSettings::todoMessageColor()
{
  return self()->d->todoMessageColor;
}

bool  MessageListSettings::isTodoMessageColorImmutable()
{
    return self()->isImmutable( QStringLiteral( "TodoMessageColor" ) );
}


KConfigSkeleton::ItemColor *MessageListSettings::todoMessageColorItem()
{
  return d->todoMessageColorItem;
}

void MessageListSettings::setMessageListFont( const QFont & v )
{
    if (!self()->MessageListSettings::isMessageListFontImmutable())
      self()->d->messageListFont = v;
}

QFont MessageListSettings::messageListFont()
{
  return self()->d->messageListFont;
}

bool  MessageListSettings::isMessageListFontImmutable()
{
    return self()->isImmutable( QStringLiteral( "MessageListFont" ) );
}


KConfigSkeleton::ItemFont *MessageListSettings::messageListFontItem()
{
  return d->messageListFontItem;
}

void MessageListSettings::setUnreadMessageFont( const QFont & v )
{
    if (!self()->MessageListSettings::isUnreadMessageFontImmutable())
      self()->d->unreadMessageFont = v;
}

QFont MessageListSettings::unreadMessageFont()
{
  return self()->d->unreadMessageFont;
}

bool  MessageListSettings::isUnreadMessageFontImmutable()
{
    return self()->isImmutable( QStringLiteral( "UnreadMessageFont" ) );
}


KConfigSkeleton::ItemFont *MessageListSettings::unreadMessageFontItem()
{
  return d->unreadMessageFontItem;
}

void MessageListSettings::setImportantMessageFont( const QFont & v )
{
    if (!self()->MessageListSettings::isImportantMessageFontImmutable())
      self()->d->importantMessageFont = v;
}

QFont MessageListSettings::importantMessageFont()
{
  return self()->d->importantMessageFont;
}

bool  MessageListSettings::isImportantMessageFontImmutable()
{
    return self()->isImmutable( QStringLiteral( "ImportantMessageFont" ) );
}


KConfigSkeleton::ItemFont *MessageListSettings::importantMessageFontItem()
{
  return d->importantMessageFontItem;
}

void MessageListSettings::setTodoMessageFont( const QFont & v )
{
    if (!self()->MessageListSettings::isTodoMessageFontImmutable())
      self()->d->todoMessageFont = v;
}

QFont MessageListSettings::todoMessageFont()
{
  return self()->d->todoMessageFont;
}

bool  MessageListSettings::isTodoMessageFontImmutable()
{
    return self()->isImmutable( QStringLiteral( "TodoMessageFont" ) );
}


KConfigSkeleton::ItemFont *MessageListSettings::todoMessageFontItem()
{
  return d->todoMessageFontItem;
}

MessageListSettings::~MessageListSettings()
{
  delete d;
  if (s_globalMessageListSettings.exists() && !s_globalMessageListSettings.isDestroyed()) {
    s_globalMessageListSettings()->q = nullptr;
  }
}

