|
1 // Copyright (c) 2003-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 __PARSER_H__ |
|
17 #define __PARSER_H__ |
|
18 |
|
19 /** |
|
20 @file |
|
21 |
|
22 XML Framework CParser API header file. |
|
23 |
|
24 @publishedAll |
|
25 @released |
|
26 */ |
|
27 |
|
28 #include <stringpool.h> |
|
29 #include <xml/contentprocessoruids.h> // needed for the typedef |
|
30 |
|
31 |
|
32 class RFs; |
|
33 class RFile; |
|
34 |
|
35 namespace Xml |
|
36 { |
|
37 |
|
38 class MContentHandler; |
|
39 class RStringDictionaryCollection; |
|
40 class TParserImpl; |
|
41 class CMatchData; |
|
42 |
|
43 /** |
|
44 If you need to parse xml this is the class you need to use. |
|
45 |
|
46 Default plain-text XML parser plug-in supports following character set encodings: |
|
47 |
|
48 ISO_8859_1 |
|
49 US_ASCII |
|
50 UTF_8 |
|
51 UTF_16 |
|
52 UTF_16BE |
|
53 UTF_16LE |
|
54 |
|
55 @publishedAll |
|
56 @released |
|
57 */ |
|
58 class CParser : public CBase |
|
59 { |
|
60 public: |
|
61 static IMPORT_C CParser* NewL(const TDesC8& aParserMimeType, MContentHandler& aCallback); |
|
62 static IMPORT_C CParser* NewLC(const TDesC8& aParserMimeType, MContentHandler& aCallback); |
|
63 |
|
64 static IMPORT_C CParser* NewL(const CMatchData& aCriteria, MContentHandler& aCallback); |
|
65 static IMPORT_C CParser* NewLC(const CMatchData& aCriteria, MContentHandler& aCallback); |
|
66 |
|
67 virtual ~CParser(); |
|
68 |
|
69 IMPORT_C void ParseBeginL(); |
|
70 IMPORT_C void ParseBeginL(const TDesC8& aDocumentMimeType); |
|
71 IMPORT_C void ParseBeginL(const CMatchData& aCriteria); |
|
72 IMPORT_C void ParseL(const TDesC8& aFragment); |
|
73 IMPORT_C void ParseEndL(); |
|
74 |
|
75 IMPORT_C void SetProcessorChainL(const RContentProcessorUids& aPlugins); |
|
76 |
|
77 IMPORT_C TInt EnableFeature(TInt aParserFeature); |
|
78 IMPORT_C TInt DisableFeature(TInt aParserFeature); |
|
79 IMPORT_C TBool IsFeatureEnabled(TInt aParserFeature) const; |
|
80 |
|
81 IMPORT_C void AddPreloadedDictionaryL(const TDesC8& aPublicId); |
|
82 |
|
83 IMPORT_C RStringPool& StringPool(); |
|
84 IMPORT_C RStringDictionaryCollection& StringDictionaryCollection(); |
|
85 |
|
86 private: |
|
87 CParser(); |
|
88 void ConstructL(const TDesC8& aParserMimeType, MContentHandler& aCallback); |
|
89 void ConstructL(const CMatchData& aMatchData, MContentHandler& aCallback); |
|
90 TParserImpl* iImpl; |
|
91 }; |
|
92 |
|
93 IMPORT_C void ParseL(CParser& aParser, const TDesC8& aDocument); |
|
94 IMPORT_C void ParseL(CParser& aParser, RFs& aFs, const TDesC& aFilename); |
|
95 IMPORT_C void ParseL(CParser& aParser, RFile& aFile); |
|
96 } |
|
97 |
|
98 #endif //__PARSER_H__ |