Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members  

Mailbox.h

00001 //************************************************************************************************************************** 
00002 //* Blue HttpMail Extension
00003 //* Copyright (c) 2003-2004 Josh Harler
00004 //* 
00005 //* Blue - General Purpose C++ Library
00006 //* Copyright (c) 2002-2004 Josh Harler
00007 //* 
00008 //* This software is provided 'as-is', without any express or implied warranty. In no event
00009 //* will the authors be held liable for any damages arising from the use of this software.
00010 //* 
00011 //* Permission is granted to anyone to use this software for any purpose, including commercial
00012 //* applications, and to alter it and redistribute it freely, subject to the following restrictions:
00013 //* 
00014 //*     1. The origin of this software must not be misrepresented; you must not claim that you
00015 //*     wrote the original software. If you use this software in a product, an acknowledgment in the
00016 //*     product documentation would be appreciated but is not required.
00017 //* 
00018 //*     2. Altered source versions must be plainly marked as such, and must not be misrepresented as
00019 //*     being the original software.
00020 //* 
00021 //*     3. This notice may not be removed or altered from any source distribution.
00022 //*
00023 //*
00024 //* file   Blue/Extension/HttpMail/Mailbox.h
00025 //**
00026 
00027 #ifndef __blue_ext_httpmail__file__h_included__
00028 #define __blue_ext_httpmail__file__h_included__
00029 
00030 // Public Headers ==========================================================================================================
00031 
00032 // Extension headers
00033 #include "Blue/Extension/HttpMail/Folder.h"
00034 
00035 // Http Extension headers
00036 #include "Blue/Extension/Http/Session.h"
00037 
00038 
00039 // Public Defines/Enums/Typedefs/Etc. ======================================================================================
00040 
00041 // Public Classes/Structs ==================================================================================================
00042 
00043 namespace blue {
00044 namespace ext {
00045 namespace httpmail {
00046 
00054     class BLUE_EXPORT_HTTPMAIL Mailbox
00055     {
00056     public:
00057         // ===========================================================
00058         //  creation/destruction
00059         // ===========================================================
00060 
00062         Mailbox();
00063 
00065         ~Mailbox();
00066 
00067 
00068         // ===========================================================
00069         //  query
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         //  manipulation
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 }}} // namespaces
00306 
00307 
00308 // Public External Variables ===============================================================================================
00309 
00310 // Public Function Prototypes ==============================================================================================
00311 
00312 // Public Inline Functions =================================================================================================
00313 
00314 #endif // include guard

Generated on Wed Jun 30 14:44:26 2004 for Blue HttpMail Extension by doxygen1.3-rc3