www.pudn.com > HttpEngine.rar > HTTPEngine.h, change:2009-06-08,size:2673b


#ifndef HTTPENGINE_H 
#define HTTPENGINE_H 
 
// INCLUDES 
// System includes 
#include <e32base.h>                        // CBase 
#include <http\mhttpauthenticationcallback.h>    // MHTTPAuthenticationCallback 
#include <http\mhttpdatasupplier.h>                // MHTTPDataSupplier 
#include <http\mhttptransactioncallback.h>        // MHTTPTransactionCallback 
#include <http\rhttpsession.h>                    // RHTTPSession 
#include <http\rhttptransaction.h>                // RHTTPTransaction 
#include "UserMessage.h" 
//#include "MNotify.h" 
 
// CONSTANTS 
 
// FORWARD DECLARATIONS 
class CHTTPFormEncoder; 
 
// CLASS DECLARATION 
 
/** 
* 
* @class    MHTTPExampleEngineObserver HTTPExampleEngine.h 
* @brief    This is the engine observer interface 
* 
* Copyright (c) EMCC Software Ltd 2003 
* @version    1.0 
* 
*/ 
class MHTTPExampleEngineObserver 
{ 
    public: 
        virtual void ResponseStatusL(TInt aStatusCode, const TDesC& aStatusText) = 0; 
        virtual void ResponseReceivedL(const TDesC& aResponseBuffer) = 0; 
}; 
 
 
/** 
* 
* @class    CHTTPExampleEngine HTTPExampleEngine.h 
* @brief    This is the engine class, responsible for HTTP transactions. 
* 
* Copyright (c) EMCC Software Ltd 2003 
* @version    1.0 
* 
*/ 
class CHTTPEngine : public CBase, 
                           public MHTTPTransactionCallback/*,public MSendUserInfo*/ 
{ 
    public: 
        static CHTTPEngine* NewL(MHTTPExampleEngineObserver& aObserver); 
        ~CHTTPEngine(); 
 
        void GetRequestL(const TDesC& aUri); 
//        void PostRequestL(RPointerArray<CBookInfo> m_pBookInfoArray,const TDesC& PhoneNumber); 
 
        // Cancel an outstanding transaction 
        void Cancel(); 
//		void SendUserInfo(const TDesC& PhoneNumber,const TDesC& PassWord); 
 
 
    private: // from MHTTPTransactionCallback 
        virtual void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent); 
        virtual TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent); 
 
    private: 
        CHTTPEngine(MHTTPExampleEngineObserver& aObserver); 
        void ConstructL(); 
 
        void ParseUriL(const TDesC& aUri); 
        void AddHeaderL(RHTTPHeaders aHeaders, TInt aHeaderField, const TDesC8& aHeaderValue); 
 
    private: 
        RHTTPSession iSession; 
        RHTTPTransaction iTransaction; 
 
        HBufC* iResponseBuffer; 
        HBufC8* iUri; 
		HBufC8* ibuf8; 
        TUriParser8 iUriParser; 
        CHTTPFormEncoder* iFormEncoder; 
 
        MHTTPExampleEngineObserver& iObserver; 
 
		TBuf<16> sphoneNo; 
		TBuf<10> spwd; 
}; 
 
#endif    // #ifndef HTTPEXAMPLEENGINE_H 
 
// End of File