mailtransport
transport.h
00001 /* 00002 Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 #ifndef MAILTRANSPORT_TRANSPORT_H 00021 #define MAILTRANSPORT_TRANSPORT_H 00022 00023 #include <mailtransport/mailtransport_export.h> 00024 #include <mailtransport/transportbase.h> 00025 #include <mailtransport/transporttype.h> 00026 00027 class TransportPrivate; 00028 00029 namespace MailTransport { 00030 00031 class TransportType; 00032 00044 // TODO KDE5: Do something about the kcfg-generated TransportBase. 00045 // Currently it has the config stuff as private members, which means it is 00046 // utterly inextensible. Also the sendmail and akonadi-type transports use 00047 // the "host" setting for keeping the location of the sendmail executable and 00048 // the resource id, respectively. This is a hack; they should have separate 00049 // config options... (cberzan) 00050 class MAILTRANSPORT_EXPORT Transport : public TransportBase 00051 { 00052 Q_OBJECT 00053 friend class TransportManager; 00054 friend class TransportManagerPrivate; 00055 00056 public: 00060 virtual ~Transport(); 00061 00062 typedef QList<Transport*> List; 00063 00067 bool isValid() const; 00068 00072 QString password(); 00073 00078 void setPassword( const QString &passwd ); 00079 00085 void forceUniqueName(); 00086 00097 void updatePasswordState(); 00098 00104 bool isComplete() const; 00105 00109 QString authenticationTypeString() const; 00110 00118 static QString authenticationTypeString( int type ); 00119 00128 Transport *clone() const; 00129 00135 TransportType transportType() const; 00136 00142 void setTransportType( const TransportType &type ); 00143 00144 protected: 00149 Transport( const QString &cfgGroup ); 00150 00151 virtual void usrReadConfig(); 00152 virtual void usrWriteConfig(); 00153 00157 bool needsWalletMigration() const; 00158 00162 void migrateToWallet(); 00163 00164 private Q_SLOTS: 00165 00166 // Used by our friend, TransportManager 00167 void readPassword(); 00168 00169 private: 00170 TransportPrivate *const d; 00171 }; 00172 00173 } // namespace MailTransport 00174 00175 #endif // MAILTRANSPORT_TRANSPORT_H