// This file is generated by kconfig_compiler_kf5 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 flags) {

  if ( flags & signalShowPopupsChanged ) {
    Q_EMIT ShowPopupsChanged();
  }
  if ( flags & signalShowPopupsInDndModeChanged ) {
    Q_EMIT ShowPopupsInDndModeChanged();
  }
  if ( flags & signalShowInHistoryChanged ) {
    Q_EMIT ShowInHistoryChanged();
  }
  if ( flags & signalShowBadgesChanged ) {
    Q_EMIT ShowBadgesChanged();
  }
}

#include "behaviorsettings.moc"

