summaryrefslogtreecommitdiffstats
path: root/kmail/kmtransport.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kmail/kmtransport.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmtransport.h')
-rw-r--r--kmail/kmtransport.h169
1 files changed, 169 insertions, 0 deletions
diff --git a/kmail/kmtransport.h b/kmail/kmtransport.h
new file mode 100644
index 000000000..3f4c57a37
--- /dev/null
+++ b/kmail/kmtransport.h
@@ -0,0 +1,169 @@
+/*
+ * kmtransport.h
+ *
+ * Copyright (c) 2001-2002 Michael Haeckel <haeckel@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _KMTRANSPORT_H_
+#define _KMTRANSPORT_H_
+
+#include <kdialogbase.h>
+
+class QCheckBox;
+class QLabel;
+class QLineEdit;
+class QRadioButton;
+class KMServerTest;
+class QButtonGroup;
+
+class KMTransportInfo : public QObject
+{
+public:
+ KMTransportInfo();
+ virtual ~KMTransportInfo();
+ void readConfig(int id);
+ void writeConfig(int id);
+ static int findTransport(const QString &name);
+ static QStringList availableTransports();
+ uint id() const { return mId; }
+
+ /** Get/set password for this account */
+ QString passwd() const;
+ void setPasswd( const QString& passwd );
+
+ /** Get/set password storage flag */
+ bool storePasswd() const { return mStorePasswd; }
+ void setStorePasswd( bool store );
+
+ /** Read password from wallet */
+ void readPassword() const;
+
+ QString type, name, host, port, user, precommand, encryption, authType;
+ QString localHostname;
+ bool auth, specifyHostname;
+
+ private:
+ mutable QString mPasswd;
+ bool mPasswdDirty, mStorePasswd, mStorePasswdInConfig;
+ uint mId;
+};
+
+class KMTransportSelDlg : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KMTransportSelDlg( QWidget *parent=0, const char *name=0, bool modal=TRUE );
+ int selected() const;
+
+private slots:
+ void buttonClicked( int id );
+
+private:
+ int mSelectedButton;
+};
+
+class KMTransportDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KMTransportDialog( const QString & caption, KMTransportInfo *transportInfo,
+ QWidget *parent=0, const char *name=0, bool modal=TRUE );
+ virtual ~KMTransportDialog();
+
+private slots:
+ virtual void slotOk();
+ void slotSendmailChooser();
+ void slotRequiresAuthClicked();
+ void slotSmtpEncryptionChanged(int);
+ void slotCheckSmtpCapabilities();
+ void slotSmtpCapabilities( const QStringList &, const QStringList &,
+ const QString &, const QString &,
+ const QString & );
+ void slotSendmailEditPath(const QString &);
+private:
+ struct SendmailWidgets
+ {
+ QLabel *titleLabel;
+ QLineEdit *nameEdit;
+ QLineEdit *locationEdit;
+ QPushButton *chooseButton;
+ };
+ struct SmtpWidgets
+ {
+ QLabel *titleLabel;
+ QLineEdit *nameEdit;
+ QLineEdit *hostEdit;
+ QLineEdit *portEdit;
+ QCheckBox *authCheck;
+ QLabel *loginLabel;
+ QLineEdit *loginEdit;
+ QLabel *passwordLabel;
+ QLineEdit *passwordEdit;
+ QLineEdit *precommand;
+ QButtonGroup *encryptionGroup;
+ QRadioButton *encryptionNone;
+ QRadioButton *encryptionSSL;
+ QRadioButton *encryptionTLS;
+ QButtonGroup *authGroup;
+ QRadioButton *authPlain;
+ QRadioButton *authLogin;
+ QRadioButton *authCramMd5;
+ QRadioButton *authDigestMd5;
+ QRadioButton *authNTLM;
+ QRadioButton *authGSSAPI;
+ QPushButton *checkCapabilities;
+ QCheckBox *storePasswordCheck;
+ QCheckBox *specifyHostnameCheck;
+ QLineEdit *localHostnameEdit;
+ QLabel *localHostnameLabel;
+ };
+
+ void makeSendmailPage();
+ void makeSmtpPage();
+ void setupSettings();
+ void saveSettings();
+ void checkHighest( QButtonGroup * );
+ void enableAuthMethods( unsigned int which );
+ bool sanityCheckSmtpInput();
+ static unsigned int authMethodsFromString( const QString & s );
+ static unsigned int authMethodsFromStringList( const QStringList & sl );
+
+ KMServerTest *mServerTest;
+ SmtpWidgets mSmtp;
+ SendmailWidgets mSendmail;
+ KMTransportInfo *mTransportInfo;
+ enum EncryptionMethods {
+ NoEncryption = 0,
+ SSL = 1,
+ TLS = 2
+ };
+ enum AuthMethods {
+ NoAuth = 0,
+ LOGIN = 1,
+ PLAIN = 2,
+ CRAM_MD5 = 4,
+ DIGEST_MD5 = 8,
+ NTLM = 16,
+ GSSAPI = 32,
+ AllAuth = 0xffffffff
+ };
+ unsigned int mAuthNone, mAuthSSL, mAuthTLS;
+};
+
+
+#endif