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

#include "kopetebehaviorsettings.h"

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

using namespace Kopete;

namespace Kopete {

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

}
Q_GLOBAL_STATIC(BehaviorSettingsHelper, s_globalBehaviorSettings)
BehaviorSettings *BehaviorSettings::self()
{
  if (!s_globalBehaviorSettings()->q) {
    new BehaviorSettings;
    s_globalBehaviorSettings()->q->read();
  }

  return s_globalBehaviorSettings()->q;
}

BehaviorSettings::BehaviorSettings( )
  : KConfigSkeleton( QStringLiteral( "kopeterc" ) )
{
  Q_ASSERT(!s_globalBehaviorSettings()->q);
  s_globalBehaviorSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Behavior" ) );

  mStartDockedItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "startDocked" ), mStartDocked, false );
  addItem( mStartDockedItem, QStringLiteral( "startDocked" ) );
  mShowSystemTrayItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showSystemTray" ), mShowSystemTray, true );
  addItem( mShowSystemTrayItem, QStringLiteral( "showSystemTray" ) );
  mUseMessageQueueItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useMessageQueue" ), mUseMessageQueue, true );
  addItem( mUseMessageQueueItem, QStringLiteral( "useMessageQueue" ) );
  mQueueUnreadMessagesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "queueUnreadMessages" ), mQueueUnreadMessages, false );
  addItem( mQueueUnreadMessagesItem, QStringLiteral( "queueUnreadMessages" ) );
  mContactListMouseNavigationItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "contactListMouseNavigation" ), mContactListMouseNavigation, false );
  addItem( mContactListMouseNavigationItem, QStringLiteral( "contactListMouseNavigation" ) );
  mReconnectOnDisconnectItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "reconnectOnDisconnect" ), mReconnectOnDisconnect, true );
  addItem( mReconnectOnDisconnectItem, QStringLiteral( "reconnectOnDisconnect" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesinitialStatus;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Offline");
    valuesinitialStatus.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Online");
    valuesinitialStatus.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Away");
    valuesinitialStatus.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Busy");
    valuesinitialStatus.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Invisible");
    valuesinitialStatus.append( choice );
  }
  mInitialStatusItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "initialStatus" ), mInitialStatus, valuesinitialStatus, EnumInitialStatus::Offline );
  addItem( mInitialStatusItem, QStringLiteral( "initialStatus" ) );
  mRaiseMessageWindowItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "raiseMessageWindow" ), mRaiseMessageWindow, false );
  addItem( mRaiseMessageWindowItem, QStringLiteral( "raiseMessageWindow" ) );
  mShowEventsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showEvents" ), mShowEvents, true );
  addItem( mShowEventsItem, QStringLiteral( "showEvents" ) );
  mQueueOnlyHighlightedMessagesInGroupChatsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "queueOnlyHighlightedMessagesInGroupChats" ), mQueueOnlyHighlightedMessagesInGroupChats, false );
  addItem( mQueueOnlyHighlightedMessagesInGroupChatsItem, QStringLiteral( "queueOnlyHighlightedMessagesInGroupChats" ) );
  mQueueOnlyMessagesOnAnotherDesktopItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "queueOnlyMessagesOnAnotherDesktop" ), mQueueOnlyMessagesOnAnotherDesktop, false );
  addItem( mQueueOnlyMessagesOnAnotherDesktopItem, QStringLiteral( "queueOnlyMessagesOnAnotherDesktop" ) );
  mBalloonGroupMessageNotificationsPerSenderItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "balloonGroupMessageNotificationsPerSender" ), mBalloonGroupMessageNotificationsPerSender, true );
  addItem( mBalloonGroupMessageNotificationsPerSenderItem, QStringLiteral( "balloonGroupMessageNotificationsPerSender" ) );
  mBalloonNotifyIgnoreClosesChatViewItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "balloonNotifyIgnoreClosesChatView" ), mBalloonNotifyIgnoreClosesChatView, false );
  addItem( mBalloonNotifyIgnoreClosesChatViewItem, QStringLiteral( "balloonNotifyIgnoreClosesChatView" ) );
  mTrayflashNotifyItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "trayflashNotify" ), mTrayflashNotify, true );
  addItem( mTrayflashNotifyItem, QStringLiteral( "trayflashNotify" ) );
  mTrayflashNotifyLeftClickOpensMessageItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "trayflashNotifyLeftClickOpensMessage" ), mTrayflashNotifyLeftClickOpensMessage, true );
  addItem( mTrayflashNotifyLeftClickOpensMessageItem, QStringLiteral( "trayflashNotifyLeftClickOpensMessage" ) );
  mAnimateOnMessageWithOpenChatItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "animateOnMessageWithOpenChat" ), mAnimateOnMessageWithOpenChat, true );
  addItem( mAnimateOnMessageWithOpenChatItem, QStringLiteral( "animateOnMessageWithOpenChat" ) );
  mTrayflashNotifySetCurrentDesktopToChatViewItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "trayflashNotifySetCurrentDesktopToChatView" ), mTrayflashNotifySetCurrentDesktopToChatView, false );
  addItem( mTrayflashNotifySetCurrentDesktopToChatViewItem, QStringLiteral( "trayflashNotifySetCurrentDesktopToChatView" ) );
  mEnableEventsWhileAwayItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "enableEventsWhileAway" ), mEnableEventsWhileAway, true );
  addItem( mEnableEventsWhileAwayItem, QStringLiteral( "enableEventsWhileAway" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valueschatWindowGroupPolicy;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("OpenNewWindow");
    valueschatWindowGroupPolicy.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("GroupByAccount");
    valueschatWindowGroupPolicy.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("GroupAll");
    valueschatWindowGroupPolicy.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("GroupByGroup");
    valueschatWindowGroupPolicy.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("GroupByMetaContact");
    valueschatWindowGroupPolicy.append( choice );
  }
  mChatWindowGroupPolicyItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "chatWindowGroupPolicy" ), mChatWindowGroupPolicy, valueschatWindowGroupPolicy, EnumChatWindowGroupPolicy::OpenNewWindow );
  addItem( mChatWindowGroupPolicyItem, QStringLiteral( "chatWindowGroupPolicy" ) );
  mSpellCheckItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "spellCheck" ), mSpellCheck, true );
  addItem( mSpellCheckItem, QStringLiteral( "spellCheck" ) );
  mRichTextByDefaultItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "richTextByDefault" ), mRichTextByDefault, false );
  addItem( mRichTextByDefaultItem, QStringLiteral( "richTextByDefault" ) );
  mChatWindowShowSendButtonItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "chatWindowShowSendButton" ), mChatWindowShowSendButton, true );
  addItem( mChatWindowShowSendButtonItem, QStringLiteral( "chatWindowShowSendButton" ) );
  mShowDatesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showDates" ), mShowDates, false );
  addItem( mShowDatesItem, QStringLiteral( "showDates" ) );
  mTruncateContactNameItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "truncateContactName" ), mTruncateContactName, false );
  addItem( mTruncateContactNameItem, QStringLiteral( "truncateContactName" ) );
  mTruncateContactNameLengthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "truncateContactNameLength" ), mTruncateContactNameLength, 20 );
  addItem( mTruncateContactNameLengthItem, QStringLiteral( "truncateContactNameLength" ) );
  mChatWindowBufferViewSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "chatWindowBufferViewSize" ), mChatWindowBufferViewSize, 250 );
  addItem( mChatWindowBufferViewSizeItem, QStringLiteral( "chatWindowBufferViewSize" ) );
  mHighlightEnabledItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "highlightEnabled" ), mHighlightEnabled, true );
  addItem( mHighlightEnabledItem, QStringLiteral( "highlightEnabled" ) );
  mViewPluginItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "viewPlugin" ), mViewPlugin, QStringLiteral( "kopete_chatwindow" ) );
  addItem( mViewPluginItem, QStringLiteral( "viewPlugin" ) );

  setCurrentGroup( QStringLiteral( "AutoAway" ) );

  mUseAutoAwayItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useAutoAway" ), mUseAutoAway, true );
  addItem( mUseAutoAwayItem, QStringLiteral( "useAutoAway" ) );
  mAutoAwayTimeoutItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "autoAwayTimeout" ), mAutoAwayTimeout, 600 );
  addItem( mAutoAwayTimeoutItem, QStringLiteral( "autoAwayTimeout" ) );
  mAutoAwayGoAvailableItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "autoAwayGoAvailable" ), mAutoAwayGoAvailable, true );
  addItem( mAutoAwayGoAvailableItem, QStringLiteral( "autoAwayGoAvailable" ) );
  mAutoAwayAskAvailableItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "autoAwayAskAvailable" ), mAutoAwayAskAvailable, false );
  addItem( mAutoAwayAskAvailableItem, QStringLiteral( "autoAwayAskAvailable" ) );
  mUseLastAwayMessageItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useLastAwayMessage" ), mUseLastAwayMessage, true );
  addItem( mUseLastAwayMessageItem, QStringLiteral( "useLastAwayMessage" ) );
  mUseCustomAwayMessageItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useCustomAwayMessage" ), mUseCustomAwayMessage, false );
  addItem( mUseCustomAwayMessageItem, QStringLiteral( "useCustomAwayMessage" ) );
  mAutoAwayCustomTitleItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "autoAwayCustomTitle" ), mAutoAwayCustomTitle, i18n("Away") );
  addItem( mAutoAwayCustomTitleItem, QStringLiteral( "autoAwayCustomTitle" ) );
  mAutoAwayCustomMessageItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "autoAwayCustomMessage" ), mAutoAwayCustomMessage, i18n("I am gone right now, but I will be back later") );
  addItem( mAutoAwayCustomMessageItem, QStringLiteral( "autoAwayCustomMessage" ) );

  setCurrentGroup( QStringLiteral( "ContactList" ) );

  mSmoothScrollingItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "smoothScrolling" ), mSmoothScrolling, true );
  addItem( mSmoothScrollingItem, QStringLiteral( "smoothScrolling" ) );

  setCurrentGroup( QStringLiteral( "ChatWindowSettings" ) );

  mAlwaysShowTabsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AlwaysShowTabs" ), mAlwaysShowTabs, false );
  addItem( mAlwaysShowTabsItem, QStringLiteral( "AlwaysShowTabs" ) );
  mShowContactNameItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowContactName" ), mShowContactName, true );
  addItem( mShowContactNameItem, QStringLiteral( "ShowContactName" ) );
  mHoverCloseItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "HoverClose" ), mHoverClose, true );
  addItem( mHoverCloseItem, QStringLiteral( "HoverClose" ) );
}

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

