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

#include "notificationsettings.h"

using namespace NotificationManager;

NotificationSettings::NotificationSettings( QObject *parent )
  : KConfigSkeleton( QStringLiteral( "plasmanotifyrc" ) )
{
  setParent(parent);
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&NotificationSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "Notifications" ) );

  KConfigCompilerSignallingItem  *itemCriticalInDndMode;
  KConfigSkeleton::ItemBool  *innerItemCriticalInDndMode;
  innerItemCriticalInDndMode = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "CriticalInDndMode" ), mCriticalInDndMode, true );
  itemCriticalInDndMode = new KConfigCompilerSignallingItem(innerItemCriticalInDndMode, this, notifyFunction, signalCriticalInDndModeChanged);
  itemCriticalInDndMode->setWriteFlags(KConfigBase::Notify);
  addItem( itemCriticalInDndMode, QStringLiteral( "CriticalInDndMode" ) );
  KConfigCompilerSignallingItem  *itemLowPriorityPopups;
  KConfigSkeleton::ItemBool  *innerItemLowPriorityPopups;
  innerItemLowPriorityPopups = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "LowPriorityPopups" ), mLowPriorityPopups, true );
  itemLowPriorityPopups = new KConfigCompilerSignallingItem(innerItemLowPriorityPopups, this, notifyFunction, signalLowPriorityPopupsChanged);
  itemLowPriorityPopups->setWriteFlags(KConfigBase::Notify);
  addItem( itemLowPriorityPopups, QStringLiteral( "LowPriorityPopups" ) );
  KConfigCompilerSignallingItem  *itemLowPriorityHistory;
  KConfigSkeleton::ItemBool  *innerItemLowPriorityHistory;
  innerItemLowPriorityHistory = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "LowPriorityHistory" ), mLowPriorityHistory, false );
  itemLowPriorityHistory = new KConfigCompilerSignallingItem(innerItemLowPriorityHistory, this, notifyFunction, signalLowPriorityHistoryChanged);
  itemLowPriorityHistory->setWriteFlags(KConfigBase::Notify);
  addItem( itemLowPriorityHistory, QStringLiteral( "LowPriorityHistory" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesPopupPosition;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("CloseToWidget");
    valuesPopupPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TopLeft");
    valuesPopupPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TopCenter");
    valuesPopupPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TopRight");
    valuesPopupPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("BottomLeft");
    valuesPopupPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("BottomCenter");
    valuesPopupPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("BottomRight");
    valuesPopupPosition.append( choice );
  }
  KConfigCompilerSignallingItem  *itemPopupPosition;
  KConfigSkeleton::ItemEnum  *innerItemPopupPosition;
  innerItemPopupPosition = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "PopupPosition" ), mPopupPosition, valuesPopupPosition, Settings::CloseToWidget );
  itemPopupPosition = new KConfigCompilerSignallingItem(innerItemPopupPosition, this, notifyFunction, signalPopupPositionChanged);
  itemPopupPosition->setWriteFlags(KConfigBase::Notify);
  addItem( itemPopupPosition, QStringLiteral( "PopupPosition" ) );
  KConfigCompilerSignallingItem  *itemPopupTimeout;
  KConfigSkeleton::ItemInt  *innerItemPopupTimeout;
  innerItemPopupTimeout = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "PopupTimeout" ), mPopupTimeout, 5000 );
  itemPopupTimeout = new KConfigCompilerSignallingItem(innerItemPopupTimeout, this, notifyFunction, signalPopupTimeoutChanged);
  itemPopupTimeout->setWriteFlags(KConfigBase::Notify);
  addItem( itemPopupTimeout, QStringLiteral( "PopupTimeout" ) );
  KConfigCompilerSignallingItem  *itemShowPopupTimeout;
  KConfigSkeleton::ItemBool  *innerItemShowPopupTimeout;
  innerItemShowPopupTimeout = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowPopupTimeout" ), mShowPopupTimeout, true );
  itemShowPopupTimeout = new KConfigCompilerSignallingItem(innerItemShowPopupTimeout, this, notifyFunction, signalShowPopupTimeoutChanged);
  itemShowPopupTimeout->setWriteFlags(KConfigBase::Notify);
  addItem( itemShowPopupTimeout, QStringLiteral( "ShowPopupTimeout" ) );
}

bool NotificationSettings::defaultCriticalInDndModeValue_helper() const
{

  return true;
}

bool NotificationSettings::defaultLowPriorityPopupsValue_helper() const
{

  return true;
}

bool NotificationSettings::defaultLowPriorityHistoryValue_helper() const
{

  return false;
}

int NotificationSettings::defaultPopupPositionValue_helper() const
{

  return Settings::CloseToWidget;
}

int NotificationSettings::defaultPopupTimeoutValue_helper() const
{

  return 5000;
}

bool NotificationSettings::defaultShowPopupTimeoutValue_helper() const
{

  return true;
}

NotificationSettings::~NotificationSettings()
{
}


void NotificationSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalCriticalInDndModeChanged:
    Q_EMIT CriticalInDndModeChanged();
    break;
  case signalLowPriorityPopupsChanged:
    Q_EMIT LowPriorityPopupsChanged();
    break;
  case signalLowPriorityHistoryChanged:
    Q_EMIT LowPriorityHistoryChanged();
    break;
  case signalPopupPositionChanged:
    Q_EMIT PopupPositionChanged();
    break;
  case signalPopupTimeoutChanged:
    Q_EMIT PopupTimeoutChanged();
    break;
  case signalShowPopupTimeoutChanged:
    Q_EMIT ShowPopupTimeoutChanged();
    break;
  }
}
