1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/mhttpcontentsink.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,82 @@
1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +#ifndef __MHTTPCONTENTSINK_H__
1.21 +#define __MHTTPCONTENTSINK_H__
1.22 +
1.23 +#include <e32base.h>
1.24 +
1.25 +class MHttpDataReceiver;
1.26 +/**
1.27 + * THttpContentSinkOp is an operator to retrieve/store/release the HTTP
1.28 + * content. The data consuming can be an asynchronous operation. After
1.29 + * consuming the data Release/Store function must be called.
1.30 + *
1.31 + * @publishedAll
1.32 + * @released
1.33 + */
1.34 +class THttpContentSinkOp
1.35 + {
1.36 + friend class CHttpDataReceiver;
1.37 + public:
1.38 + IMPORT_C THttpContentSinkOp();
1.39 + IMPORT_C TBool GetData(TPtrC8& aData);
1.40 + IMPORT_C void Release();
1.41 + IMPORT_C void Store(); // Store into a file if a sink is provided.
1.42 +
1.43 + private:
1.44 + THttpContentSinkOp(MHttpDataReceiver& aSupplier);
1.45 + private:
1.46 + MHttpDataReceiver* iDataReceiver;
1.47 + };
1.48 +
1.49 +/**
1.50 + * The implementation of MHttpContentSink can process the response body data If the application wants to
1.51 + * process/sink the data in different means then the client can insulate sink to a different sink
1.52 + *
1.53 + * @publishedAll
1.54 + * @prototype
1.55 + */
1.56 +
1.57 +class MHttpContentSink
1.58 + {
1.59 + public:
1.60 + /**
1.61 + * Supply a part of the response body data. The data will survive till the THttpContentSinkOp::Release/Store
1.62 + * is called. application should process the data or keep a separate copy if it has to process the data at a
1.63 + * later stage. This function will be called when part of the body data is available
1.64 + *
1.65 + * @param aData Sink Operator
1.66 + */
1.67 + virtual void OnData(THttpContentSinkOp& aData) =0;
1.68 +
1.69 + private:
1.70 + // Reserved for future use.
1.71 + inline virtual void Reserved();
1.72 + inline virtual void Reserved2();
1.73 + };
1.74 +
1.75 +inline void MHttpContentSink::Reserved()
1.76 + {
1.77 +
1.78 + }
1.79 +
1.80 +inline void MHttpContentSink::Reserved2()
1.81 + {
1.82 +
1.83 + }
1.84 +
1.85 +#endif // __MHTTPCONTENTSINK_H__