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

#include "behaviorsettings.h"

using namespace NotificationManager;

BehaviorSettings::BehaviorSettings( const QString & GroupEntry, const QString & DesktopEntry, QObject *parent )
  : KConfigSkeleton( QStringLiteral( "plasmanotifyrc" ) )
  , mParamGroupEntry(GroupEntry)
  , mParamDesktopEntry(DesktopEntry)
{
  setParent(parent);
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&BehaviorSettings::itemChanged);

  KConfigGroup cgGroupEntry(this->config(), QStringLiteral( "%1" ).arg( mParamGroupEntry ));
  KConfigGroup cgDesktopEntry = cgGroupEntry.group(QStringLiteral( "%1" ).arg( mParamDesktopEntry ));
  KConfigCompilerSignallingItem  *itemShowPopups;
  KConfigSkeleton::ItemBool  *innerItemShowPopups;
  innerItemShowPopups = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowPopups" ), mShowPopups, true );
  itemShowPopups = new KConfigCompilerSignallingItem(innerItemShowPopups, this, notifyFunction, signalShowPopupsChanged);
  itemShowPopups->setWriteFlags(KConfigBase::Notify);
  itemShowPopups->setGroup(cgDesktopEntry);
  addItem( itemShowPopups, QStringLiteral( "ShowPopups" ) );
  KConfigCompilerSignallingItem  *itemShowPopupsInDndMode;
  KConfigSkeleton::ItemBool  *innerItemShowPopupsInDndMode;
  innerItemShowPopupsInDndMode = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowPopupsInDndMode" ), mShowPopupsInDndMode, false );
  itemShowPopupsInDndMode = new KConfigCompilerSignallingItem(innerItemShowPopupsInDndMode, this, notifyFunction, signalShowPopupsInDndModeChanged);
  itemShowPopupsInDndMode->setWriteFlags(KConfigBase::Notify);
  itemShowPopupsInDndMode->setGroup(cgDesktopEntry);
  addItem( itemShowPopupsInDndMode, QStringLiteral( "ShowPopupsInDndMode" ) );
  KConfigCompilerSignallingItem  *itemShowInHistory;
  KConfigSkeleton::ItemBool  *innerItemShowInHistory;
  innerItemShowInHistory = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowInHistory" ), mShowInHistory, true );
  itemShowInHistory = new KConfigCompilerSignallingItem(innerItemShowInHistory, this, notifyFunction, signalShowInHistoryChanged);
  itemShowInHistory->setWriteFlags(KConfigBase::Notify);
  itemShowInHistory->setGroup(cgDesktopEntry);
  addItem( itemShowInHistory, QStringLiteral( "ShowInHistory" ) );
  KConfigCompilerSignallingItem  *itemShowBadges;
  KConfigSkeleton::ItemBool  *innerItemShowBadges;
  innerItemShowBadges = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowBadges" ), mShowBadges, true );
  itemShowBadges = new KConfigCompilerSignallingItem(innerItemShowBadges, this, notifyFunction, signalShowBadgesChanged);
  itemShowBadges->setWriteFlags(KConfigBase::Notify);
  itemShowBadges->setGroup(cgDesktopEntry);
  addItem( itemShowBadges, QStringLiteral( "ShowBadges" ) );
}

bool BehaviorSettings::defaultShowPopupsValue_helper() const
{

  return true;
}

bool BehaviorSettings::defaultShowPopupsInDndModeValue_helper() const
{

  return false;
}

bool BehaviorSettings::defaultShowInHistoryValue_helper() const
{

  return true;
}

bool BehaviorSettings::defaultShowBadgesValue_helper() const
{

  return true;
}

BehaviorSettings::~BehaviorSettings()
{
}


void BehaviorSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalShowPopupsChanged:
    Q_EMIT ShowPopupsChanged();
    break;
  case signalShowPopupsInDndModeChanged:
    Q_EMIT ShowPopupsInDndModeChanged();
    break;
  case signalShowInHistoryChanged:
    Q_EMIT ShowInHistoryChanged();
    break;
  case signalShowBadgesChanged:
    Q_EMIT ShowBadgesChanged();
    break;
  }
}
