applayerprotocols/httpservice/inc/chttpclienttransactionimpl.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CHTTPCLIENTTRANSACTIONIMPL_H__
       
    17 #define __CHTTPCLIENTTRANSACTIONIMPL_H__
       
    18 
       
    19 #include <http.h>
       
    20 #include <e32base.h>
       
    21 #include <f32file.h>  
       
    22 #include <stringpool.h>
       
    23 
       
    24 class CHttpClientTransaction;
       
    25 //class MHTTPContentSource;
       
    26 class MHTTPContentSink;
       
    27 class CHttpService;
       
    28 class CHttpDataSender;
       
    29 class CHttpDataReceiver;
       
    30 class CHttpClientTransactionImpl : public CBase, public MHTTPTransactionCallback
       
    31 	{
       
    32 
       
    33 	public:
       
    34 	static CHttpClientTransactionImpl* NewL(CHttpService& aClient, CHttpClientTransaction& aTrans, const TDesC8& aMethod, const TDesC8& aUri);
       
    35 	~CHttpClientTransactionImpl();
       
    36 	
       
    37 	void SetDynamicContentSourceLength(TInt aLen);
       
    38 	TInt SetDynamicContentSource(MHttpContentSource* aSource);
       
    39 	TInt SetDynamicContentSink(MHttpContentSink* aSink);
       
    40 	TInt SetStaticContentSource(RFile& aSource);
       
    41 	TInt SetStaticContentSink(RFile& aSink);
       
    42 	inline RHTTPTransaction Transaction();
       
    43 	inline RStringPool StringPool();
       
    44 	
       
    45 	private:
       
    46 	inline CHttpClientTransactionImpl(CHttpClientTransaction& aTrans, RStringPool aStringPool);
       
    47 	void ConstructL(CHttpService& aClient, const TDesC8& aMethod, const TDesC8& aUri);
       
    48 	
       
    49 	// From MHTTPTransactionCallback
       
    50 	
       
    51 	void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
       
    52 	TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
       
    53 
       
    54 
       
    55 	
       
    56 	private:
       
    57 	CHttpClientTransaction&    iClientTrans;
       
    58 	CHttpDataSender*           iDataSender;
       
    59 	CHttpDataReceiver*         iDataReceiver;
       
    60 	RHTTPTransaction		   iTransaction;	
       
    61 	RStringPool				   iStringPool; 		// Not owned.
       
    62 	};
       
    63 
       
    64 inline CHttpClientTransactionImpl::CHttpClientTransactionImpl(CHttpClientTransaction& aTrans, RStringPool aStringPool)
       
    65 : iClientTrans(aTrans),
       
    66 iStringPool(aStringPool)
       
    67     {
       
    68     
       
    69     }
       
    70 	
       
    71 inline RHTTPTransaction CHttpClientTransactionImpl::Transaction()
       
    72 	{
       
    73 	return iTransaction;
       
    74 	}
       
    75 
       
    76 inline RStringPool CHttpClientTransactionImpl::StringPool()
       
    77 	{
       
    78 	return iStringPool;
       
    79 	}
       
    80 
       
    81 #endif // __CHTTPCLIENTTRANSACTIONIMPL_H__