kmail
networkaccount.h
Go to the documentation of this file.00001 /* -*- c++ -*- 00002 * networkaccount.h 00003 * 00004 * Copyright (c) 2000-2002 Michael Haeckel <haeckel@kde.org> 00005 * Copyright (c) 2002 Marc Mutz <mutz@kde.org> 00006 * 00007 * This file is based on work on pop3 and imap account implementations 00008 * by Don Sanders <sanders@kde.org> and Michael Haeckel <haeckel@kde.org> 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; version 2 of the License 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 */ 00023 00024 00025 #ifndef __KMAIL_NETWORKACCOUNT_H__ 00026 #define __KMAIL_NETWORKACCOUNT_H__ 00027 00028 #include "kmaccount.h" 00029 00030 #include "sieveconfig.h" 00031 00032 #include <kio/slave.h> 00033 00034 #include <QString> 00035 00036 class AccountManager; 00037 class KConfig/*Base*/; 00038 class KUrl; 00039 namespace KIO { 00040 class MetaData; 00041 } 00042 00043 namespace KMail { 00044 00045 class NetworkAccount : public KMAccount { 00046 Q_OBJECT 00047 protected: 00048 NetworkAccount( AccountManager * parent, const QString & name, uint id ); 00049 public: 00050 virtual ~NetworkAccount(); 00051 00053 virtual void init(); 00054 00056 virtual void pseudoAssign( const KMAccount * a ); 00057 00059 QString login() const { return mLogin; } 00060 virtual void setLogin( const QString & login ); 00061 00063 QString passwd() const; 00064 virtual void setPasswd( const QString & passwd, bool storeInConfig=false ); 00065 00069 virtual void clearPasswd(); 00070 00072 QString auth() const { return mAuth; } 00073 virtual void setAuth( const QString & auth ); 00074 00076 bool storePasswd() const { return mStorePasswd; } 00077 virtual void setStorePasswd( bool store ); 00078 00080 QString host() const { return mHost; } 00081 virtual void setHost( const QString & host ); 00082 00084 unsigned short int port() const { return mPort; } 00085 virtual void setPort( unsigned short int port ); 00086 00088 bool useSSL() const { return mUseSSL; } 00089 virtual void setUseSSL( bool use ); 00090 00092 bool useTLS() const { return mUseTLS; } 00093 virtual void setUseTLS( bool use ); 00094 00096 KMail::SieveConfig sieveConfig() const { return mSieveConfig; } 00097 virtual void setSieveConfig( const KMail::SieveConfig & config ); 00098 00100 virtual KIO::MetaData slaveConfig() const; 00101 00102 // This class is the reason that readConfig can't take a const KConfigGroup 00103 // (it deletes entries from it when migrating to kwallet), 00104 // and writeConfig can't be const (it sets member vars). 00105 virtual void readConfig( KConfigGroup & config ); 00106 virtual void writeConfig( KConfigGroup & config ); 00107 00109 virtual KUrl getUrl() const; 00110 00112 KIO::Slave * slave() const { return mSlave; } 00113 00115 virtual void killAllJobs( bool disconnectSlave = false ) = 0; 00116 00118 void readPassword(); 00119 00120 virtual bool mailCheckCanProceed() const; 00121 00122 virtual void setCheckingMail( bool checking ); 00123 00125 static void resetConnectionList( NetworkAccount* acct ); 00126 protected: 00127 virtual QString protocol() const = 0; 00128 virtual unsigned short int defaultPort() const = 0; 00129 00130 protected: 00131 KMail::SieveConfig mSieveConfig; 00132 QPointer<KIO::Slave> mSlave; 00133 QString mLogin, mPasswd, mAuth, mHost, mOldPassKey; 00134 unsigned short int mPort; 00135 bool mStorePasswd : 1; 00136 bool mUseSSL : 1; 00137 bool mUseTLS : 1; 00138 bool mAskAgain : 1; 00139 bool mPasswdDirty : 1, mStorePasswdInConfig : 1; 00140 }; 00141 00142 } // namespace KMail 00143 00144 #endif // __KMAIL_NETWORKACCOUNT_H__
KDE 4.2 API Reference