epoc32/include/mw/http/rhttpmessage.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/http/rhttpmessage.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,93 @@
     1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +
    1.21 +/**
    1.22 + @file RHTTPMessage.h
    1.23 + @warning : This file contains Rose Model ID comments - please do not delete
    1.24 +*/
    1.25 +
    1.26 +#ifndef __RHTTPMESSAGE_H__
    1.27 +#define __RHTTPMESSAGE_H__
    1.28 +
    1.29 +// Forward declarations
    1.30 +class RHTTPHeaders;
    1.31 +class MHTTPDataSupplier;
    1.32 +class CMessage;
    1.33 +
    1.34 +
    1.35 +//##ModelId=3A375D1F0377
    1.36 +class RHTTPMessage 
    1.37 +/** 
    1.38 +An abstract HTTP message. In RFC2616, an HTTP message is defined as having a
    1.39 +header and an optional body.  This class is specialised for HTTP requests and
    1.40 +responses.
    1.41 +@publishedAll
    1.42 +@released
    1.43 +*/
    1.44 +	{
    1.45 + public:
    1.46 +	/// Default (uninitialised) constructor.
    1.47 +	//##ModelId=3A375DD60140
    1.48 +	inline RHTTPMessage();
    1.49 +
    1.50 +	/** Returns the header collection for the message */
    1.51 +	//##ModelId=3A375DDE0368
    1.52 +	IMPORT_C RHTTPHeaders GetHeaderCollection();
    1.53 +
    1.54 +	/** Sets the messages body, replacing any existing body. The body
    1.55 +        is supplied as a MHTTPDataSupplier, which will then return the
    1.56 +        data in 1 or more chunks on request.  
    1.57 +		@param aBody The data supplier that will supply the body.  */
    1.58 +	//##ModelId=3A375DE0019E
    1.59 +	IMPORT_C void SetBody(MHTTPDataSupplier& aBody);
    1.60 +
    1.61 +	/** Removes the body */
    1.62 +	//##ModelId=3B1E66FF004E
    1.63 +	IMPORT_C void RemoveBody();
    1.64 +
    1.65 +	/** Determine whether this message has any associated body data.
    1.66 +		@return ETrue if there is some body data, EFalse if not.
    1.67 +	*/
    1.68 +	//##ModelId=3A914DFF01E5
    1.69 +	IMPORT_C TBool HasBody() const;
    1.70 +
    1.71 +	/** Gets the body. The body is supplied as a MHTTPDataSupplier,
    1.72 +        which can be used to return the current data chunk, and to
    1.73 +        acknowledge when that chunk has been consumed by the client.
    1.74 +
    1.75 +		Note that the client can assume the body object will remain
    1.76 +		unchanged from when it receives the first data until the end
    1.77 +		of the transaction.
    1.78 +
    1.79 +		@return A data supplier that provides access to a body
    1.80 +		data chunk. NULL if the body has not been set, or has been removed */
    1.81 +	//##ModelId=3A375DE40190
    1.82 +	IMPORT_C MHTTPDataSupplier* Body() const;
    1.83 +
    1.84 + protected:
    1.85 +	//##ModelId=3A914DFF01C7
    1.86 +	CMessage* iImplementation;
    1.87 +};
    1.88 +
    1.89 +
    1.90 +inline RHTTPMessage::RHTTPMessage()
    1.91 +		: iImplementation(NULL)
    1.92 +	{
    1.93 +	};
    1.94 +
    1.95 +
    1.96 +#endif // __RHTTPMESSAGE_H__