|
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 HTMLHANDLER_H |
|
17 #define HTMLHANDLER_H |
|
18 |
|
19 #include <xml/contenthandler.h> |
|
20 #include <xml/parser.h> |
|
21 class MBrowserTransactionObserver; |
|
22 |
|
23 class CHtmlHandler : public CBase, public Xml::MContentHandler |
|
24 { |
|
25 public: |
|
26 |
|
27 static CHtmlHandler* NewL ( MBrowserTransactionObserver& aObserver, const TDesC8& aType ); |
|
28 static CHtmlHandler* NewLC ( MBrowserTransactionObserver& aObserver, const TDesC8& aType ); |
|
29 |
|
30 ~CHtmlHandler (); |
|
31 |
|
32 // Virtual functions from MContentHandler |
|
33 void OnStartDocumentL( const Xml::RDocumentParameters &aDocParam, TInt aErrorCode ); |
|
34 void OnEndDocumentL( TInt aErrorCode ); |
|
35 void OnStartElementL( const Xml::RTagInfo &aElement, const Xml::RAttributeArray &aAttributes, TInt aErrorCode ); |
|
36 void OnEndElementL( const Xml::RTagInfo &aElement, TInt aErrorCode ); |
|
37 void OnContentL( const TDesC8 &aBytes, TInt aErrorCode ); |
|
38 void OnStartPrefixMappingL( const RString &aPrefix, const RString &aUri, TInt aErrorCode ); |
|
39 void OnEndPrefixMappingL( const RString &aPrefix, TInt aErrorCode ); |
|
40 void OnIgnorableWhiteSpaceL( const TDesC8 &aBytes, TInt aErrorCode ); |
|
41 void OnSkippedEntityL( const RString &aName, TInt aErrorCode ); |
|
42 void OnProcessingInstructionL( const TDesC8 &aTarget, const TDesC8 &aData, TInt aErrorCode ); |
|
43 void OnError( TInt aErrorCode ); |
|
44 TAny* GetExtendedInterface( const TInt32 aUid ); |
|
45 |
|
46 void ParseHtmlContentL ( const TDesC8& aContent ); |
|
47 |
|
48 void ParseEndL (); |
|
49 protected: |
|
50 CHtmlHandler ( MBrowserTransactionObserver& aObserver ); // constructor. |
|
51 void ConstructL ( const TDesC8& aType ); |
|
52 |
|
53 private: |
|
54 TBool GetAttributeValueL ( RString& aAttributeValue, const RString& aAttribute, const Xml::RAttributeArray& aAttributeArray ); |
|
55 |
|
56 private: |
|
57 RStringPool iStringPool; |
|
58 MBrowserTransactionObserver& iTransObserver; |
|
59 Xml::CParser* iHtmlParser; |
|
60 }; |
|
61 |
|
62 |
|
63 #endif // HTMLHANDLER_H |