accountwizard.h
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 TQt library by Trolltech AS, Norway (or with modified versions 00020 ** of TQt that use the same license as TQt), 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 ** TQt. 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 TQCheckBox; 00036 class TQLabel; 00037 class TQPushButton; 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 TQ_OBJECT 00049 00050 public: 00058 static void start( KMKernel *kernel, TQWidget *parent = 0 ); 00059 00063 void showPage( TQWidget *page ); 00064 00065 protected: 00066 AccountWizard( KMKernel *kernel, TQWidget *parent ); 00067 ~AccountWizard() {}; 00068 00069 void setupWelcomePage(); 00070 void setupAccountTypePage(); 00071 void setupAccountInformationPage(); 00072 void setupLoginInformationPage(); 00073 void setupServerInformationPage(); 00074 00075 protected slots: 00076 void chooseLocation(); 00077 virtual void accept(); 00078 void createTransport(); 00079 void transportCreated(); 00080 void createAccount(); 00081 void accountCreated(); 00082 void finished(); 00083 00084 private slots: 00085 void popCapabilities( const TQStringList&, const TQStringList& ); 00086 void imapCapabilities( const TQStringList&, const TQStringList& ); 00087 void smtpCapabilities( const TQStringList&, const TQStringList&, 00088 const TQString&, const TQString&, const TQString& ); 00089 00090 private: 00091 TQString accountName() const; 00092 TQLabel *createInfoLabel( const TQString &msg ); 00093 00094 void checkPopCapabilities( const TQString&, int ); 00095 void checkImapCapabilities( const TQString&, int ); 00096 void checkSmtpCapabilities( const TQString&, int ); 00097 uint popCapabilitiesFromStringList( const TQStringList& ); 00098 uint imapCapabilitiesFromStringList( const TQStringList& ); 00099 uint authMethodsFromString( const TQString& ); 00100 uint authMethodsFromStringList( const TQStringList& ); 00101 00102 TQWidget *mWelcomePage; 00103 00104 TQWidget *mAccountTypePage; 00105 AccountTypeBox *mTypeBox; 00106 00107 TQWidget *mAccountInformationPage; 00108 KLineEdit *mRealName; 00109 KLineEdit *mEMailAddress; 00110 KLineEdit *mOrganization; 00111 00112 TQWidget *mLoginInformationPage; 00113 KLineEdit *mLoginName; 00114 KLineEdit *mPassword; 00115 00116 TQWidget *mServerInformationPage; 00117 TQLabel *mIncomingLabel; 00118 KLineEdit *mIncomingServer; 00119 TQCheckBox *mIncomingUseSSL; 00120 KLineEdit *mIncomingLocation; 00121 00122 TQPushButton *mChooseLocation; 00123 KLineEdit *mOutgoingServer; 00124 TQCheckBox *mOutgoingUseSSL; 00125 TQCheckBox *mLocalDelivery; 00126 00127 TQWidget *mIncomingServerWdg; 00128 TQWidget *mIncomingLocationWdg; 00129 00130 TQLabel *mAuthInfoLabel; 00131 00132 KMKernel *mKernel; 00133 KMAccount *mAccount; 00134 KMTransportInfo *mTransportInfo; 00135 TQPtrList<KMTransportInfo> mTransportInfoList; 00136 KMServerTest *mServerTest; 00137 }; 00138 00139 #endif