williamr@2: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file RHTTPMessage.h williamr@2: @warning : This file contains Rose Model ID comments - please do not delete williamr@2: */ williamr@2: williamr@2: #ifndef __RHTTPMESSAGE_H__ williamr@2: #define __RHTTPMESSAGE_H__ williamr@2: williamr@2: // Forward declarations williamr@2: class RHTTPHeaders; williamr@2: class MHTTPDataSupplier; williamr@2: class CMessage; williamr@2: williamr@2: williamr@2: //##ModelId=3A375D1F0377 williamr@2: class RHTTPMessage williamr@2: /** williamr@2: An abstract HTTP message. In RFC2616, an HTTP message is defined as having a williamr@2: header and an optional body. This class is specialised for HTTP requests and williamr@2: responses. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: /// Default (uninitialised) constructor. williamr@2: //##ModelId=3A375DD60140 williamr@2: inline RHTTPMessage(); williamr@2: williamr@2: /** Returns the header collection for the message */ williamr@2: //##ModelId=3A375DDE0368 williamr@2: IMPORT_C RHTTPHeaders GetHeaderCollection(); williamr@2: williamr@2: /** Sets the messages body, replacing any existing body. The body williamr@2: is supplied as a MHTTPDataSupplier, which will then return the williamr@2: data in 1 or more chunks on request. williamr@2: @param aBody The data supplier that will supply the body. */ williamr@2: //##ModelId=3A375DE0019E williamr@2: IMPORT_C void SetBody(MHTTPDataSupplier& aBody); williamr@2: williamr@2: /** Removes the body */ williamr@2: //##ModelId=3B1E66FF004E williamr@2: IMPORT_C void RemoveBody(); williamr@2: williamr@2: /** Determine whether this message has any associated body data. williamr@2: @return ETrue if there is some body data, EFalse if not. williamr@2: */ williamr@2: //##ModelId=3A914DFF01E5 williamr@2: IMPORT_C TBool HasBody() const; williamr@2: williamr@2: /** Gets the body. The body is supplied as a MHTTPDataSupplier, williamr@2: which can be used to return the current data chunk, and to williamr@2: acknowledge when that chunk has been consumed by the client. williamr@2: williamr@2: Note that the client can assume the body object will remain williamr@2: unchanged from when it receives the first data until the end williamr@2: of the transaction. williamr@2: williamr@2: @return A data supplier that provides access to a body williamr@2: data chunk. NULL if the body has not been set, or has been removed */ williamr@2: //##ModelId=3A375DE40190 williamr@2: IMPORT_C MHTTPDataSupplier* Body() const; williamr@2: williamr@2: protected: williamr@2: //##ModelId=3A914DFF01C7 williamr@2: CMessage* iImplementation; williamr@2: }; williamr@2: williamr@2: williamr@2: inline RHTTPMessage::RHTTPMessage() williamr@2: : iImplementation(NULL) williamr@2: { williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // __RHTTPMESSAGE_H__