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

#include "krdpserversettings.h"

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

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigCompilerSignallingItem  *itemListenPort;
  KConfigSkeleton::ItemInt  *innerItemListenPort;
  innerItemListenPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ListenPort" ), mListenPort, 3389 );
  itemListenPort = new KConfigCompilerSignallingItem(innerItemListenPort, this, notifyFunction, signalListenPortChanged);
  itemListenPort->setWriteFlags(KConfigBase::Notify);
  addItem( itemListenPort, QStringLiteral( "ListenPort" ) );
  KConfigCompilerSignallingItem  *itemAutogenerateCertificates;
  KConfigSkeleton::ItemBool  *innerItemAutogenerateCertificates;
  innerItemAutogenerateCertificates = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AutogenerateCertificates" ), mAutogenerateCertificates, true );
  itemAutogenerateCertificates = new KConfigCompilerSignallingItem(innerItemAutogenerateCertificates, this, notifyFunction, signalAutogenerateCertificatesChanged);
  itemAutogenerateCertificates->setWriteFlags(KConfigBase::Notify);
  addItem( itemAutogenerateCertificates, QStringLiteral( "AutogenerateCertificates" ) );
  KConfigCompilerSignallingItem  *itemCertificate;
  KConfigSkeleton::ItemString  *innerItemCertificate;
  innerItemCertificate = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Certificate" ), mCertificate );
  itemCertificate = new KConfigCompilerSignallingItem(innerItemCertificate, this, notifyFunction, signalCertificateChanged);
  itemCertificate->setWriteFlags(KConfigBase::Notify);
  addItem( itemCertificate, QStringLiteral( "Certificate" ) );
  KConfigCompilerSignallingItem  *itemCertificateKey;
  KConfigSkeleton::ItemString  *innerItemCertificateKey;
  innerItemCertificateKey = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "CertificateKey" ), mCertificateKey );
  itemCertificateKey = new KConfigCompilerSignallingItem(innerItemCertificateKey, this, notifyFunction, signalCertificateKeyChanged);
  itemCertificateKey->setWriteFlags(KConfigBase::Notify);
  addItem( itemCertificateKey, QStringLiteral( "CertificateKey" ) );
  KConfigCompilerSignallingItem  *itemQuality;
  KConfigSkeleton::ItemInt  *innerItemQuality;
  innerItemQuality = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Quality" ), mQuality, 75 );
  itemQuality = new KConfigCompilerSignallingItem(innerItemQuality, this, notifyFunction, signalQualityChanged);
  itemQuality->setWriteFlags(KConfigBase::Notify);
  addItem( itemQuality, QStringLiteral( "Quality" ) );
  KConfigCompilerSignallingItem  *itemUsers;
  KConfigSkeleton::ItemStringList  *innerItemUsers;
  innerItemUsers = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "Users" ), mUsers );
  itemUsers = new KConfigCompilerSignallingItem(innerItemUsers, this, notifyFunction, signalUsersChanged);
  itemUsers->setWriteFlags(KConfigBase::Notify);
  addItem( itemUsers, QStringLiteral( "Users" ) );
  KConfigCompilerSignallingItem  *itemSystemUserEnabled;
  KConfigSkeleton::ItemBool  *innerItemSystemUserEnabled;
  innerItemSystemUserEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SystemUserEnabled" ), mSystemUserEnabled, false );
  itemSystemUserEnabled = new KConfigCompilerSignallingItem(innerItemSystemUserEnabled, this, notifyFunction, signalSystemUserEnabledChanged);
  itemSystemUserEnabled->setWriteFlags(KConfigBase::Notify);
  addItem( itemSystemUserEnabled, QStringLiteral( "SystemUserEnabled" ) );
  KConfigCompilerSignallingItem  *itemAutostart;
  KConfigSkeleton::ItemBool  *innerItemAutostart;
  innerItemAutostart = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Autostart" ), mAutostart, false );
  itemAutostart = new KConfigCompilerSignallingItem(innerItemAutostart, this, notifyFunction, signalAutostartChanged);
  itemAutostart->setWriteFlags(KConfigBase::Notify);
  addItem( itemAutostart, QStringLiteral( "Autostart" ) );
}

int KRDPServerSettings::defaultListenPortValue_helper() const
{

  return 3389;
}

bool KRDPServerSettings::defaultAutogenerateCertificatesValue_helper() const
{

  return true;
}

int KRDPServerSettings::defaultQualityValue_helper() const
{

  return 75;
}

bool KRDPServerSettings::defaultSystemUserEnabledValue_helper() const
{

  return false;
}

bool KRDPServerSettings::defaultAutostartValue_helper() const
{

  return false;
}

KRDPServerSettings::~KRDPServerSettings()
{
}


void KRDPServerSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalListenPortChanged:
    Q_EMIT ListenPortChanged();
    break;
  case signalAutogenerateCertificatesChanged:
    Q_EMIT AutogenerateCertificatesChanged();
    break;
  case signalCertificateChanged:
    Q_EMIT CertificateChanged();
    break;
  case signalCertificateKeyChanged:
    Q_EMIT CertificateKeyChanged();
    break;
  case signalQualityChanged:
    Q_EMIT QualityChanged();
    break;
  case signalUsersChanged:
    Q_EMIT UsersChanged();
    break;
  case signalSystemUserEnabledChanged:
    Q_EMIT SystemUserEnabledChanged();
    break;
  case signalAutostartChanged:
    Q_EMIT AutostartChanged();
    break;
  }
}
