|
1 /* |
|
2 * Copyright (c) 2002-2005 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 "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: Interface for SAX Parser Callback events. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MSENCONTENTHANDLERCLIENT_H |
|
19 #define __MSENCONTENTHANDLERCLIENT_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <stringpool.h> |
|
23 #include <xml/attribute.h> |
|
24 |
|
25 using namespace Xml; |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * Interface for SAX Parser Callback events. |
|
31 * If an application (client) needs to be informed of basic parsing events, |
|
32 * it implements this interface and registers an instance with the SAX parser |
|
33 * using the SetContentHandler() method. |
|
34 * The parser uses the instance to report basic document-related events like |
|
35 * the start and end of elements.* |
|
36 * |
|
37 * @lib SenXML.dll |
|
38 * @since Series60 3.0 |
|
39 */ |
|
40 class MSenContentHandlerClient |
|
41 { |
|
42 public: // New functions |
|
43 /** |
|
44 * Receive notification of the beginning of a document. |
|
45 * Called when OnStartDocumentL callback is received from Symbian XML framework. |
|
46 * @return KErrNone or some of the system-wide Symbian error codes. |
|
47 */ |
|
48 virtual TInt StartDocument() = 0; |
|
49 |
|
50 /** |
|
51 * Receive notification of the end of a document. |
|
52 * Called when OnEndDocumentL callback is received from Symbian XML framework. |
|
53 * @return KErrNone or some of the system-wide Symbian error codes. |
|
54 */ |
|
55 virtual TInt EndDocument() = 0; |
|
56 |
|
57 /** |
|
58 * Receive notification of the beginning of an element. |
|
59 * Called when OnStartElementL callback is received from Symbian XML framework. |
|
60 * @param aURI: The Namespace URI, or the empty string if the element |
|
61 * has no Namespace URI or if Namespace processing is not |
|
62 * being performed. |
|
63 * @param aLocalName: The local name (without prefix) |
|
64 * @param aName: The qualified name |
|
65 * @param apAttrs: The attributes attached to the element. |
|
66 * If there are no attributes, it shall be an empty array. |
|
67 * Namespaces declared in the current element will be |
|
68 * located in the array also. |
|
69 * |
|
70 * @return KErrNotSupported If the class implementing this |
|
71 * interface doesn't override this. |
|
72 * KErrNone or other system-wide Symbian error codes. |
|
73 */ |
|
74 inline virtual TInt StartElement( const TDesC8& /*aURI*/, |
|
75 const TDesC8& /*aLocalName*/, |
|
76 const TDesC8& /*aName*/, |
|
77 const RAttributeArray& /* apAttrs */) |
|
78 { |
|
79 return KErrNotSupported; |
|
80 } |
|
81 |
|
82 /** |
|
83 * Receive notification of the end of an element. |
|
84 * Called when OnEndElementL callback is received from Symbian XML framework. |
|
85 * @param aURI: The Namespace URI, or the empty string if the element |
|
86 * has no Namespace URI or if Namespace processing is not |
|
87 * being performed. |
|
88 * @param aLocalName: The local name (without prefix) |
|
89 * @param aName: The qualified name |
|
90 * |
|
91 * @return KErrNotSupported If the class implementing this |
|
92 * interface doesn't override this. |
|
93 * KErrNone or other system-wide Symbian error codes. |
|
94 */ |
|
95 inline virtual TInt EndElement( const TDesC8& /*aURI*/, |
|
96 const TDesC8& /*aLocalName*/, |
|
97 const TDesC8& /*aName*/) |
|
98 { |
|
99 return KErrNotSupported; |
|
100 } |
|
101 |
|
102 |
|
103 /** |
|
104 * Receive notification of character data inside an element. |
|
105 * Called when OnContentL callback is received from Symbian XML framework. |
|
106 * @param aBuff: The characters. |
|
107 * @param aStart: The start position in the character buffer. |
|
108 * @param aLength: The number of characters to use from the character buffer. |
|
109 * @return KErrNotSupported If the class implementing this |
|
110 * interface doesn't override this. |
|
111 * KErrNone or other system-wide Symbian error codes. |
|
112 */ |
|
113 inline virtual TInt Characters(const TDesC8& /*aBuf*/, |
|
114 const TInt /*aStart*/, |
|
115 const TInt /*aLength*/) |
|
116 { |
|
117 return KErrNotSupported; |
|
118 } |
|
119 |
|
120 /** |
|
121 * Receive notification of a processing instruction |
|
122 * Called when OnProcessingInstructionL callback is received from Symbian XML framework. |
|
123 * @deprefaceted This method is currently not in use - inlined. |
|
124 * @param aTarget: The processing instruction target. |
|
125 * @param aData: The processing instruction data, |
|
126 * or null if none is supplied. |
|
127 * @return KErrNotSupported If the class implementing this |
|
128 * interface doesn't override this. |
|
129 * KErrNone or other system-wide Symbian error codes. |
|
130 */ |
|
131 inline virtual TInt ProcessingInstructions(const TDesC8& /*aTarget*/, |
|
132 const TDesC8& /*aData*/) |
|
133 { |
|
134 return KErrNotSupported; |
|
135 } |
|
136 |
|
137 /** |
|
138 * Receive notification of a skipped entity. |
|
139 * Called when OnSkippedEntityL callback is received from Symbian XML framework. |
|
140 * @param aName: The name of the skipped entity. |
|
141 * @return KErrNotSupported If the class implementing this |
|
142 * interface doesn't override this. |
|
143 * KErrNone or other system-wide Symbian error codes. |
|
144 */ |
|
145 inline virtual TInt SkippedEntity(const TDesC8& /*aName*/) |
|
146 { |
|
147 return KErrNotSupported; |
|
148 } |
|
149 |
|
150 |
|
151 /** |
|
152 * Receive notification of error situation during parsing. |
|
153 * Called when OnError callback is received from Symbian XML framework. |
|
154 * Complete list of error codes is listed under <Xml\XmlFrameworkErrors.h> |
|
155 * @param aErrorCode: Error status code. |
|
156 * @param aSeverity: Error Severity. |
|
157 * @return KErrNotSupported If the class implementing this |
|
158 * interface doesn't override this. |
|
159 * KErrNone or other system-wide Symbian error codes. |
|
160 */ |
|
161 inline virtual TInt Error(TInt /*aErrorCode*/) |
|
162 { |
|
163 return KErrNotSupported; |
|
164 } |
|
165 |
|
166 /** |
|
167 * Receive notification of prefix mapping start. |
|
168 * Called when OnStartPrefixMappingL callback is received from Symbian XML framework. |
|
169 * @param aPrefix: The prefix |
|
170 * @param aUri: The URI mapped to the prefix. |
|
171 * @return KErrNotSupported If the class implementing this |
|
172 * interface doesn't override this. |
|
173 * KErrNone or other system-wide Symbian error codes. |
|
174 */ |
|
175 inline virtual TInt StartPrefixMappingL( const TDesC8& /* aPrefix */, |
|
176 const TDesC8& /* aUri */) |
|
177 { |
|
178 return KErrNotSupported; |
|
179 } |
|
180 |
|
181 /** |
|
182 * Receive notification of prefix mapping end. |
|
183 * Called when OnEndPrefixMappingL callback is received from Symbian XML framework. |
|
184 * @param aPrefix: The prefix |
|
185 * @return KErrNotSupported If the class implementing this |
|
186 * interface doesn't override this. |
|
187 * KErrNone or other system-wide Symbian error codes. |
|
188 */ |
|
189 inline virtual TInt EndPrefixMappingL(const TDesC8& /* aPrefix */) |
|
190 { |
|
191 return KErrNotSupported; |
|
192 } |
|
193 |
|
194 /** |
|
195 * Receive notification of ignorable whitespace in element content. |
|
196 * Called when OnIgnorableWhiteSpaceL callback is received from Symbian XML framework. |
|
197 * @param aBytes: The whitespace characters. |
|
198 * @return KErrNotSupported If the class implementing this |
|
199 * interface doesn't override this. |
|
200 * KErrNone or other system-wide Symbian error codes. |
|
201 */ |
|
202 inline virtual TInt OnIgnorableWhiteSpaceL(const TDesC8& /* aBytes */) |
|
203 { |
|
204 return KErrNotSupported; |
|
205 } |
|
206 |
|
207 /** |
|
208 * Method obtains the interface matching the specified UID. |
|
209 * @param aUid the UID identifying the required interface. |
|
210 * @return NULL if no interface matching the UID is found or method is not |
|
211 * overridden in the implementing class. |
|
212 * Otherwise, the this pointer cast to that interface. |
|
213 */ |
|
214 inline virtual TAny* GetExtendedInterface(const TInt32 /* aUid */) |
|
215 { |
|
216 return NULL; |
|
217 } |
|
218 }; |
|
219 |
|
220 #endif // __MSENCONTENTHANDLERCLIENT_H |
|
221 |
|
222 // End of File |