servicediscoveryandcontrol/pnp/test/upnp/upnpmessage/inc/cupnpmessagecomposer.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-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 
       
    17 #ifndef __CUPNPMESSAGECOMPOSER_H
       
    18 #define __CUPNPMESSAGECOMPOSER_H
       
    19 
       
    20 #include <e32base.h>
       
    21 #include "mhttpmessagecomposerobserver.h"
       
    22 #include "rhttpmessagecomposer.h"
       
    23 #include <comms-infras/commsdebugutility.h>
       
    24 #include <rmemchunk.h>
       
    25 
       
    26 class MComposerObserver;
       
    27 class CUPnPMessageComposer : public CActive, 
       
    28 							public MHttpMessageComposerObserver
       
    29 	{	
       
    30 	public:
       
    31 	virtual ~CUPnPMessageComposer ();	
       
    32 	IMPORT_C void NotifyNewBodyData();
       
    33 	
       
    34 	inline void DataSentFailed ();
       
    35 	
       
    36 	protected:
       
    37 	CUPnPMessageComposer (MComposerObserver& aObserver);
       
    38 	void ConstructL ();
       
    39 	
       
    40 	protected:
       
    41 	// From CActive
       
    42 	void RunL ();
       
    43 	TInt RunError ();
       
    44 	inline void DoCancel ();
       
    45 	
       
    46 	void CompleteSelf ();
       
    47 
       
    48 	// methods from MHttpMessageComposerObserver
       
    49 	//virtual void StartLineL(TPtrC8& aVersion, TPtrC8& aStatusCode, TPtrC8& aStatusText);
       
    50 	//virtual TInt NextHeaderL(TPtrC8& aHeaderName, TPtrC8& aHeaderValue);
       
    51 	//virtual MHTTPDataSupplier* HasBodyL();
       
    52 	//virtual TInt NextTrailerL(TPtrC8& aHeaderName, TPtrC8& aHeaderValue);
       
    53 	virtual void MessageComplete();
       
    54 	virtual void MessageDataReadyL() ;
       
    55 	virtual TInt HandleComposeError(TInt aError);
       
    56 	
       
    57 	protected:
       
    58 	RHttpMessageComposer	iMessageComposer;
       
    59 	TInt					iFieldIterPos;
       
    60 	MComposerObserver& 		iObserver;			
       
    61 	RBuf8				iDataChain;
       
    62 
       
    63 	__FLOG_DECLARATION_MEMBER;
       
    64 	};
       
    65 
       
    66 void CUPnPMessageComposer::DoCancel ()
       
    67 	{
       
    68 	// Do nothing.	
       
    69 	}
       
    70 	
       
    71 void CUPnPMessageComposer::DataSentFailed ()
       
    72 	{
       
    73 	iDataChain.Close();
       
    74 	}
       
    75 
       
    76 #endif // __CUPNPMESSAGECOMPOSER_H