00001 /* 00002 Copyright 2010 Ulrich Weigelt <ulrich.weigelt@gmx.de> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License as 00006 published by the Free Software Foundation; either version 2 of 00007 the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef ACCOUNTSETUPITEM_H 00019 #define ACCOUNTSETUPITEM_H 00020 00021 //Qt headers 00022 #include <QTreeWidgetItem> 00023 00024 //KDE headers 00025 #include <KListWidget> 00026 #include <KStandardDirs> 00027 #include <kconfig.h> 00028 #include <kurl.h> 00029 #include <KConfigGroup> 00030 #include <KDebug> 00031 00032 //KShowmail headers 00033 #include "constants.h" 00034 #include "encryption.h" 00035 #include "kwalletaccess.h" 00036 00037 using namespace Encryption; 00038 00043 class AccountSetupItem : public QTreeWidgetItem 00044 { 00045 public: 00046 00051 AccountSetupItem( QTreeWidget* parent ); 00052 00058 AccountSetupItem( QTreeWidget* parent, const QString& name ); 00059 00063 ~AccountSetupItem(); 00064 00069 void setAccountName( const QString& name ); 00070 00075 QString getAccountName() const; 00076 00081 void setServer( const QString& server ); 00082 00087 QString getServer() const; 00088 00093 void setProtocol( const QString& protocol ); 00094 00099 QString getProtocol() const; 00100 00105 void setPort( int port ); 00106 00111 int getPort() const; 00112 00117 void setUser( const QString& user ); 00118 00123 QString getUser() const; 00124 00129 void setPassword( const QString& password ); 00130 00135 QString getPassword() const; 00136 00143 void setPasswordStorageType( int type ); 00144 00151 int getPasswordStorageType() const; 00152 00157 void setActive( bool active ); 00158 00164 bool getActive() const; 00165 00172 void setTransferSecurity( int type ); 00173 00180 int getTransferSecurity() const; 00181 00187 void save() const; 00188 00192 void load(); 00193 00197 void print(); 00198 00203 void setUnsecureLoginAllowed( bool allowed ); 00204 00209 bool getUnsecureLoginAllowed() const; 00210 00211 00212 00213 private: 00214 00218 KSharedConfigPtr config; 00219 00223 QString _account; 00224 00228 QString _server; 00229 00233 QString _protocol; 00234 00238 int _port; 00239 00243 QString _user; 00244 00248 QString _password; 00249 00253 bool _active; 00254 00260 int _passwordStorage; 00261 00267 int _transferSecurity; 00268 00272 bool _allowUnsecureLogin; 00273 00274 00275 protected: 00276 00280 void init(); 00281 00282 }; 00283 00284 #endif