So far, my concept app using browser control on 5800 seems very promising, but the control will only display the remote page when it is completely downloaded and parsed. It takes too long even for a moderate sized page. The solution to this is incrementally receiving and parsing the documents.

The pre-installed webkit based browser really does good on this, and it should be, with such a powerful browser core inside.

In the "Browser Control API Developer’s Guide", it does have a chapter dedicated on "Passing content incrementally". After carefully reading this chapter and the provided sample code, currently I came to the conclusion that it is not that simple to enable incremental page loading using browser control.


The key method is:
Code:
        /**
        * Request the Browser Control to display content incrementaly
        * @since 2.8
        * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:"
        * @param aDataType The data type of the data
        * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1
        * @param aContentLength The length of the content.
        * @param aBrCtlDataLoadSupplier A callback interface to stop passing data if an error occured in the Browser Control
        * @param aBrCtlDataLoadConsumer A callback interface returned by the browser. Data should be passed to that interface
        * @return void
        * @attension If you use this function, the Browser Control does not keep
        * track of the history.If the content type of the data is not markup, Browser
        * Control uses the Special Load Observer to pass the content back to the Host
        * Application. The Special Load Observer uses the Document Handler to send
        * the content to the proper application.
        */
        // The url scheme must be "data:" The url is needed as reference to this load request
        IMPORT_C virtual void InitLoadDataL(const TDesC& aUrl,
                                    const TDataType& aDataType,
                                    TUid aCharsetUid,
                                    TUint aContentLength,
                                    MBrCtlDataLoadSupplier* aBrCtlDataLoadSupplier,
                                    MBrCtlDataLoadConsumer** aBrCtlDataLoadConsumer) = 0;
The documents is fairly good here. "MBrCtlDataLoadSupplier" and "MBrCtlDataLoadConsumer" are the two interesting parts here. The first one should be implements by third party developers, like me; the second one, in my opinion, after invocation, should point to a wrapper of the actual brower engine.

The "MBrCtlDataLoadConsumer" interface:
Code:
/**
* The MBrCtlDataLoadConsumer class is a callback interface that provides
* the Browser Control with the ability to receive content incrementally.
*
* @code
*  #include <BrCtlInterface.h>
* @see S60 Platform: Browser Control API Developer's Guide Version 2.0
* @lib BrowserEngine.lib
* @since 2.8
* @file BrCtlInterface.h
* @endcode     *
*/
class MBrCtlDataLoadConsumer
    {
    public: // New functions
        /**
        * Pass the next data chunk
        * @since 2.8
        * @param aData The data chunk to process
        * @return void
        */
        virtual void HandleNextDataChunk(const TDesC8& aData) = 0;

        /**
        * Inform the Browser Control about completion of data load
        * @since 2.8
        * @return void
        */
        virtual void HandleLoadComplete() = 0;

        /**
        * Inform the Browser Control that an error occured
        * if HandleError() is called, then LoadComplete() is infered.
        * @since 2.8
        * @param aError The error code
        * @return void
        */
        virtual void HandleError(TInt aError) = 0;
    };
The problem is, if I take this approach to enable incremental loading, I have to be a "supplier", receiving data from remote server, then feed the engine with the data I received by invoking "HandleNextDataChunk". But how could it be possible with remote documents? I need to manage the connections, parsing HTTP headers, not to mention the cookies, etc. It is for sure all of these are already perfectly implemented in browser control, why I need to do this again? And personally I don't think I am able to ...

Correct me if you have any good ideas or suggestions, it will be very helpful.

Thanks in advance.