applayerprotocols/httptransportfw/Test/t_httpmessage/cmessagedatasupplier.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2002-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 __CMESSAGEDATASUPPLIER_H__
       
    17 #define __CMESSAGEDATASUPPLIER_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 class MDataSupplierObserver;
       
    22 
       
    23 class CMessageDataSupplier : public CActive
       
    24 	{
       
    25 public:	// methods
       
    26 
       
    27 	static CMessageDataSupplier* NewL(MDataSupplierObserver& aObserver, const TDesC8& aData, TInt aBufferSize);
       
    28 
       
    29 	virtual ~CMessageDataSupplier();
       
    30 
       
    31 	TBool GetData(TPtrC8& aData);
       
    32 
       
    33 	void ReleaseData();
       
    34 
       
    35 private:	// methods from CActive
       
    36 
       
    37 	virtual void RunL();
       
    38 
       
    39 	virtual void DoCancel();
       
    40 
       
    41 private:	// methods
       
    42 
       
    43 	CMessageDataSupplier(MDataSupplierObserver& aObserver, const TDesC8& aData, TInt aBufferSize);
       
    44 
       
    45 	void ConstructL();
       
    46 
       
    47 	void CompleteSelf();
       
    48 
       
    49 	void SetData();
       
    50 
       
    51 private:	// attributes
       
    52 	
       
    53 	MDataSupplierObserver&	iObserver;	
       
    54 
       
    55 	HBufC8*					iBuffer;
       
    56 
       
    57 	TPtrC8					iRemainingData;
       
    58 
       
    59 	TInt					iBufferSize;
       
    60 
       
    61 	TBool					iLast;
       
    62 
       
    63 	};
       
    64 
       
    65 #endif	// __CMESSAGEDATASUPPLIER_H__