// This file is generated by kconfig_compiler from mailtransport.kcfg.
// All changes you do to this file will be lost.
#ifndef MAILTRANSPORT_TRANSPORTBASE_H
#define MAILTRANSPORT_TRANSPORTBASE_H

#include <mailtransport/mailtransport_export.h>

#include <kconfigskeleton.h>
#include <kdebug.h>

namespace MailTransport {

class MAILTRANSPORT_EXPORT TransportBase : public KConfigSkeleton
{
  public:
    class EnumType
    {
      public:
      enum type { SMTP, Sendmail, COUNT };
    };
    class EnumEncryption
    {
      public:
      enum type { None, SSL, TLS, COUNT };
    };
    class EnumAuthenticationType
    {
      public:
      enum type { LOGIN, PLAIN, CRAM_MD5, DIGEST_MD5, GSSAPI, NTLM, APOP, CLEAR, ANONYMOUS, COUNT };
    };

    TransportBase( const QString & transportId );
    ~TransportBase();

    /**
      Set Unique identifier
    */
    void setId( int v )
    {
      if (!isImmutable( QString::fromLatin1 ( "id" ) ))
        mId = v;
    }

    /**
      Get Unique identifier
    */
    int id() const
    {
      return mId;
    }

    /**
      Get Item object corresponding to id()
    */
    ItemInt *idItem()
    {
      return mIdItem;
    }

    /**
      Set User-visible transport name
    */
    void setName( const QString & v )
    {
      if (!isImmutable( QString::fromLatin1 ( "name" ) ))
        mName = v;
    }

    /**
      Get User-visible transport name
    */
    QString name() const
    {
      return mName;
    }

    /**
      Get Item object corresponding to name()
    */
    ItemString *nameItem()
    {
      return mNameItem;
    }

    /**
      Set Transport type
    */
    void setType( int v )
    {
      if (!isImmutable( QString::fromLatin1 ( "type" ) ))
        mType = v;
    }

    /**
      Get Transport type
    */
    int type() const
    {
      return mType;
    }

    /**
      Get Item object corresponding to type()
    */
    ItemEnum *typeItem()
    {
      return mTypeItem;
    }

    /**
      Set Host name of the server
    */
    void setHost( const QString & v )
    {
      if (!isImmutable( QString::fromLatin1 ( "host" ) ))
        mHost = v;
    }

    /**
      Get Host name of the server
    */
    QString host() const
    {
      return mHost;
    }

    /**
      Get Item object corresponding to host()
    */
    ItemString *hostItem()
    {
      return mHostItem;
    }

    /**
      Set Port number of the server
    */
    void setPort( uint v )
    {
      if (!isImmutable( QString::fromLatin1 ( "port" ) ))
        mPort = v;
    }

    /**
      Get Port number of the server
    */
    uint port() const
    {
      return mPort;
    }

    /**
      Get Item object corresponding to port()
    */
    ItemUInt *portItem()
    {
      return mPortItem;
    }

    /**
      Set User name needed for login
    */
    void setUserName( const QString & v )
    {
      if (!isImmutable( QString::fromLatin1 ( "userName" ) ))
        mUserName = v;
    }

    /**
      Get User name needed for login
    */
    QString userName() const
    {
      return mUserName;
    }

    /**
      Get Item object corresponding to userName()
    */
    ItemString *userNameItem()
    {
      return mUserNameItem;
    }

    /**
      Set Command to execute before sending a mail
    */
    void setPrecommand( const QString & v )
    {
      if (!isImmutable( QString::fromLatin1 ( "precommand" ) ))
        mPrecommand = v;
    }

    /**
      Get Command to execute before sending a mail
    */
    QString precommand() const
    {
      return mPrecommand;
    }

    /**
      Get Item object corresponding to precommand()
    */
    ItemString *precommandItem()
    {
      return mPrecommandItem;
    }

    /**
      Set Server requires authentication
    */
    void setRequiresAuthentication( bool v )
    {
      if (!isImmutable( QString::fromLatin1 ( "requiresAuthentication" ) ))
        mRequiresAuthentication = v;
    }

    /**
      Get Server requires authentication
    */
    bool requiresAuthentication() const
    {
      return mRequiresAuthentication;
    }

    /**
      Get Item object corresponding to requiresAuthentication()
    */
    ItemBool *requiresAuthenticationItem()
    {
      return mRequiresAuthenticationItem;
    }

    /**
      Set Store password
    */
    void setStorePassword( bool v )
    {
      if (!isImmutable( QString::fromLatin1 ( "storePassword" ) ))
        mStorePassword = v;
    }

    /**
      Get Store password
    */
    bool storePassword() const
    {
      return mStorePassword;
    }

    /**
      Get Item object corresponding to storePassword()
    */
    ItemBool *storePasswordItem()
    {
      return mStorePasswordItem;
    }

    /**
      Set Encryption method used for communication
    */
    void setEncryption( int v )
    {
      if (!isImmutable( QString::fromLatin1 ( "encryption" ) ))
        mEncryption = v;
    }

    /**
      Get Encryption method used for communication
    */
    int encryption() const
    {
      return mEncryption;
    }

    /**
      Get Item object corresponding to encryption()
    */
    ItemEnum *encryptionItem()
    {
      return mEncryptionItem;
    }

    /**
      Set Authentication method
    */
    void setAuthenticationType( int v )
    {
      if (!isImmutable( QString::fromLatin1 ( "authenticationType" ) ))
        mAuthenticationType = v;
    }

    /**
      Get Authentication method
    */
    int authenticationType() const
    {
      return mAuthenticationType;
    }

    /**
      Get Item object corresponding to authenticationType()
    */
    ItemEnum *authenticationTypeItem()
    {
      return mAuthenticationTypeItem;
    }

    /**
      Set specifyHostname
    */
    void setSpecifyHostname( bool v )
    {
      if (!isImmutable( QString::fromLatin1 ( "specifyHostname" ) ))
        mSpecifyHostname = v;
    }

    /**
      Get specifyHostname
    */
    bool specifyHostname() const
    {
      return mSpecifyHostname;
    }

    /**
      Get Item object corresponding to specifyHostname()
    */
    ItemBool *specifyHostnameItem()
    {
      return mSpecifyHostnameItem;
    }

    /**
      Set localHostname
    */
    void setLocalHostname( const QString & v )
    {
      if (!isImmutable( QString::fromLatin1 ( "localHostname" ) ))
        mLocalHostname = v;
    }

    /**
      Get localHostname
    */
    QString localHostname() const
    {
      return mLocalHostname;
    }

    /**
      Get Item object corresponding to localHostname()
    */
    ItemString *localHostnameItem()
    {
      return mLocalHostnameItem;
    }

  protected:
    QString mParamtransportId;

    // Transport $(transportId)
    int mId;
    QString mName;
    int mType;
    QString mHost;
    uint mPort;
    QString mUserName;
    QString mPrecommand;
    bool mRequiresAuthentication;
    bool mStorePassword;
    int mEncryption;
    int mAuthenticationType;
    bool mSpecifyHostname;
    QString mLocalHostname;

  private:
    ItemInt *mIdItem;
    ItemString *mNameItem;
    ItemEnum *mTypeItem;
    ItemString *mHostItem;
    ItemUInt *mPortItem;
    ItemString *mUserNameItem;
    ItemString *mPrecommandItem;
    ItemBool *mRequiresAuthenticationItem;
    ItemBool *mStorePasswordItem;
    ItemEnum *mEncryptionItem;
    ItemEnum *mAuthenticationTypeItem;
    ItemBool *mSpecifyHostnameItem;
    ItemString *mLocalHostnameItem;
};

}

#endif

