kmail Library API Documentation

kmtransport.h

00001 
00020 #ifndef _KMTRANSPORT_H_
00021 #define _KMTRANSPORT_H_
00022  
00023 #include <kdialogbase.h>
00024 
00025 class QCheckBox;
00026 class QLabel;
00027 class QLineEdit;
00028 class QRadioButton;
00029 class KMServerTest;
00030 class QButtonGroup;
00031 
00032 class KMTransportInfo : public QObject
00033 {
00034 public:
00035   KMTransportInfo();
00036   virtual ~KMTransportInfo();
00037   void readConfig(int id);
00038   void writeConfig(int id);
00039   static int findTransport(const QString &name);
00040   static QStringList availableTransports();
00041   QString type, name, host, port, user, pass, precommand, encryption, authType;
00042   QString localHostname;
00043   bool auth, storePass, specifyHostname;
00044 };
00045 
00046 class KMTransportSelDlg : public KDialogBase
00047 {
00048   Q_OBJECT
00049  
00050 public:
00051   KMTransportSelDlg( QWidget *parent=0, const char *name=0, bool modal=TRUE );
00052   int selected() const;
00053  
00054 private slots:
00055   void buttonClicked( int id );
00056  
00057 private:
00058   int mSelectedButton;
00059 };
00060 
00061 class KMTransportDialog : public KDialogBase
00062 {
00063   Q_OBJECT
00064 
00065 public:
00066   KMTransportDialog( const QString & caption, KMTransportInfo *transportInfo,
00067              QWidget *parent=0, const char *name=0, bool modal=TRUE );
00068   virtual ~KMTransportDialog();
00069 
00070 private slots:
00071   virtual void slotOk();
00072   void slotSendmailChooser();
00073   void slotRequiresAuthClicked();
00074   void slotSmtpEncryptionChanged(int);
00075   void slotCheckSmtpCapabilities();
00076   void slotSmtpCapabilities( const QStringList &, const QStringList &, 
00077                              const QString &, const QString &, 
00078                              const QString & );
00079   void slotSendmailEditPath(const QString &);
00080 private:
00081   struct SendmailWidgets
00082   {
00083     QLabel       *titleLabel;
00084     QLineEdit    *nameEdit;
00085     QLineEdit    *locationEdit;
00086     QPushButton  *chooseButton;
00087   };
00088   struct SmtpWidgets
00089   {
00090     QLabel       *titleLabel;
00091     QLineEdit    *nameEdit;
00092     QLineEdit    *hostEdit;
00093     QLineEdit    *portEdit;
00094     QCheckBox    *authCheck;
00095     QLabel       *loginLabel;
00096     QLineEdit    *loginEdit;
00097     QLabel       *passwordLabel;
00098     QLineEdit    *passwordEdit;
00099     QLineEdit    *precommand;
00100     QButtonGroup *encryptionGroup;
00101     QRadioButton *encryptionNone;
00102     QRadioButton *encryptionSSL;
00103     QRadioButton *encryptionTLS;
00104     QButtonGroup *authGroup;
00105     QRadioButton *authPlain;
00106     QRadioButton *authLogin;
00107     QRadioButton *authCramMd5;
00108     QRadioButton *authDigestMd5;
00109     QPushButton  *checkCapabilities;
00110     QCheckBox    *storePasswordCheck;
00111     QCheckBox    *specifyHostnameCheck;
00112     QLineEdit    *localHostnameEdit;
00113     QLabel       *localHostnameLabel;
00114   };
00115 
00116   void makeSendmailPage();
00117   void makeSmtpPage();
00118   void setupSettings();
00119   void saveSettings();
00120   void checkHighest( QButtonGroup * );
00121   void enableAuthMethods( unsigned int which );
00122   static unsigned int authMethodsFromString( const QString & s );
00123   static unsigned int authMethodsFromStringList( const QStringList & sl );
00124 
00125   KMServerTest    *mServerTest;
00126   SmtpWidgets     mSmtp;
00127   SendmailWidgets mSendmail;
00128   KMTransportInfo *mTransportInfo;
00129   enum EncryptionMethods {
00130     NoEncryption = 0,
00131     SSL = 1,
00132     TLS = 2
00133   };
00134   enum AuthMethods {
00135     NoAuth = 0,
00136     LOGIN = 1,
00137     PLAIN = 2,
00138     CRAM_MD5 = 4,
00139     DIGEST_MD5 = 8,
00140     AllAuth = 0xffffffff
00141   };
00142   unsigned int mAuthNone, mAuthSSL, mAuthTLS;
00143 };
00144 
00145 
00146 #endif
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 22:43:53 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003