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