epoc32/include/http/rhttpmessage.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 rhttpmessage.h
     1 // Copyright (c) 2001-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file RHTTPMessage.h
       
    20  @warning : This file contains Rose Model ID comments - please do not delete
       
    21 */
       
    22 
       
    23 #ifndef __RHTTPMESSAGE_H__
       
    24 #define __RHTTPMESSAGE_H__
       
    25 
       
    26 // Forward declarations
       
    27 class RHTTPHeaders;
       
    28 class MHTTPDataSupplier;
       
    29 class CMessage;
       
    30 
       
    31 
       
    32 //##ModelId=3A375D1F0377
       
    33 class RHTTPMessage 
       
    34 /** 
       
    35 An abstract HTTP message. In RFC2616, an HTTP message is defined as having a
       
    36 header and an optional body.  This class is specialised for HTTP requests and
       
    37 responses.
       
    38 @publishedAll
       
    39 @released
       
    40 */
       
    41 	{
       
    42  public:
       
    43 	/// Default (uninitialised) constructor.
       
    44 	//##ModelId=3A375DD60140
       
    45 	inline RHTTPMessage();
       
    46 
       
    47 	/** Returns the header collection for the message */
       
    48 	//##ModelId=3A375DDE0368
       
    49 	IMPORT_C RHTTPHeaders GetHeaderCollection();
       
    50 
       
    51 	/** Sets the messages body, replacing any existing body. The body
       
    52         is supplied as a MHTTPDataSupplier, which will then return the
       
    53         data in 1 or more chunks on request.  
       
    54 		@param aBody The data supplier that will supply the body.  */
       
    55 	//##ModelId=3A375DE0019E
       
    56 	IMPORT_C void SetBody(MHTTPDataSupplier& aBody);
       
    57 
       
    58 	/** Removes the body */
       
    59 	//##ModelId=3B1E66FF004E
       
    60 	IMPORT_C void RemoveBody();
       
    61 
       
    62 	/** Determine whether this message has any associated body data.
       
    63 		@return ETrue if there is some body data, EFalse if not.
       
    64 	*/
       
    65 	//##ModelId=3A914DFF01E5
       
    66 	IMPORT_C TBool HasBody() const;
       
    67 
       
    68 	/** Gets the body. The body is supplied as a MHTTPDataSupplier,
       
    69         which can be used to return the current data chunk, and to
       
    70         acknowledge when that chunk has been consumed by the client.
       
    71 
       
    72 		Note that the client can assume the body object will remain
       
    73 		unchanged from when it receives the first data until the end
       
    74 		of the transaction.
       
    75 
       
    76 		@return A data supplier that provides access to a body
       
    77 		data chunk. NULL if the body has not been set, or has been removed */
       
    78 	//##ModelId=3A375DE40190
       
    79 	IMPORT_C MHTTPDataSupplier* Body() const;
       
    80 
       
    81  protected:
       
    82 	//##ModelId=3A914DFF01C7
       
    83 	CMessage* iImplementation;
       
    84 };
       
    85 
       
    86 
       
    87 inline RHTTPMessage::RHTTPMessage()
       
    88 		: iImplementation(NULL)
       
    89 	{
       
    90 	};
       
    91 
       
    92 
       
    93 #endif // __RHTTPMESSAGE_H__