00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __blue_ext_httpmail__file__h_included__
00028 #define __blue_ext_httpmail__file__h_included__
00029
00030
00031
00032
00033 #include "Blue/Extension/HttpMail/Folder.h"
00034
00035
00036 #include "Blue/Extension/Http/Session.h"
00037
00038
00039
00040
00041
00042
00043 namespace blue {
00044 namespace ext {
00045 namespace httpmail {
00046
00054 class BLUE_EXPORT_HTTPMAIL Mailbox
00055 {
00056 public:
00057
00058
00059
00060
00062 Mailbox();
00063
00065 ~Mailbox();
00066
00067
00068
00069
00070
00071
00073 bool getHttpLogging() const;
00075 String getHttpLoggingFile() const;
00076
00078 String getHttpProxyHost() const;
00080 uint16_t getHttpProxyPort() const;
00081
00083 bool isLoggedIn() const;
00084
00089 String getLoginUrl() const;
00094 String getLoginContent() const;
00095
00097 String getUser() const;
00099 String getPassword() const;
00101 String getDomain() const;
00102
00108 http::Session* getSession();
00110 const http::Session* getSession() const;
00111
00118 Folder* getRootFolder();
00120 const Folder* getRootFolder() const;
00121
00122
00123
00124
00125
00126
00131 void setHttpLogging( bool logging );
00133 void setHttpLoggingFile( String file );
00134
00139 void setHttpProxy( String host, uint16_t port );
00140
00146 void setLoginUrl( String url );
00155 void setLoginContent( String content );
00156
00162 void setUser( String user );
00168 void setPassword( String password );
00169
00175 void login();
00181 void logout();
00182
00187 void sendMessage( String msg, String mailFromRcpt = String::null );
00188
00197 String processWebDavRequest( const http::Url& url, String webDavMethod, String webDavContent, String& errMsg );
00201 String processWebDavRequest( const http::Url& url, String webDavMethod, String webDavContent, http::Headers& custHeaders, String& errMsg );
00202
00203
00204 private:
00209 Mailbox( const Mailbox& );
00211 const Mailbox& operator=( const Mailbox& );
00212
00213 bool m_httpLog;
00214 String m_httpLogFile;
00215
00216 String m_loginUrl;
00217 String m_loginContent;
00218 String m_loginResponseContent;
00219 String m_sendMessageUrl;
00220
00221 String m_user;
00222 String m_password;
00223 String m_domain;
00224
00225 String m_proxyHost;
00226 uint16_t m_proxyPort;
00227
00228 http::Session* m_session;
00229 http::Session::PasswordRetriever* m_passwordRetriever;
00230
00231 Folder* m_root;
00232 };
00233
00234
00240 class BLUE_EXPORT_HTTPMAIL MailboxException :public HttpMailException
00241 {
00242 public:
00243 MailboxException( String desc )
00244 :HttpMailException(desc) {}
00245
00246 virtual String getException() const {
00247 return ("MailboxException");
00248 }
00249 };
00250
00251
00257 class BLUE_EXPORT_HTTPMAIL MailboxLoginException :public MailboxException
00258 {
00259 public:
00260 MailboxLoginException( String desc )
00261 :MailboxException(desc) {}
00262
00263 virtual String getException() const {
00264 return ("MailboxLoginException");
00265 }
00266 };
00267
00268
00276 class BLUE_EXPORT_HTTPMAIL MailboxInvalidModeException :public MailboxException
00277 {
00278 public:
00279 MailboxInvalidModeException( String desc )
00280 :MailboxException(desc) {}
00281
00282 virtual String getException() const {
00283 return ("MailboxInvalidModeException");
00284 }
00285 };
00286
00287
00294 class BLUE_EXPORT_HTTPMAIL MailboxMessageSendException :public MailboxException
00295 {
00296 public:
00297 MailboxMessageSendException( String desc )
00298 :MailboxException(desc) {}
00299
00300 virtual String getException() const {
00301 return ("MailboxMessageSendException");
00302 }
00303 };
00304
00305 }}}
00306
00307
00308
00309
00310
00311
00312
00313
00314 #endif // include guard