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

#include "donotdisturbsettings.h"

using namespace NotificationManager;

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

  setCurrentGroup( QStringLiteral( "DoNotDisturb" ) );

  KConfigCompilerSignallingItem  *itemUntil;
  KConfigSkeleton::ItemDateTime  *innerItemUntil;
  innerItemUntil = new KConfigSkeleton::ItemDateTime( currentGroup(), QStringLiteral( "Until" ), mUntil );
  itemUntil = new KConfigCompilerSignallingItem(innerItemUntil, this, notifyFunction, signalUntilChanged);
  itemUntil->setWriteFlags(KConfigBase::Notify);
  addItem( itemUntil, QStringLiteral( "Until" ) );
  KConfigCompilerSignallingItem  *itemWhenScreensMirrored;
  KConfigSkeleton::ItemBool  *innerItemWhenScreensMirrored;
  innerItemWhenScreensMirrored = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "WhenScreensMirrored" ), mWhenScreensMirrored, true );
  itemWhenScreensMirrored = new KConfigCompilerSignallingItem(innerItemWhenScreensMirrored, this, notifyFunction, signalWhenScreensMirroredChanged);
  itemWhenScreensMirrored->setWriteFlags(KConfigBase::Notify);
  addItem( itemWhenScreensMirrored, QStringLiteral( "WhenScreensMirrored" ) );
  KConfigCompilerSignallingItem  *itemWhenScreenSharing;
  KConfigSkeleton::ItemBool  *innerItemWhenScreenSharing;
  innerItemWhenScreenSharing = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "WhenScreenSharing" ), mWhenScreenSharing, true );
  itemWhenScreenSharing = new KConfigCompilerSignallingItem(innerItemWhenScreenSharing, this, notifyFunction, signalWhenScreenSharingChanged);
  itemWhenScreenSharing->setWriteFlags(KConfigBase::Notify);
  addItem( itemWhenScreenSharing, QStringLiteral( "WhenScreenSharing" ) );
  KConfigCompilerSignallingItem  *itemWhenFullscreen;
  KConfigSkeleton::ItemBool  *innerItemWhenFullscreen;
  innerItemWhenFullscreen = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "WhenFullscreen" ), mWhenFullscreen, true );
  itemWhenFullscreen = new KConfigCompilerSignallingItem(innerItemWhenFullscreen, this, notifyFunction, signalWhenFullscreenChanged);
  itemWhenFullscreen->setWriteFlags(KConfigBase::Notify);
  addItem( itemWhenFullscreen, QStringLiteral( "WhenFullscreen" ) );
  KConfigCompilerSignallingItem  *itemNotificationSoundsMuted;
  KConfigSkeleton::ItemBool  *innerItemNotificationSoundsMuted;
  innerItemNotificationSoundsMuted = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "NotificationSoundsMuted" ), mNotificationSoundsMuted, false );
  itemNotificationSoundsMuted = new KConfigCompilerSignallingItem(innerItemNotificationSoundsMuted, this, notifyFunction, signalNotificationSoundsMutedChanged);
  itemNotificationSoundsMuted->setWriteFlags(KConfigBase::Notify);
  addItem( itemNotificationSoundsMuted, QStringLiteral( "NotificationSoundsMuted" ) );
}

bool DoNotDisturbSettings::defaultWhenScreensMirroredValue_helper() const
{

  return true;
}

bool DoNotDisturbSettings::defaultWhenScreenSharingValue_helper() const
{

  return true;
}

bool DoNotDisturbSettings::defaultWhenFullscreenValue_helper() const
{

  return true;
}

bool DoNotDisturbSettings::defaultNotificationSoundsMutedValue_helper() const
{

  return false;
}

DoNotDisturbSettings::~DoNotDisturbSettings()
{
}


void DoNotDisturbSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalUntilChanged:
    Q_EMIT UntilChanged();
    break;
  case signalWhenScreensMirroredChanged:
    Q_EMIT WhenScreensMirroredChanged();
    break;
  case signalWhenScreenSharingChanged:
    Q_EMIT WhenScreenSharingChanged();
    break;
  case signalWhenFullscreenChanged:
    Q_EMIT WhenFullscreenChanged();
    break;
  case signalNotificationSoundsMutedChanged:
    Q_EMIT NotificationSoundsMutedChanged();
    break;
  }
}
