mailtransport
transportbase.h
00001
00002
00003 #ifndef MAILTRANSPORT_TRANSPORTBASE_H
00004 #define MAILTRANSPORT_TRANSPORTBASE_H
00005
00006 #include <mailtransport/mailtransport_export.h>
00007
00008 #include <kconfigskeleton.h>
00009 #include <kdebug.h>
00010
00011 namespace MailTransport {
00012
00013 class MAILTRANSPORT_EXPORT TransportBase : public KConfigSkeleton
00014 {
00015 public:
00016 class EnumType
00017 {
00018 public:
00019 enum type { SMTP, Sendmail, COUNT };
00020 };
00021 class EnumEncryption
00022 {
00023 public:
00024 enum type { None, SSL, TLS, COUNT };
00025 };
00026 class EnumAuthenticationType
00027 {
00028 public:
00029 enum type { LOGIN, PLAIN, CRAM_MD5, DIGEST_MD5, NTLM, GSSAPI, APOP, CLEAR, ANONYMOUS, COUNT };
00030 };
00031
00032 TransportBase( const QString & transportId );
00033 ~TransportBase();
00034
00038 void setId( int v )
00039 {
00040 if (!isImmutable( QString::fromLatin1 ( "id" ) ))
00041 mId = v;
00042 }
00043
00047 int id() const
00048 {
00049 return mId;
00050 }
00051
00055 ItemInt *idItem()
00056 {
00057 return mIdItem;
00058 }
00059
00063 void setName( const QString & v )
00064 {
00065 if (!isImmutable( QString::fromLatin1 ( "name" ) ))
00066 mName = v;
00067 }
00068
00072 QString name() const
00073 {
00074 return mName;
00075 }
00076
00080 ItemString *nameItem()
00081 {
00082 return mNameItem;
00083 }
00084
00088 void setType( int v )
00089 {
00090 if (!isImmutable( QString::fromLatin1 ( "type" ) ))
00091 mType = v;
00092 }
00093
00097 int type() const
00098 {
00099 return mType;
00100 }
00101
00105 ItemEnum *typeItem()
00106 {
00107 return mTypeItem;
00108 }
00109
00113 void setHost( const QString & v )
00114 {
00115 if (!isImmutable( QString::fromLatin1 ( "host" ) ))
00116 mHost = v;
00117 }
00118
00122 QString host() const
00123 {
00124 return mHost;
00125 }
00126
00130 ItemString *hostItem()
00131 {
00132 return mHostItem;
00133 }
00134
00138 void setPort( uint v )
00139 {
00140 if (!isImmutable( QString::fromLatin1 ( "port" ) ))
00141 mPort = v;
00142 }
00143
00147 uint port() const
00148 {
00149 return mPort;
00150 }
00151
00155 ItemUInt *portItem()
00156 {
00157 return mPortItem;
00158 }
00159
00163 void setUserName( const QString & v )
00164 {
00165 if (!isImmutable( QString::fromLatin1 ( "userName" ) ))
00166 mUserName = v;
00167 }
00168
00172 QString userName() const
00173 {
00174 return mUserName;
00175 }
00176
00180 ItemString *userNameItem()
00181 {
00182 return mUserNameItem;
00183 }
00184
00188 void setPrecommand( const QString & v )
00189 {
00190 if (!isImmutable( QString::fromLatin1 ( "precommand" ) ))
00191 mPrecommand = v;
00192 }
00193
00197 QString precommand() const
00198 {
00199 return mPrecommand;
00200 }
00201
00205 ItemString *precommandItem()
00206 {
00207 return mPrecommandItem;
00208 }
00209
00213 void setRequiresAuthentication( bool v )
00214 {
00215 if (!isImmutable( QString::fromLatin1 ( "requiresAuthentication" ) ))
00216 mRequiresAuthentication = v;
00217 }
00218
00222 bool requiresAuthentication() const
00223 {
00224 return mRequiresAuthentication;
00225 }
00226
00230 ItemBool *requiresAuthenticationItem()
00231 {
00232 return mRequiresAuthenticationItem;
00233 }
00234
00238 void setStorePassword( bool v )
00239 {
00240 if (!isImmutable( QString::fromLatin1 ( "storePassword" ) ))
00241 mStorePassword = v;
00242 }
00243
00247 bool storePassword() const
00248 {
00249 return mStorePassword;
00250 }
00251
00255 ItemBool *storePasswordItem()
00256 {
00257 return mStorePasswordItem;
00258 }
00259
00263 void setEncryption( int v )
00264 {
00265 if (!isImmutable( QString::fromLatin1 ( "encryption" ) ))
00266 mEncryption = v;
00267 }
00268
00272 int encryption() const
00273 {
00274 return mEncryption;
00275 }
00276
00280 ItemEnum *encryptionItem()
00281 {
00282 return mEncryptionItem;
00283 }
00284
00288 void setAuthenticationType( int v )
00289 {
00290 if (!isImmutable( QString::fromLatin1 ( "authenticationType" ) ))
00291 mAuthenticationType = v;
00292 }
00293
00297 int authenticationType() const
00298 {
00299 return mAuthenticationType;
00300 }
00301
00305 ItemEnum *authenticationTypeItem()
00306 {
00307 return mAuthenticationTypeItem;
00308 }
00309
00313 void setSpecifyHostname( bool v )
00314 {
00315 if (!isImmutable( QString::fromLatin1 ( "specifyHostname" ) ))
00316 mSpecifyHostname = v;
00317 }
00318
00322 bool specifyHostname() const
00323 {
00324 return mSpecifyHostname;
00325 }
00326
00330 ItemBool *specifyHostnameItem()
00331 {
00332 return mSpecifyHostnameItem;
00333 }
00334
00338 void setLocalHostname( const QString & v )
00339 {
00340 if (!isImmutable( QString::fromLatin1 ( "localHostname" ) ))
00341 mLocalHostname = v;
00342 }
00343
00347 QString localHostname() const
00348 {
00349 return mLocalHostname;
00350 }
00351
00355 ItemString *localHostnameItem()
00356 {
00357 return mLocalHostnameItem;
00358 }
00359
00360 protected:
00361 QString mParamtransportId;
00362
00363
00364 int mId;
00365 QString mName;
00366 int mType;
00367 QString mHost;
00368 uint mPort;
00369 QString mUserName;
00370 QString mPrecommand;
00371 bool mRequiresAuthentication;
00372 bool mStorePassword;
00373 int mEncryption;
00374 int mAuthenticationType;
00375 bool mSpecifyHostname;
00376 QString mLocalHostname;
00377
00378 private:
00379 ItemInt *mIdItem;
00380 ItemString *mNameItem;
00381 ItemEnum *mTypeItem;
00382 ItemString *mHostItem;
00383 ItemUInt *mPortItem;
00384 ItemString *mUserNameItem;
00385 ItemString *mPrecommandItem;
00386 ItemBool *mRequiresAuthenticationItem;
00387 ItemBool *mStorePasswordItem;
00388 ItemEnum *mEncryptionItem;
00389 ItemEnum *mAuthenticationTypeItem;
00390 ItemBool *mSpecifyHostnameItem;
00391 ItemString *mLocalHostnameItem;
00392 };
00393
00394 }
00395
00396 #endif
00397