epoc32/include/mw/http/rhttpmessage.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
/**
williamr@4
    17
 @file
williamr@2
    18
 @warning : This file contains Rose Model ID comments - please do not delete
williamr@2
    19
*/
williamr@2
    20
williamr@2
    21
#ifndef __RHTTPMESSAGE_H__
williamr@2
    22
#define __RHTTPMESSAGE_H__
williamr@2
    23
williamr@2
    24
// Forward declarations
williamr@2
    25
class RHTTPHeaders;
williamr@2
    26
class MHTTPDataSupplier;
williamr@2
    27
class CMessage;
williamr@2
    28
williamr@2
    29
williamr@2
    30
//##ModelId=3A375D1F0377
williamr@2
    31
class RHTTPMessage 
williamr@2
    32
/** 
williamr@2
    33
An abstract HTTP message. In RFC2616, an HTTP message is defined as having a
williamr@2
    34
header and an optional body.  This class is specialised for HTTP requests and
williamr@2
    35
responses.
williamr@2
    36
@publishedAll
williamr@2
    37
@released
williamr@2
    38
*/
williamr@2
    39
	{
williamr@2
    40
 public:
williamr@4
    41
	// Default (uninitialised) constructor.
williamr@2
    42
	//##ModelId=3A375DD60140
williamr@2
    43
	inline RHTTPMessage();
williamr@2
    44
williamr@2
    45
	/** Returns the header collection for the message */
williamr@2
    46
	//##ModelId=3A375DDE0368
williamr@2
    47
	IMPORT_C RHTTPHeaders GetHeaderCollection();
williamr@2
    48
williamr@2
    49
	/** Sets the messages body, replacing any existing body. The body
williamr@2
    50
        is supplied as a MHTTPDataSupplier, which will then return the
williamr@2
    51
        data in 1 or more chunks on request.  
williamr@2
    52
		@param aBody The data supplier that will supply the body.  */
williamr@2
    53
	//##ModelId=3A375DE0019E
williamr@2
    54
	IMPORT_C void SetBody(MHTTPDataSupplier& aBody);
williamr@2
    55
williamr@2
    56
	/** Removes the body */
williamr@2
    57
	//##ModelId=3B1E66FF004E
williamr@2
    58
	IMPORT_C void RemoveBody();
williamr@2
    59
williamr@2
    60
	/** Determine whether this message has any associated body data.
williamr@2
    61
		@return ETrue if there is some body data, EFalse if not.
williamr@2
    62
	*/
williamr@2
    63
	//##ModelId=3A914DFF01E5
williamr@2
    64
	IMPORT_C TBool HasBody() const;
williamr@2
    65
williamr@2
    66
	/** Gets the body. The body is supplied as a MHTTPDataSupplier,
williamr@2
    67
        which can be used to return the current data chunk, and to
williamr@2
    68
        acknowledge when that chunk has been consumed by the client.
williamr@2
    69
williamr@2
    70
		Note that the client can assume the body object will remain
williamr@2
    71
		unchanged from when it receives the first data until the end
williamr@2
    72
		of the transaction.
williamr@2
    73
williamr@2
    74
		@return A data supplier that provides access to a body
williamr@2
    75
		data chunk. NULL if the body has not been set, or has been removed */
williamr@2
    76
	//##ModelId=3A375DE40190
williamr@2
    77
	IMPORT_C MHTTPDataSupplier* Body() const;
williamr@2
    78
williamr@2
    79
 protected:
williamr@2
    80
	//##ModelId=3A914DFF01C7
williamr@2
    81
	CMessage* iImplementation;
williamr@2
    82
};
williamr@2
    83
williamr@2
    84
williamr@2
    85
inline RHTTPMessage::RHTTPMessage()
williamr@2
    86
		: iImplementation(NULL)
williamr@2
    87
	{
williamr@2
    88
	};
williamr@2
    89
williamr@2
    90
williamr@2
    91
#endif // __RHTTPMESSAGE_H__