|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 * DO NOT USE THIS API. DEPRECATED AND REMOVED IN S60 5.0. USE SYMBIAN XML FRAMEWORK INSTEAD. |
|
26 */ |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 #ifndef __MXMLCONTENTHANDLER_H |
|
39 #define __MXMLCONTENTHANDLER_H |
|
40 |
|
41 // INCLUDES |
|
42 #include <MXMLAttributes.h> |
|
43 #include <cxml_nw2cxmltypes.h> |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 /** |
|
48 * Interface for SAX Parser Callback events. |
|
49 * If an application (client) needs to be informed of basic parsing events, |
|
50 * it implements this interface and registers an instance with the SAX parser using the SetContentHandler() method. |
|
51 * The parser uses the instance to report basic document-related events like the start and end of elements. |
|
52 * |
|
53 * @lib XMLInterface.dll |
|
54 * @since ?Series60_version |
|
55 */ |
|
56 class MXMLContentHandler |
|
57 { |
|
58 public: |
|
59 /** |
|
60 * Receive notification of the beginning of a document. |
|
61 * @since ?Series60_version |
|
62 * @param none |
|
63 * @return none |
|
64 */ |
|
65 virtual TInt StartDocument() = 0; |
|
66 |
|
67 /** |
|
68 * Receive notification of the end of a document. |
|
69 * @since ?Series60_version |
|
70 * @param none |
|
71 * @return none |
|
72 */ |
|
73 virtual TInt EndDocument() = 0; |
|
74 |
|
75 /** |
|
76 * Receive notification of the beginning of an element. |
|
77 * @since ?Series60_version |
|
78 * @param aURI: The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace |
|
79 * processing is not being performed. |
|
80 * @param aLocalName: The local name (without prefix), or the empty string if Namespace processing is not being |
|
81 * performed. |
|
82 * @param aName: The qualified name, or the empty string if qualified names are not available. |
|
83 * @param aAttributeList: The attributes attached to the element. If there are no attributes, it shall be an |
|
84 * empty Attributes object. |
|
85 * |
|
86 * @return 1 if success 0 if failure. |
|
87 */ |
|
88 inline virtual TInt StartElement(TDesC& /*aURI*/, TDesC& /*aLocalName*/, TDesC& /*aName*/, MXMLAttributes* /*aAttributeList*/){return 1;} |
|
89 |
|
90 /** |
|
91 * Receive notification of the end of an element. |
|
92 * @since ?Series60_version |
|
93 * @param aURI: The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace |
|
94 * processing is not being performed. |
|
95 * @param aLocalName: The local name (without prefix), or the empty string if Namespace processing is not being |
|
96 * performed. |
|
97 * @param aName: The qualified name, or the empty string if qualified names are not available. |
|
98 * @return 1 if success 0 if failure. |
|
99 */ |
|
100 inline virtual TInt EndElement(TDesC& /*aURI*/, TDesC& /*aLocalName*/, TDesC& /*aName*/){return 1;} |
|
101 |
|
102 /** |
|
103 * Receive notification of character data inside an element. |
|
104 * @since ?Series60_version |
|
105 * @param aBuff: The characters. |
|
106 * @param aStart: The start position in the character buffer. |
|
107 * @param aLength: The number of characters to use from the character buffer. |
|
108 * @return 1 if success 0 if failure. |
|
109 */ |
|
110 inline virtual TInt Charecters(TDesC& /*aBuf*/, TInt /*aStart*/, TInt /*aLength*/){return 1;} |
|
111 |
|
112 /** |
|
113 * Receive notification of XML comment. |
|
114 * @since ?Series60_version |
|
115 * @param aComment: Buffer containing the comment. |
|
116 * @return 1 if success 0 if failure. |
|
117 */ |
|
118 inline virtual TInt Comment(TDesC& /*aComment*/){return 1;} |
|
119 |
|
120 /** |
|
121 * Receive notification of a processing instruction |
|
122 * @since ?Series60_version |
|
123 * @param aTarget: The processing instruction target. |
|
124 * @param aData: The processing instruction data, or null if none is supplied. |
|
125 * @return 1 if success 0 if failure. |
|
126 */ |
|
127 inline virtual TInt ProcessingInstructions(TDesC& /*aTarget*/, TDesC& /*aData*/){return 1;} |
|
128 |
|
129 /** |
|
130 * Receive notification of ignorable whitespace in element content. |
|
131 * @since ?Series60_version |
|
132 * @param aString: The whitespace characters. |
|
133 * @return 1 if success 0 if failure. |
|
134 */ |
|
135 // R&D: Feature: IgnoreWhiteSpace missing from XMLInterface |
|
136 inline virtual TInt IgnoreWhiteSpace(TDesC& /*aString*/){return 1;}; |
|
137 |
|
138 /** |
|
139 * Receive notification of beginning of some internal and external XML entities. |
|
140 * @since ?Series60_version |
|
141 * @param aName: The name of the entity. |
|
142 * @return 1 if success 0 if failure. |
|
143 */ |
|
144 |
|
145 inline virtual TInt StartEntity(TDesC& /*aName*/){return 1;}; |
|
146 |
|
147 /** |
|
148 * Receive notification of end of XML entities. |
|
149 * @since ?Series60_version |
|
150 * @param aName: The name of the entity. |
|
151 * @return 1 if success 0 if failure. |
|
152 */ |
|
153 |
|
154 inline virtual TInt EndEntity(TDesC& /*aName*/){return 1;} |
|
155 |
|
156 /** |
|
157 * Receive notification of a skipped entity. |
|
158 * @since ?Series60_version |
|
159 * @param aName: The name of the skipped entity. |
|
160 * @return 1 if success 0 if failure. |
|
161 */ |
|
162 // R&D: Feature: SkippedEntity missing from XMLInterface |
|
163 inline virtual TInt SkippedEntity(TDesC& /*aName*/){return 1;} |
|
164 |
|
165 /** |
|
166 * Receive notification of beginning of CData section. |
|
167 * @since ?Series60_version |
|
168 * @param none |
|
169 * @return 1 if success 0 if failure. |
|
170 */ |
|
171 inline virtual TInt StartCDATA(){return 1;} |
|
172 |
|
173 /** |
|
174 * Receive notification of end of CData section. |
|
175 * @since ?Series60_version |
|
176 * @param aName: none. |
|
177 * @return 1 if success 0 if failure. |
|
178 */ |
|
179 inline virtual TInt EndCDATA(){return 1;} |
|
180 |
|
181 /** |
|
182 * Receive notification of error situation during parsing. |
|
183 * @since ?Series60_version |
|
184 * @param aErrorCode: Error status code. |
|
185 * @param aSeverity: Error Severity. |
|
186 * @return 1 if success 0 if failure. |
|
187 */ |
|
188 inline virtual TInt Error(TInt /*aErrorCode*/, TInt /*aSeverity*/){return 1;} |
|
189 |
|
190 /** |
|
191 * Returns parsed buffer to client. |
|
192 * @since Series60 3.1 |
|
193 * @param aBuf Buffer with parsed data. |
|
194 */ |
|
195 inline virtual void DataBuffer(const TDesC16& /*aBuf*/){return;} |
|
196 |
|
197 /** |
|
198 * Returns reader index |
|
199 * @since Series60 3.1 |
|
200 * @param aIndex - reader index |
|
201 */ |
|
202 inline virtual void ReaderIndex(NW_Uint32 /*aIndex*/){return;} |
|
203 |
|
204 |
|
205 }; |
|
206 |
|
207 |
|
208 #endif // __MXMLCONTENTHANDLER_H |
|
209 |
|
210 // End of File |