williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Class implements DOM fragment functionality
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#ifndef SEN_DOM_FRAGMENT_H
|
williamr@2
|
26 |
#define SEN_DOM_FRAGMENT_H
|
williamr@2
|
27 |
|
williamr@2
|
28 |
// INCLUDES
|
williamr@2
|
29 |
#include <SenBaseFragment.h>
|
williamr@2
|
30 |
|
williamr@2
|
31 |
// FORWARD DECLARATIONS
|
williamr@2
|
32 |
class RFileLogger;
|
williamr@2
|
33 |
|
williamr@2
|
34 |
// CLASS DECLARATION
|
williamr@2
|
35 |
|
williamr@2
|
36 |
/**
|
williamr@2
|
37 |
* Class implements DOM fragment functionality
|
williamr@2
|
38 |
* The implementation further extends CSenBaseFragment
|
williamr@2
|
39 |
* functionality. In DOM fragment, all child elements
|
williamr@2
|
40 |
* are parsed into separate element objects. This makes
|
williamr@2
|
41 |
* it possible to reference any child which offer methods
|
williamr@2
|
42 |
* declared in XML element interface. Any such element
|
williamr@2
|
43 |
* can also be easily extracted (detached) from this
|
williamr@2
|
44 |
* root DOM fragmet.
|
williamr@2
|
45 |
* @lib SenXML.dll
|
williamr@2
|
46 |
* @since Series60 3.0
|
williamr@2
|
47 |
*/
|
williamr@2
|
48 |
class CSenDomFragment : public CSenBaseFragment
|
williamr@2
|
49 |
{
|
williamr@2
|
50 |
public: // Constructors and destructor
|
williamr@2
|
51 |
|
williamr@2
|
52 |
/**
|
williamr@2
|
53 |
* Basic contructor. Should be used only for parsing new fragments etc.
|
williamr@2
|
54 |
* Constructing DomFragments for other use should be done with at least
|
williamr@2
|
55 |
* localname parameter.
|
williamr@2
|
56 |
* @since Series60 3.0
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
IMPORT_C static CSenDomFragment* NewL();
|
williamr@2
|
59 |
|
williamr@2
|
60 |
/**
|
williamr@2
|
61 |
* Basic constructor.
|
williamr@2
|
62 |
* @since Series60 3.0
|
williamr@2
|
63 |
* @param aElement Element to copy construction data from.
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
IMPORT_C static CSenDomFragment* NewL(
|
williamr@2
|
66 |
const CSenElement& aElement);
|
williamr@2
|
67 |
|
williamr@2
|
68 |
/**
|
williamr@2
|
69 |
* Basic constructor.
|
williamr@2
|
70 |
* @since Series60 3.0
|
williamr@2
|
71 |
* @param aLocalName is the XML localname of this fragment
|
williamr@2
|
72 |
* Leave codes:
|
williamr@2
|
73 |
* KErrSenInvalidCharacters if aLocalName contains
|
williamr@2
|
74 |
* illegal characters.
|
williamr@2
|
75 |
* KErrSenZeroLengthDescriptor if aLocalName is zero length.
|
williamr@2
|
76 |
*/
|
williamr@2
|
77 |
IMPORT_C static CSenDomFragment* NewL(const TDesC8& aLocalName);
|
williamr@2
|
78 |
|
williamr@2
|
79 |
/**
|
williamr@2
|
80 |
* Basic constructor.
|
williamr@2
|
81 |
* @since Series60 3.0
|
williamr@2
|
82 |
* @param aNsUri is the XML namespace user of this fragment
|
williamr@2
|
83 |
* @param aLocalName is the XML localname of this fragment
|
williamr@2
|
84 |
* Leave codes:
|
williamr@2
|
85 |
* KErrSenInvalidCharacters if aLocalName contains
|
williamr@2
|
86 |
* illegal characters.
|
williamr@2
|
87 |
* KErrSenZeroLengthDescriptor if aLocalName is zero length.
|
williamr@2
|
88 |
*/
|
williamr@2
|
89 |
IMPORT_C static CSenDomFragment* NewL(const TDesC8& aNsUri,
|
williamr@2
|
90 |
const TDesC8& aLocalName);
|
williamr@2
|
91 |
|
williamr@2
|
92 |
/**
|
williamr@2
|
93 |
* Basic constructor.
|
williamr@2
|
94 |
* @since Series60 3.0
|
williamr@2
|
95 |
* @param aNsUri is the XML namespace user of this fragment
|
williamr@2
|
96 |
* @param aLocalName is the XML localname of this fragment
|
williamr@2
|
97 |
* @param aQName is the XML qualifiedname of this fragment
|
williamr@2
|
98 |
* Leave codes:
|
williamr@2
|
99 |
* KErrSenInvalidCharacters if aLocalName or aQName contains
|
williamr@2
|
100 |
* illegal characters.
|
williamr@2
|
101 |
* KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
|
williamr@2
|
102 |
*/
|
williamr@2
|
103 |
IMPORT_C static CSenDomFragment* NewL(const TDesC8& aNsUri,
|
williamr@2
|
104 |
const TDesC8& aLocalName,
|
williamr@2
|
105 |
const TDesC8& aQName);
|
williamr@2
|
106 |
|
williamr@2
|
107 |
/**
|
williamr@2
|
108 |
* Basic constructor.
|
williamr@2
|
109 |
* @since Series60 3.0
|
williamr@2
|
110 |
* @param aNsUri is the XML namespace of this fragment
|
williamr@2
|
111 |
* @param aLocalName is the XML localname of this fragment
|
williamr@2
|
112 |
* @param aQName is the qualifiedname of this fragment
|
williamr@2
|
113 |
* @param aAttrs are the XML attributes of this fragment
|
williamr@2
|
114 |
* Leave codes:
|
williamr@2
|
115 |
* KErrSenInvalidCharacters if aLocalName or aQName contains
|
williamr@2
|
116 |
* illegal characters.
|
williamr@2
|
117 |
* KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
|
williamr@2
|
118 |
*/
|
williamr@2
|
119 |
IMPORT_C static CSenDomFragment* NewL(const TDesC8& aNsUri,
|
williamr@2
|
120 |
const TDesC8& aLocalName,
|
williamr@2
|
121 |
const TDesC8& aQName,
|
williamr@2
|
122 |
const RAttributeArray& aAttrs);
|
williamr@2
|
123 |
|
williamr@2
|
124 |
/**
|
williamr@2
|
125 |
* Basic constructor.
|
williamr@2
|
126 |
* @since Series60 3.0
|
williamr@2
|
127 |
* @param aNsUri is the XML namespace of this fragment
|
williamr@2
|
128 |
* @param aLocalName is the XML localname of this fragment
|
williamr@2
|
129 |
* @param aQName is the qualifiedname of this fragment
|
williamr@2
|
130 |
* @param aAttrs are the XML attributes of this fragment
|
williamr@2
|
131 |
* @param aParent is the parent XML element of this fragment
|
williamr@2
|
132 |
* Leave codes:
|
williamr@2
|
133 |
* KErrSenInvalidCharacters if aLocalName or aQName contains
|
williamr@2
|
134 |
* illegal characters.
|
williamr@2
|
135 |
* KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
|
williamr@2
|
136 |
*/
|
williamr@2
|
137 |
IMPORT_C static CSenDomFragment* NewL(const TDesC8& aNsUri,
|
williamr@2
|
138 |
const TDesC8& aLocalName,
|
williamr@2
|
139 |
const TDesC8& aQName,
|
williamr@2
|
140 |
const RAttributeArray& aAttrs,
|
williamr@2
|
141 |
CSenElement& aParent);
|
williamr@2
|
142 |
|
williamr@2
|
143 |
/**
|
williamr@2
|
144 |
* Destructor.
|
williamr@2
|
145 |
*/
|
williamr@2
|
146 |
IMPORT_C virtual ~CSenDomFragment();
|
williamr@2
|
147 |
|
williamr@2
|
148 |
// New functions
|
williamr@2
|
149 |
|
williamr@2
|
150 |
/**
|
williamr@2
|
151 |
* Initiates the parsing chain where new delegate will be created with
|
williamr@2
|
152 |
* given parameters and parsing will be delegated to it. Should not be
|
williamr@2
|
153 |
* called externally.
|
williamr@2
|
154 |
* @since Series60 3.0
|
williamr@2
|
155 |
* @param aNsUri The namespace URI of the new element
|
williamr@2
|
156 |
* @param aLocalName The local name of the new element
|
williamr@2
|
157 |
* @param aQName The qualified name of the new element
|
williamr@2
|
158 |
* @param aAttrs The attributes of the new element
|
williamr@2
|
159 |
*/
|
williamr@2
|
160 |
IMPORT_C virtual void ExpandL(const TDesC8& aNsUri,
|
williamr@2
|
161 |
const TDesC8& aLocalName,
|
williamr@2
|
162 |
const TDesC8& aQName,
|
williamr@2
|
163 |
const RAttributeArray& aAttrs);
|
williamr@2
|
164 |
|
williamr@2
|
165 |
// Functions from base classes
|
williamr@2
|
166 |
|
williamr@2
|
167 |
// From CSenBaseFragment
|
williamr@2
|
168 |
|
williamr@2
|
169 |
/**
|
williamr@2
|
170 |
* Resumes the parsing. Usually called by the delegate fragment which was
|
williamr@2
|
171 |
* parsing itself after DelegateParsingL().
|
williamr@2
|
172 |
* @since Series60 3.0
|
williamr@2
|
173 |
* @param aNsUri The namespace URI of the current element
|
williamr@2
|
174 |
* @param aLocalName The local name of the current element
|
williamr@2
|
175 |
* @param aQName The qualified name of the current element
|
williamr@2
|
176 |
*/
|
williamr@2
|
177 |
IMPORT_C void ResumeParsingFromL(const TDesC8& aNsUri,
|
williamr@2
|
178 |
const TDesC8& aLocalName,
|
williamr@2
|
179 |
const TDesC8& aQName);
|
williamr@2
|
180 |
|
williamr@2
|
181 |
/**
|
williamr@2
|
182 |
* Sets the reader for this fragment and sets this to be the
|
williamr@2
|
183 |
* content handler of the following SAX events.
|
williamr@2
|
184 |
* @since Series60 3.0
|
williamr@2
|
185 |
* @param aReader: Reader to be used.
|
williamr@2
|
186 |
*/
|
williamr@2
|
187 |
IMPORT_C virtual void ParseWithL(CSenXmlReader& aReader);
|
williamr@2
|
188 |
|
williamr@2
|
189 |
/**
|
williamr@2
|
190 |
* Sets the attributes for the fragment.
|
williamr@2
|
191 |
* @since Series60 3.0
|
williamr@2
|
192 |
* @param aAttrs the array of attributes.
|
williamr@2
|
193 |
*/
|
williamr@2
|
194 |
IMPORT_C virtual void SetAttributesL(const RAttributeArray& aAttrs);
|
williamr@2
|
195 |
|
williamr@2
|
196 |
protected:
|
williamr@2
|
197 |
|
williamr@2
|
198 |
/**
|
williamr@2
|
199 |
* C++ default constructor.
|
williamr@2
|
200 |
*/
|
williamr@2
|
201 |
IMPORT_C CSenDomFragment();
|
williamr@2
|
202 |
|
williamr@2
|
203 |
/**
|
williamr@2
|
204 |
* "ConstructL" method for calling the base classes ones.
|
williamr@2
|
205 |
* @since Series60 3.0
|
williamr@2
|
206 |
* @param aElement is the XML element of this fragment.
|
williamr@2
|
207 |
*/
|
williamr@2
|
208 |
IMPORT_C void BaseConstructL(const CSenElement& aElement);
|
williamr@2
|
209 |
|
williamr@2
|
210 |
/**
|
williamr@2
|
211 |
* "ConstructL" method for calling the base classes ones.
|
williamr@2
|
212 |
* @since Series60 3.0
|
williamr@2
|
213 |
* @param aLocalName The local name of the element
|
williamr@2
|
214 |
*/
|
williamr@2
|
215 |
IMPORT_C void BaseConstructL(const TDesC8& aLocalName);
|
williamr@2
|
216 |
|
williamr@2
|
217 |
/**
|
williamr@2
|
218 |
* "ConstructL" method for calling the base classes ones.
|
williamr@2
|
219 |
* @since Series60 3.0
|
williamr@2
|
220 |
* @param aNsUri The namespace URI of the element
|
williamr@2
|
221 |
* @param aLocalName The local name of the element
|
williamr@2
|
222 |
*/
|
williamr@2
|
223 |
IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
|
williamr@2
|
224 |
const TDesC8& aLocalName);
|
williamr@2
|
225 |
|
williamr@2
|
226 |
/**
|
williamr@2
|
227 |
* "ConstructL" method for calling the base classes ones.
|
williamr@2
|
228 |
* @since Series60 3.0
|
williamr@2
|
229 |
* @param aNsUri The namespace URI of the element
|
williamr@2
|
230 |
* @param aLocalName The local name of the element
|
williamr@2
|
231 |
* @param aQName The qualified name of the element
|
williamr@2
|
232 |
*/
|
williamr@2
|
233 |
IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
|
williamr@2
|
234 |
const TDesC8& aLocalName,
|
williamr@2
|
235 |
const TDesC8& aQName);
|
williamr@2
|
236 |
|
williamr@2
|
237 |
/**
|
williamr@2
|
238 |
* "ConstructL" method for calling the base classes ones.
|
williamr@2
|
239 |
* @since Series60 3.0
|
williamr@2
|
240 |
* @param aNsUri The namespace URI of the element
|
williamr@2
|
241 |
* @param aLocalName The local name of the element
|
williamr@2
|
242 |
* @param aQName The qualified name of the element
|
williamr@2
|
243 |
* @param aAttrs The attributes of the element
|
williamr@2
|
244 |
*/
|
williamr@2
|
245 |
IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
|
williamr@2
|
246 |
const TDesC8& aLocalName,
|
williamr@2
|
247 |
const TDesC8& aQName,
|
williamr@2
|
248 |
const RAttributeArray& aAttrs);
|
williamr@2
|
249 |
|
williamr@2
|
250 |
/**
|
williamr@2
|
251 |
* "ConstructL" method for calling the base classes ones.
|
williamr@2
|
252 |
* @since Series60 3.0
|
williamr@2
|
253 |
* @param aNsUri The namespace URI of the element
|
williamr@2
|
254 |
* @param aLocalName The local name of the element
|
williamr@2
|
255 |
* @param aQName The qualified name of the element
|
williamr@2
|
256 |
* @param aAttrs The attributes of the element
|
williamr@2
|
257 |
* @param aParent The parent of the element
|
williamr@2
|
258 |
*/
|
williamr@2
|
259 |
IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
|
williamr@2
|
260 |
const TDesC8& aLocalName,
|
williamr@2
|
261 |
const TDesC8& aQName,
|
williamr@2
|
262 |
const RAttributeArray& aAttrs,
|
williamr@2
|
263 |
CSenElement& aParent);
|
williamr@2
|
264 |
|
williamr@2
|
265 |
/**
|
williamr@2
|
266 |
* "ConstructL" method for calling the base classes ones.
|
williamr@2
|
267 |
* @since Series60 3.0
|
williamr@2
|
268 |
* @param aReader is the XML reader for this fragment.
|
williamr@2
|
269 |
*/
|
williamr@2
|
270 |
IMPORT_C void BaseConstructL(CSenXmlReader& aReader);
|
williamr@2
|
271 |
|
williamr@2
|
272 |
// Functions from base classes
|
williamr@2
|
273 |
|
williamr@2
|
274 |
/**
|
williamr@2
|
275 |
* Callback functions which implement the XML content handler interface.
|
williamr@2
|
276 |
* Inheriting classes can override these.
|
williamr@2
|
277 |
*/
|
williamr@2
|
278 |
|
williamr@2
|
279 |
// From CSenBaseFragment
|
williamr@2
|
280 |
|
williamr@2
|
281 |
/**
|
williamr@2
|
282 |
* @since Series60 3.0
|
williamr@2
|
283 |
* @param aNsUri The namespace URI of the element
|
williamr@2
|
284 |
* @param aLocalName The local name of the element
|
williamr@2
|
285 |
* @param aQName The qualified name of the element
|
williamr@2
|
286 |
* @param aAttrs The attributes of the element
|
williamr@2
|
287 |
*/
|
williamr@2
|
288 |
IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
|
williamr@2
|
289 |
const TDesC8& aLocalName,
|
williamr@2
|
290 |
const TDesC8& aQName,
|
williamr@2
|
291 |
const RAttributeArray& aAttrs);
|
williamr@2
|
292 |
|
williamr@2
|
293 |
/**
|
williamr@2
|
294 |
* Callback functions which implement the XML content handler interface.
|
williamr@2
|
295 |
* This one is called when content is starting.
|
williamr@2
|
296 |
* @since Series60 3.0
|
williamr@2
|
297 |
* @param aChars The content characters.
|
williamr@2
|
298 |
* @param aStart The starting index
|
williamr@2
|
299 |
* @param aLength The length of the characters.
|
williamr@2
|
300 |
*/
|
williamr@2
|
301 |
IMPORT_C virtual void CharactersL(const TDesC8& aChars,TInt aStart,TInt aLength);
|
williamr@2
|
302 |
|
williamr@2
|
303 |
/**
|
williamr@2
|
304 |
* Overriding content writing from CSenBaseFragment to do nothing in
|
williamr@2
|
305 |
* DOM fragment (because the tree is expanded).
|
williamr@2
|
306 |
* @since Series60 3.0
|
williamr@2
|
307 |
* @param aNsUri not used
|
williamr@2
|
308 |
* @param aLocalName not used
|
williamr@2
|
309 |
* @param aQName not used
|
williamr@2
|
310 |
* @param aAttrs not used
|
williamr@2
|
311 |
*/
|
williamr@2
|
312 |
IMPORT_C void WriteStartElementL(const TDesC8& aNsUri,
|
williamr@2
|
313 |
const TDesC8& aLocalName,
|
williamr@2
|
314 |
const TDesC8& aQName,
|
williamr@2
|
315 |
const RAttributeArray& aAttrs);
|
williamr@2
|
316 |
|
williamr@2
|
317 |
/**
|
williamr@2
|
318 |
* Overriding content writing from CSenBaseFragment to do nothing in
|
williamr@2
|
319 |
* DOM fragment (because the tree is expanded).
|
williamr@2
|
320 |
* @since Series60 3.0
|
williamr@2
|
321 |
* @param aNsUri not used
|
williamr@2
|
322 |
* @param aLocalName not used
|
williamr@2
|
323 |
* @param aQName not used
|
williamr@2
|
324 |
*/
|
williamr@2
|
325 |
IMPORT_C void WriteEndElementL(const TDesC8& aNsUri,
|
williamr@2
|
326 |
const TDesC8& aLocalName,
|
williamr@2
|
327 |
const TDesC8& aQName);
|
williamr@2
|
328 |
|
williamr@2
|
329 |
protected: // Data
|
williamr@2
|
330 |
CSenDomFragment* ipDomDelegate;
|
williamr@2
|
331 |
};
|
williamr@2
|
332 |
|
williamr@2
|
333 |
#endif //SEN_DOM_FRAGMENT_H
|
williamr@2
|
334 |
|
williamr@2
|
335 |
// End of File
|
williamr@2
|
336 |
|
williamr@2
|
337 |
|
williamr@2
|
338 |
|