httpengine.h

来自「一个简单的http客户端」· C头文件 代码 · 共 89 行

H
89
字号
/*
 ============================================================================
 Name		: HttpEngine.h
 Author	  : 
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CHttpEngine declaration
 ============================================================================
 */

#ifndef HTTPENGINE_H
#define HTTPENGINE_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>

// CLASS DECLARATION
#include <http/rhttptransaction.h>
#include <http/mhttptransactioncallback.h>
#include <http/mhttpsessioneventcallback.h>
#include <http/rhttpsession.h>
#include <ES_SOCK.h>

class MDisplayObser;

/**
 *  CHttpEngine
 * 
 */
class CHttpEngine : public CBase, private MHTTPTransactionCallback,
	protected MHTTPSessionEventCallback
{
public:
	void SetObser(MDisplayObser* aObser);
	void ConnectL(const TDesC& aUrl);
	
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CHttpEngine();

	/**
	 * Two-phased constructor.
	 */
	static CHttpEngine* NewL();

	/**
	 * Two-phased constructor.
	 */
	static CHttpEngine* NewLC();

private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CHttpEngine();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL();

private:
	virtual void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
	virtual TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction,
			const THTTPEvent& aEvent);

private:
	virtual void MHFSessionRunL(const THTTPSessionEvent& aEvent);
	virtual TInt MHFSessionRunError(TInt aError, const THTTPSessionEvent& aEvent);

private:
	RSocketServ iSocketServ;
	RConnection iConnection;
	RHTTPSession iSession;
	RHTTPTransaction iTrans;

	MDisplayObser* iObser;
	
	TBool iHaveStart;
};

#endif // HTTPENGINE_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?