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

#include "transportbase.h"

#include <klocalizedstring.h>

using namespace MailTransport;

TransportBase::TransportBase( const QString & transportId )
  : KConfigSkeleton( QStringLiteral( "mailtransports" ) )
  , mParamtransportId(transportId)
{
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&TransportBase::itemChanged);

  setCurrentGroup( QStringLiteral( "Transport %1" ).arg( mParamtransportId ) );

  KConfigSkeleton::ItemInt  *innerItemId;
  innerItemId = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "id" ), mId, 0 );
  mIdItem = new KConfigCompilerSignallingItem(innerItemId, this, notifyFunction, signalIdChanged);
  mIdItem->setLabel( i18nd("libmailtransport6", "Unique identifier") );
  addItem( mIdItem, QStringLiteral( "id" ) );
  KConfigSkeleton::ItemString  *innerItemName;
  innerItemName = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "name" ), mName, i18n("Unnamed") );
  mNameItem = new KConfigCompilerSignallingItem(innerItemName, this, notifyFunction, signalNameChanged);
  mNameItem->setLabel( i18nd("libmailtransport6", "User-visible transport name") );
  mNameItem->setWhatsThis( i18nd("libmailtransport6", "The name that will be used when referring to this server.") );
  addItem( mNameItem, QStringLiteral( "name" ) );
  KConfigSkeleton::ItemStringList  *innerItemActivities;
  innerItemActivities = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "activities" ), mActivities );
  mActivitiesItem = new KConfigCompilerSignallingItem(innerItemActivities, this, notifyFunction, signalActivitiesChanged);
  mActivitiesItem->setLabel( i18nd("libmailtransport6", "activities") );
  addItem( mActivitiesItem, QStringLiteral( "activities" ) );
  KConfigSkeleton::ItemBool  *innerItemActivitiesEnabled;
  innerItemActivitiesEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "activitiesEnabled" ), mActivitiesEnabled, false );
  mActivitiesEnabledItem = new KConfigCompilerSignallingItem(innerItemActivitiesEnabled, this, notifyFunction, signalActivitiesEnabledChanged);
  mActivitiesEnabledItem->setLabel( i18nd("libmailtransport6", "activitiesEnabled") );
  addItem( mActivitiesEnabledItem, QStringLiteral( "activitiesEnabled" ) );
  KConfigSkeleton::ItemString  *innerItemIdentifier;
  innerItemIdentifier = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "identifier" ), mIdentifier, QStringLiteral( "SMTP" ) );
  mIdentifierItem = new KConfigCompilerSignallingItem(innerItemIdentifier, this, notifyFunction, signalIdentifierChanged);
  mIdentifierItem->setLabel( i18nd("libmailtransport6", "identifier") );
  addItem( mIdentifierItem, QStringLiteral( "identifier" ) );
  KConfigSkeleton::ItemString  *innerItemHost;
  innerItemHost = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "host" ), mHost );
  mHostItem = new KConfigCompilerSignallingItem(innerItemHost, this, notifyFunction, signalHostChanged);
  mHostItem->setLabel( i18nd("libmailtransport6", "Host name of the server") );
  mHostItem->setWhatsThis( i18nd("libmailtransport6", "The domain name or numerical address of the SMTP server.") );
  addItem( mHostItem, QStringLiteral( "host" ) );
  KConfigSkeleton::ItemUInt  *innerItemPort;
  innerItemPort = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "port" ), mPort, 465 );
  mPortItem = new KConfigCompilerSignallingItem(innerItemPort, this, notifyFunction, signalPortChanged);
  mPortItem->setLabel( i18nd("libmailtransport6", "Port number of the server") );
  mPortItem->setWhatsThis( i18nd("libmailtransport6", "The port number that the SMTP server is listening on. The default port is 465.") );
  addItem( mPortItem, QStringLiteral( "port" ) );
  KConfigSkeleton::ItemString  *innerItemUserName;
  innerItemUserName = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "user" ), mUserName );
  mUserNameItem = new KConfigCompilerSignallingItem(innerItemUserName, this, notifyFunction, signalUserNameChanged);
  mUserNameItem->setLabel( i18nd("libmailtransport6", "User name needed for login") );
  mUserNameItem->setWhatsThis( i18nd("libmailtransport6", "The user name to send to the server for authorization.") );
  addItem( mUserNameItem, QStringLiteral( "userName" ) );
  KConfigSkeleton::ItemString  *innerItemPrecommand;
  innerItemPrecommand = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "precommand" ), mPrecommand );
  mPrecommandItem = new KConfigCompilerSignallingItem(innerItemPrecommand, this, notifyFunction, signalPrecommandChanged);
  mPrecommandItem->setLabel( i18nd("libmailtransport6", "Command to execute before sending a mail") );
  mPrecommandItem->setWhatsThis( i18nd("libmailtransport6", "A command to run locally, prior to sending email. This can be used to set up SSH tunnels, for example. Leave it empty if no command should be run.") );
  addItem( mPrecommandItem, QStringLiteral( "precommand" ) );
  KConfigSkeleton::ItemString  *innerItemOptions;
  innerItemOptions = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "options" ), mOptions );
  mOptionsItem = new KConfigCompilerSignallingItem(innerItemOptions, this, notifyFunction, signalOptionsChanged);
  mOptionsItem->setLabel( i18nd("libmailtransport6", "Options added to mailtransport method") );
  addItem( mOptionsItem, QStringLiteral( "options" ) );
  KConfigSkeleton::ItemBool  *innerItemRequiresAuthentication;
  innerItemRequiresAuthentication = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "auth" ), mRequiresAuthentication, false );
  mRequiresAuthenticationItem = new KConfigCompilerSignallingItem(innerItemRequiresAuthentication, this, notifyFunction, signalRequiresAuthenticationChanged);
  mRequiresAuthenticationItem->setLabel( i18nd("libmailtransport6", "Server requires authentication") );
  mRequiresAuthenticationItem->setWhatsThis( i18nd("libmailtransport6", "Check this option if your SMTP server requires authentication before accepting mail. This is known as 'Authenticated SMTP' or simply ASMTP.") );
  addItem( mRequiresAuthenticationItem, QStringLiteral( "requiresAuthentication" ) );
  KConfigSkeleton::ItemBool  *innerItemStorePassword;
  innerItemStorePassword = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "storepass" ), mStorePassword, false );
  mStorePasswordItem = new KConfigCompilerSignallingItem(innerItemStorePassword, this, notifyFunction, signalStorePasswordChanged);
  mStorePasswordItem->setLabel( i18nd("libmailtransport6", "Store password") );
  mStorePasswordItem->setWhatsThis( i18nd("libmailtransport6", "Check this option to have your password stored.\n"
"If KWallet is available the password will be stored there, which is considered safe.\n"
"However, if KWallet is not available, the password will be stored in the configuration file. The password is stored in an obfuscated format, but should not be considered secure from decryption efforts if access to the configuration file is obtained.") );
  addItem( mStorePasswordItem, QStringLiteral( "storePassword" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesencryption;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("None");
    choice.label = i18nd("libmailtransport6", "No encryption");
    valuesencryption.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SSL");
    choice.label = i18nd("libmailtransport6", "SSL/TLS encryption");
    valuesencryption.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TLS");
    choice.label = i18nd("libmailtransport6", "STARTTLS encryption");
    valuesencryption.append( choice );
  }
  KConfigSkeleton::ItemEnum  *innerItemEncryption;
  innerItemEncryption = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "encryption" ), mEncryption, valuesencryption, SSL );
  mEncryptionItem = new KConfigCompilerSignallingItem(innerItemEncryption, this, notifyFunction, signalEncryptionChanged);
  mEncryptionItem->setLabel( i18nd("libmailtransport6", "Encryption method used for communication") );
  addItem( mEncryptionItem, QStringLiteral( "encryption" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesauthenticationType;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("LOGIN");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PLAIN");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("CRAM_MD5");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("DIGEST_MD5");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("GSSAPI");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("NTLM");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("APOP");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("CLEAR");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("ANONYMOUS");
    valuesauthenticationType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("XOAUTH2");
    valuesauthenticationType.append( choice );
  }
  KConfigSkeleton::ItemEnum  *innerItemAuthenticationType;
  innerItemAuthenticationType = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "authtype" ), mAuthenticationType, valuesauthenticationType, PLAIN );
  mAuthenticationTypeItem = new KConfigCompilerSignallingItem(innerItemAuthenticationType, this, notifyFunction, signalAuthenticationTypeChanged);
  mAuthenticationTypeItem->setLabel( i18nd("libmailtransport6", "Authentication method") );
  addItem( mAuthenticationTypeItem, QStringLiteral( "authenticationType" ) );
  KConfigSkeleton::ItemBool  *innerItemSpecifyHostname;
  innerItemSpecifyHostname = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "specifyHostname" ), mSpecifyHostname, false );
  mSpecifyHostnameItem = new KConfigCompilerSignallingItem(innerItemSpecifyHostname, this, notifyFunction, signalSpecifyHostnameChanged);
  mSpecifyHostnameItem->setLabel( i18nd("libmailtransport6", "specifyHostname") );
  mSpecifyHostnameItem->setWhatsThis( i18nd("libmailtransport6", "Check this option to use a custom hostname when identifying to the mail server. This is useful when your system's hostname may not be set correctly or to mask your system's true hostname.") );
  addItem( mSpecifyHostnameItem, QStringLiteral( "specifyHostname" ) );
  KConfigSkeleton::ItemString  *innerItemLocalHostname;
  innerItemLocalHostname = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "localHostname" ), mLocalHostname );
  mLocalHostnameItem = new KConfigCompilerSignallingItem(innerItemLocalHostname, this, notifyFunction, signalLocalHostnameChanged);
  mLocalHostnameItem->setLabel( i18nd("libmailtransport6", "localHostname") );
  mLocalHostnameItem->setWhatsThis( i18nd("libmailtransport6", "Enter the hostname that should be used when identifying to the server.") );
  addItem( mLocalHostnameItem, QStringLiteral( "localHostname" ) );
  KConfigSkeleton::ItemBool  *innerItemSpecifySenderOverwriteAddress;
  innerItemSpecifySenderOverwriteAddress = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "specifySenderOverwriteAddress" ), mSpecifySenderOverwriteAddress, false );
  mSpecifySenderOverwriteAddressItem = new KConfigCompilerSignallingItem(innerItemSpecifySenderOverwriteAddress, this, notifyFunction, signalSpecifySenderOverwriteAddressChanged);
  mSpecifySenderOverwriteAddressItem->setLabel( i18nd("libmailtransport6", "specifySenderOverwriteAddress") );
  mSpecifySenderOverwriteAddressItem->setWhatsThis( i18nd("libmailtransport6", "Check this option to use a custom sender address when identifying to the mail server. If not checked, the address from the identity is used.") );
  addItem( mSpecifySenderOverwriteAddressItem, QStringLiteral( "specifySenderOverwriteAddress" ) );
  KConfigSkeleton::ItemString  *innerItemSenderOverwriteAddress;
  innerItemSenderOverwriteAddress = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "senderOverwriteAddress" ), mSenderOverwriteAddress );
  mSenderOverwriteAddressItem = new KConfigCompilerSignallingItem(innerItemSenderOverwriteAddress, this, notifyFunction, signalSenderOverwriteAddressChanged);
  mSenderOverwriteAddressItem->setLabel( i18nd("libmailtransport6", "senderOverwriteAddress") );
  mSenderOverwriteAddressItem->setWhatsThis( i18nd("libmailtransport6", "Enter the address that should be used to overwrite the default sender address.") );
  addItem( mSenderOverwriteAddressItem, QStringLiteral( "senderOverwriteAddress" ) );
  KConfigSkeleton::ItemBool  *innerItemUseProxy;
  innerItemUseProxy = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useProxy" ), mUseProxy, false );
  mUseProxyItem = new KConfigCompilerSignallingItem(innerItemUseProxy, this, notifyFunction, signalUseProxyChanged);
  mUseProxyItem->setLabel( i18nd("libmailtransport6", "Connect using the system proxy settings") );
  mUseProxyItem->setWhatsThis( i18nd("libmailtransport6", "If checked, the system proxy settings will be used to connect to the mail server.") );
  addItem( mUseProxyItem, QStringLiteral( "useProxy" ) );
}

TransportBase::~TransportBase()
{
}


void TransportBase::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalIdChanged:
    Q_EMIT idChanged();
    break;
  case signalNameChanged:
    Q_EMIT nameChanged();
    break;
  case signalActivitiesChanged:
    Q_EMIT activitiesChanged();
    break;
  case signalActivitiesEnabledChanged:
    Q_EMIT activitiesEnabledChanged();
    break;
  case signalIdentifierChanged:
    Q_EMIT identifierChanged();
    break;
  case signalHostChanged:
    Q_EMIT hostChanged();
    break;
  case signalPortChanged:
    Q_EMIT portChanged();
    break;
  case signalUserNameChanged:
    Q_EMIT userNameChanged();
    break;
  case signalPrecommandChanged:
    Q_EMIT precommandChanged();
    break;
  case signalOptionsChanged:
    Q_EMIT optionsChanged();
    break;
  case signalRequiresAuthenticationChanged:
    Q_EMIT requiresAuthenticationChanged();
    break;
  case signalStorePasswordChanged:
    Q_EMIT storePasswordChanged();
    break;
  case signalEncryptionChanged:
    Q_EMIT encryptionChanged();
    break;
  case signalAuthenticationTypeChanged:
    Q_EMIT authenticationTypeChanged();
    break;
  case signalSpecifyHostnameChanged:
    Q_EMIT specifyHostnameChanged();
    break;
  case signalLocalHostnameChanged:
    Q_EMIT localHostnameChanged();
    break;
  case signalSpecifySenderOverwriteAddressChanged:
    Q_EMIT specifySenderOverwriteAddressChanged();
    break;
  case signalSenderOverwriteAddressChanged:
    Q_EMIT senderOverwriteAddressChanged();
    break;
  case signalUseProxyChanged:
    Q_EMIT useProxyChanged();
    break;
  }
}
