applayerprotocols/httpexamples/TestWebBrowser/htmlparserplugin/inc/HtmlParserPlugin.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2005-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef _HTML_PARSER_PLUGIN_H
       
    17 #define _HTML_PARSER_PLUGIN_H
       
    18 
       
    19 #include <xml/plugins/parserinterface.h>
       
    20 #include <xml/plugins/parserinitparams.h>
       
    21 
       
    22 class CHtmlParser;
       
    23 
       
    24 class CHtmlParserPlugin : public CBase, public Xml::MParser
       
    25 {
       
    26 public:
       
    27 	/*
       
    28 	EcomNewL function intended for construction by Ecom of implementation MParser interface.
       
    29 	*/
       
    30 	static Xml::MParser* EcomNewL( TAny* aInitParams );
       
    31 
       
    32 	/*
       
    33 	This class has a private destructor.  The Xml Framework destroys the parser using this Release method.
       
    34 	*/
       
    35 	void Release();
       
    36 
       
    37 	/*
       
    38 	Standard NewL function.  This function is used by EcomNewL but has been provided separately for
       
    39 	testing purposes.
       
    40 	*/
       
    41 	static CHtmlParserPlugin* NewL( TAny* aInitParams );
       
    42 
       
    43 	/*
       
    44 	Implementation of MParser interface
       
    45 	*/
       
    46 	TInt EnableFeature( TInt aParserFeature );
       
    47 	TInt DisableFeature( TInt aParserFeature );
       
    48 	TBool IsFeatureEnabled( TInt aParserFeature ) const;
       
    49 	void ParseChunkL( const TDesC8& aChunk );
       
    50 	void ParseLastChunkL( const TDesC8& aFinalChunk );
       
    51 
       
    52 	void SetContentSink( Xml::MContentHandler& aContentHandler );
       
    53 	
       
    54 	RStringPool& StringPool();
       
    55 
       
    56 protected:
       
    57 	void ConstructL ();
       
    58 private:
       
    59 	CHtmlParserPlugin( Xml::MContentHandler* aContentHandler );
       
    60 	void ConstructL( Xml::RStringDictionaryCollection* aStringDictionaryCollection );
       
    61 	void ParseChunkInPartsL( const TDesC8& aChunk, TBool aLast = EFalse );
       
    62 	virtual ~CHtmlParserPlugin();
       
    63 
       
    64 private:	
       
    65 	/*
       
    66 	References to client-provided objects
       
    67 	*/
       
    68 	Xml::MContentHandler& iContentHandler;
       
    69 	
       
    70 	CHtmlParser* iHtmlParser;
       
    71 };
       
    72 
       
    73 #endif // _HTML_PARSER_PLUGIN_H