1 // Copyright (c) 2003-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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 #ifndef __MHTTPCONTENTSINK_H__
18 #define __MHTTPCONTENTSINK_H__
22 class MHttpDataReceiver;
24 * THttpContentSinkOp is an operator to retrieve/store/release the HTTP
25 * content. The data consuming can be an asynchronous operation. After
26 * consuming the data Release/Store function must be called.
31 class THttpContentSinkOp
33 friend class CHttpDataReceiver;
35 IMPORT_C THttpContentSinkOp();
36 IMPORT_C TBool GetData(TPtrC8& aData);
37 IMPORT_C void Release();
38 IMPORT_C void Store(); // Store into a file if a sink is provided.
41 THttpContentSinkOp(MHttpDataReceiver& aSupplier);
43 MHttpDataReceiver* iDataReceiver;
47 * The implementation of MHttpContentSink can process the response body data If the application wants to
48 * process/sink the data in different means then the client can insulate sink to a different sink
54 class MHttpContentSink
58 * Supply a part of the response body data. The data will survive till the THttpContentSinkOp::Release/Store
59 * is called. application should process the data or keep a separate copy if it has to process the data at a
60 * later stage. This function will be called when part of the body data is available
62 * @param aData Sink Operator
64 virtual void OnData(THttpContentSinkOp& aData) =0;
67 // Reserved for future use.
68 inline virtual void Reserved();
69 inline virtual void Reserved2();
72 inline void MHttpContentSink::Reserved()
77 inline void MHttpContentSink::Reserved2()
82 #endif // __MHTTPCONTENTSINK_H__