2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Interface for SAX Parser Callback events.
18 #ifndef __MSENCONTENTHANDLERCLIENT_H
19 #define __MSENCONTENTHANDLERCLIENT_H
22 #include <stringpool.h>
23 #include <xml/attribute.h>
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.*
40 class MSenContentHandlerClient
42 public: // New functions
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.
48 virtual TInt StartDocument() = 0;
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.
55 virtual TInt EndDocument() = 0;
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
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.
70 * @return KErrNotSupported If the class implementing this
71 * interface doesn't override this.
72 * KErrNone or other system-wide Symbian error codes.
74 inline virtual TInt StartElement( const TDesC8& /*aURI*/,
75 const TDesC8& /*aLocalName*/,
76 const TDesC8& /*aName*/,
77 const RAttributeArray& /* apAttrs */)
79 return KErrNotSupported;
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
88 * @param aLocalName: The local name (without prefix)
89 * @param aName: The qualified name
91 * @return KErrNotSupported If the class implementing this
92 * interface doesn't override this.
93 * KErrNone or other system-wide Symbian error codes.
95 inline virtual TInt EndElement( const TDesC8& /*aURI*/,
96 const TDesC8& /*aLocalName*/,
97 const TDesC8& /*aName*/)
99 return KErrNotSupported;
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.
113 inline virtual TInt Characters(const TDesC8& /*aBuf*/,
114 const TInt /*aStart*/,
115 const TInt /*aLength*/)
117 return KErrNotSupported;
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.
131 inline virtual TInt ProcessingInstructions(const TDesC8& /*aTarget*/,
132 const TDesC8& /*aData*/)
134 return KErrNotSupported;
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.
145 inline virtual TInt SkippedEntity(const TDesC8& /*aName*/)
147 return KErrNotSupported;
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.
161 inline virtual TInt Error(TInt /*aErrorCode*/)
163 return KErrNotSupported;
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.
175 inline virtual TInt StartPrefixMappingL( const TDesC8& /* aPrefix */,
176 const TDesC8& /* aUri */)
178 return KErrNotSupported;
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.
189 inline virtual TInt EndPrefixMappingL(const TDesC8& /* aPrefix */)
191 return KErrNotSupported;
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.
202 inline virtual TInt OnIgnorableWhiteSpaceL(const TDesC8& /* aBytes */)
204 return KErrNotSupported;
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.
214 inline virtual TAny* GetExtendedInterface(const TInt32 /* aUid */)
220 #endif // __MSENCONTENTHANDLERCLIENT_H