author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@4 | 1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@4 | 2 |
// All rights reserved. |
williamr@4 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@4 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@4 | 7 |
// |
williamr@4 | 8 |
// Initial Contributors: |
williamr@4 | 9 |
// Nokia Corporation - initial contribution. |
williamr@4 | 10 |
// |
williamr@4 | 11 |
// Contributors: |
williamr@4 | 12 |
// |
williamr@4 | 13 |
// Description: |
williamr@4 | 14 |
// |
williamr@4 | 15 |
|
williamr@4 | 16 |
|
williamr@4 | 17 |
#ifndef __MHTTPCONTENTSINK_H__ |
williamr@4 | 18 |
#define __MHTTPCONTENTSINK_H__ |
williamr@4 | 19 |
|
williamr@4 | 20 |
#include <e32base.h> |
williamr@4 | 21 |
|
williamr@4 | 22 |
class MHttpDataReceiver; |
williamr@4 | 23 |
/** |
williamr@4 | 24 |
* THttpContentSinkOp is an operator to retrieve/store/release the HTTP |
williamr@4 | 25 |
* content. The data consuming can be an asynchronous operation. After |
williamr@4 | 26 |
* consuming the data Release/Store function must be called. |
williamr@4 | 27 |
* |
williamr@4 | 28 |
* @publishedAll |
williamr@4 | 29 |
* @released |
williamr@4 | 30 |
*/ |
williamr@4 | 31 |
class THttpContentSinkOp |
williamr@4 | 32 |
{ |
williamr@4 | 33 |
friend class CHttpDataReceiver; |
williamr@4 | 34 |
public: |
williamr@4 | 35 |
IMPORT_C THttpContentSinkOp(); |
williamr@4 | 36 |
IMPORT_C TBool GetData(TPtrC8& aData); |
williamr@4 | 37 |
IMPORT_C void Release(); |
williamr@4 | 38 |
IMPORT_C void Store(); // Store into a file if a sink is provided. |
williamr@4 | 39 |
|
williamr@4 | 40 |
private: |
williamr@4 | 41 |
THttpContentSinkOp(MHttpDataReceiver& aSupplier); |
williamr@4 | 42 |
private: |
williamr@4 | 43 |
MHttpDataReceiver* iDataReceiver; |
williamr@4 | 44 |
}; |
williamr@4 | 45 |
|
williamr@4 | 46 |
/** |
williamr@4 | 47 |
* The implementation of MHttpContentSink can process the response body data If the application wants to |
williamr@4 | 48 |
* process/sink the data in different means then the client can insulate sink to a different sink |
williamr@4 | 49 |
* |
williamr@4 | 50 |
* @publishedAll |
williamr@4 | 51 |
* @prototype |
williamr@4 | 52 |
*/ |
williamr@4 | 53 |
|
williamr@4 | 54 |
class MHttpContentSink |
williamr@4 | 55 |
{ |
williamr@4 | 56 |
public: |
williamr@4 | 57 |
/** |
williamr@4 | 58 |
* Supply a part of the response body data. The data will survive till the THttpContentSinkOp::Release/Store |
williamr@4 | 59 |
* is called. application should process the data or keep a separate copy if it has to process the data at a |
williamr@4 | 60 |
* later stage. This function will be called when part of the body data is available |
williamr@4 | 61 |
* |
williamr@4 | 62 |
* @param aData Sink Operator |
williamr@4 | 63 |
*/ |
williamr@4 | 64 |
virtual void OnData(THttpContentSinkOp& aData) =0; |
williamr@4 | 65 |
|
williamr@4 | 66 |
private: |
williamr@4 | 67 |
// Reserved for future use. |
williamr@4 | 68 |
inline virtual void Reserved(); |
williamr@4 | 69 |
inline virtual void Reserved2(); |
williamr@4 | 70 |
}; |
williamr@4 | 71 |
|
williamr@4 | 72 |
inline void MHttpContentSink::Reserved() |
williamr@4 | 73 |
{ |
williamr@4 | 74 |
|
williamr@4 | 75 |
} |
williamr@4 | 76 |
|
williamr@4 | 77 |
inline void MHttpContentSink::Reserved2() |
williamr@4 | 78 |
{ |
williamr@4 | 79 |
|
williamr@4 | 80 |
} |
williamr@4 | 81 |
|
williamr@4 | 82 |
#endif // __MHTTPCONTENTSINK_H__ |