kmail

accountwizard.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 **
00003 ** Filename   : accountwizard.h
00004 ** Created on : 07 February, 2005
00005 ** Copyright  : (c) 2005 Tobias Koenig
00006 ** Email      : tokoe@kde.org
00007 **
00008 *******************************************************************************/
00009 
00010 /*******************************************************************************
00011 **
00012 **   This program is free software; you can redistribute it and/or modify
00013 **   it under the terms of the GNU General Public License as published by
00014 **   the Free Software Foundation; either version 2 of the License, or
00015 **   (at your option) any later version.
00016 **
00017 **   In addition, as a special exception, the copyright holders give
00018 **   permission to link the code of this program with any edition of
00019 **   the Qt library by Trolltech AS, Norway (or with modified versions
00020 **   of Qt that use the same license as Qt), and distribute linked
00021 **   combinations including the two.  You must obey the GNU General
00022 **   Public License in all respects for all of the code used other than
00023 **   Qt.  If you modify this file, you may extend this exception to
00024 **   your version of the file, but you are not obligated to do so.  If
00025 **   you do not wish to do so, delete this exception statement from
00026 **   your version.
00027 *******************************************************************************/
00028 
00029 #ifndef KMWIZARD_H
00030 #define KMWIZARD_H
00031 
00032 #include <kwizard.h>
00033 
00034 class KLineEdit;
00035 class QCheckBox;
00036 class QLabel;
00037 class QPushButton;
00038 
00039 class KMAccount;
00040 class KMKernel;
00041 class KMServerTest;
00042 class AccountTypeBox;
00043 class KMTransportInfo;
00044 
00045 class AccountWizard : public KWizard
00046 {
00047   Q_OBJECT
00048 
00049   public:
00057     static void start( KMKernel *kernel, QWidget *parent = 0 );
00058 
00062     void showPage( QWidget *page );
00063 
00064   protected:
00065     AccountWizard( KMKernel *kernel, QWidget *parent );
00066     ~AccountWizard() {};
00067 
00068     void setupWelcomePage();
00069     void setupAccountTypePage();
00070     void setupAccountInformationPage();
00071     void setupLoginInformationPage();
00072     void setupServerInformationPage();
00073 
00074   protected slots:
00075     void chooseLocation();
00076     virtual void accept();
00077     void createTransport();
00078     void transportCreated();
00079     void createAccount();
00080     void accountCreated();
00081     void finished();
00082 
00083   private slots:
00084     void popCapabilities( const QStringList&, const QStringList& );
00085     void imapCapabilities( const QStringList&, const QStringList& );
00086     void smtpCapabilities( const QStringList&, const QStringList&,
00087                            const QString&, const QString&, const QString& );
00088 
00089   private:
00090     QString accountName() const;
00091     QLabel *createInfoLabel( const QString &msg );
00092 
00093     void checkPopCapabilities( const QString&, int );
00094     void checkImapCapabilities( const QString&, int );
00095     void checkSmtpCapabilities( const QString&, int );
00096     uint popCapabilitiesFromStringList( const QStringList& );
00097     uint imapCapabilitiesFromStringList( const QStringList& );
00098     uint authMethodsFromString( const QString& );
00099     uint authMethodsFromStringList( const QStringList& );
00100 
00101     QWidget *mWelcomePage;
00102 
00103     QWidget *mAccountTypePage;
00104     AccountTypeBox *mTypeBox;
00105 
00106     QWidget *mAccountInformationPage;
00107     KLineEdit *mRealName;
00108     KLineEdit *mEMailAddress;
00109     KLineEdit *mOrganization;
00110 
00111     QWidget *mLoginInformationPage;
00112     KLineEdit *mLoginName;
00113     KLineEdit *mPassword;
00114 
00115     QWidget *mServerInformationPage;
00116     QLabel *mIncomingLabel;
00117     KLineEdit *mIncomingServer;
00118     QCheckBox *mIncomingUseSSL;
00119     KLineEdit *mIncomingLocation;
00120 
00121     QPushButton *mChooseLocation;
00122     KLineEdit *mOutgoingServer;
00123     QCheckBox *mOutgoingUseSSL;
00124     QCheckBox *mLocalDelivery;
00125 
00126     QWidget *mIncomingServerWdg;
00127     QWidget *mIncomingLocationWdg;
00128 
00129     QLabel *mAuthInfoLabel;
00130 
00131     KMKernel *mKernel;
00132     KMAccount *mAccount;
00133     KMTransportInfo *mTransportInfo;
00134     QPtrList<KMTransportInfo> mTransportInfoList;
00135     KMServerTest *mServerTest;
00136 };
00137 
00138 #endif