KIMAP Library
loginjob.h
00001 /* 00002 Copyright (c) 2009 Kevin Ottens <ervin@kde.org> 00003 Copyright (c) 2009 Andras Mantia <amantia@kde.org> 00004 00005 This library is free software; you can redistribute it and/or modify it 00006 under the terms of the GNU Library General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or (at your 00008 option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, but WITHOUT 00011 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to the 00017 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 02110-1301, USA. 00019 */ 00020 00021 #ifndef KIMAP_LOGINJOB_H 00022 #define KIMAP_LOGINJOB_H 00023 00024 #include "kimap_export.h" 00025 00026 #include "job.h" 00027 00028 namespace KIMAP { 00029 00030 class Session; 00031 struct Message; 00032 class LoginJobPrivate; 00033 00034 class KIMAP_EXPORT LoginJob : public Job 00035 { 00036 Q_OBJECT 00037 Q_DECLARE_PRIVATE(LoginJob) 00038 00039 friend class SessionPrivate; 00040 00041 public: 00042 enum EncryptionMode { 00043 Unencrypted = 0, 00044 TlsV1, 00045 SslV2, 00046 SslV3, 00047 SslV3_1, 00048 AnySslVersion 00049 }; 00050 00051 enum AuthenticationMode { 00052 ClearText = 0, 00053 Login, 00054 Plain, 00055 CramMD5, 00056 DigestMD5, 00057 NTLM, 00058 GSSAPI, 00059 Anonymous 00060 }; 00061 00062 explicit LoginJob( Session *session ); 00063 virtual ~LoginJob(); 00064 00065 QString userName() const; 00066 void setUserName( const QString &userName ); 00067 00068 QString password() const; 00069 void setPassword( const QString &password ); 00070 00080 QString serverGreeting() const; 00081 00088 void setEncryptionMode(EncryptionMode mode); 00089 00094 EncryptionMode encryptionMode(); 00095 00096 void setAuthenticationMode( AuthenticationMode mode ); 00097 00098 protected: 00099 virtual void doStart(); 00100 virtual void handleResponse( const Message &response ); 00101 virtual void connectionLost(); 00102 00103 private: 00104 Q_PRIVATE_SLOT( d_func(), void sslResponse(bool) ) 00105 }; 00106 00107 } 00108 00109 #endif