// This file is generated by kconfig_compiler_kf5 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  *itemNormalAlwaysOnTop;
  KConfigSkeleton::ItemBool  *innerItemNormalAlwaysOnTop;
  innerItemNormalAlwaysOnTop = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "NormalAlwaysOnTop" ), mNormalAlwaysOnTop, false );
  itemNormalAlwaysOnTop = new KConfigCompilerSignallingItem(innerItemNormalAlwaysOnTop, this, notifyFunction, signalNormalAlwaysOnTopChanged);
  itemNormalAlwaysOnTop->setWriteFlags(KConfigBase::Notify);
  addItem( itemNormalAlwaysOnTop, QStringLiteral( "NormalAlwaysOnTop" ) );
  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" ) );
}

bool NotificationSettings::defaultCriticalInDndModeValue_helper() const
{

  return true;
}

bool NotificationSettings::defaultNormalAlwaysOnTopValue_helper() const
{

  return false;
}

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;
}

NotificationSettings::~NotificationSettings()
{
}


void NotificationSettings::itemChanged(quint64 flags) {

  if ( flags & signalCriticalInDndModeChanged ) {
    Q_EMIT CriticalInDndModeChanged();
  }
  if ( flags & signalNormalAlwaysOnTopChanged ) {
    Q_EMIT NormalAlwaysOnTopChanged();
  }
  if ( flags & signalLowPriorityPopupsChanged ) {
    Q_EMIT LowPriorityPopupsChanged();
  }
  if ( flags & signalLowPriorityHistoryChanged ) {
    Q_EMIT LowPriorityHistoryChanged();
  }
  if ( flags & signalPopupPositionChanged ) {
    Q_EMIT PopupPositionChanged();
  }
  if ( flags & signalPopupTimeoutChanged ) {
    Q_EMIT PopupTimeoutChanged();
  }
}

#include "notificationsettings.moc"

