55 * Two-phased constructor. |
55 * Two-phased constructor. |
56 */ |
56 */ |
57 static CXnDomNode* NewL( |
57 static CXnDomNode* NewL( |
58 const TDesC8& aName, |
58 const TDesC8& aName, |
59 const TDesC8& aNS, |
59 const TDesC8& aNS, |
60 CXnDomStringPool& aStringPool ); |
60 CXnDomStringPool* aStringPool ); |
61 |
61 |
62 /** |
62 /** |
63 * Two-phased stream constructor. |
63 * Two-phased stream constructor. |
64 */ |
64 */ |
65 static CXnDomNode* NewL( RReadStream& aStream, CXnDomStringPool& aStringPool ); |
65 static CXnDomNode* NewL( RReadStream& aStream, CXnDomStringPool* aStringPool ); |
66 |
66 |
67 /** |
67 /** |
68 * Destructor. |
68 * Destructor. |
69 */ |
69 */ |
70 virtual ~CXnDomNode(); |
70 virtual ~CXnDomNode(); |
71 |
71 |
72 public: // New functions |
72 public: // New functions |
73 /** |
73 /** |
74 * Makes a clone from this node and it's child nodes. |
74 * Makes a clone from this node and it's child nodes. |
75 * @since Series 60 3.1 |
75 * @since Series 60 3.1 |
76 * @param aStringPool. A new string pool. |
76 * @param aStringPool. A new string pool. |
77 * @return Pointer to a clone node. Caller has the ownership. |
77 * @return Pointer to a clone node. Caller has the ownership. |
78 */ |
78 */ |
79 IMPORT_C CXnDomNode* CloneL( CXnDomStringPool& aStringPool ); |
79 IMPORT_C CXnDomNode* CloneL( CXnDomStringPool& aStringPool ); |
80 |
80 |
81 /** |
|
82 * Makes a clone only from this node. |
|
83 * @since Series 60 3.1 |
|
84 * @param aStringPool. A new string pool. |
|
85 * @return Pointer to a clone node. Caller has the ownership. |
|
86 */ |
|
87 IMPORT_C CXnDomNode* CloneWithoutKidsL( CXnDomStringPool& aStringPool ); |
|
88 |
|
89 /** |
|
90 * Contructs a ref node from this node and its child's. |
|
91 * @since Series 60 3.1 |
|
92 * @return Pointer to a ref node. Caller has the ownership. |
|
93 */ |
|
94 IMPORT_C CXnDomNode* CreateRefNodeL(); |
|
95 |
|
96 /** |
81 /** |
97 * Get the namespace of this node. |
82 * Get the namespace of this node. |
98 * @since Series 60 3.1 |
83 * @since Series 60 3.1 |
99 * @return Pointer to the namespace buffer |
84 * @return Pointer to the namespace buffer |
100 */ |
85 */ |
233 * @return This node and it's all childs count |
218 * @return This node and it's all childs count |
234 */ |
219 */ |
235 IMPORT_C TInt DescendantCount() const; |
220 IMPORT_C TInt DescendantCount() const; |
236 |
221 |
237 /** |
222 /** |
238 * Get reference to the dom's string pool. |
223 * Get pointer to the dom's string pool. |
239 * @since Series 60 3.1 |
224 * @since Series 60 3.1 |
240 * @return Reference to string pool |
225 * @return Reference to string pool |
241 */ |
226 */ |
242 IMPORT_C CXnDomStringPool& StringPool() const; |
227 IMPORT_C CXnDomStringPool* StringPool() const; |
243 |
|
244 /** |
|
245 * Mark this node as a reference node. |
|
246 * @since Series 60 3.1 |
|
247 * @param aRefNode ETrue if node is a reference node |
|
248 */ |
|
249 IMPORT_C void SetRefNode( TBool aRefNode=ETrue ); |
|
250 |
|
251 /** |
|
252 * Check if this node is referring to some global node. |
|
253 * @since Series 60 3.1 |
|
254 * @return ETrue if this is a reference node. |
|
255 */ |
|
256 IMPORT_C TBool IsRefNode() const; |
|
257 |
228 |
258 /** |
229 /** |
259 * Deletes attributes when they are not needed anymore. |
230 * Deletes attributes when they are not needed anymore. |
260 * I.e. UIEngine has copied them into property list. |
231 * I.e. UIEngine has copied them into property list. |
261 * @since Series 60 3.1 |
232 * @since Series 60 3.1 |
288 * Documented in CXnDomListItem::InternalizeL |
259 * Documented in CXnDomListItem::InternalizeL |
289 */ |
260 */ |
290 void InternalizeL( RReadStream& aStream ); |
261 void InternalizeL( RReadStream& aStream ); |
291 |
262 |
292 /** |
263 /** |
293 * Similar to InternalizeL, but does not expect dedicated odt document |
|
294 */ |
|
295 void ReadL( RReadStream& aStream ); |
|
296 |
|
297 |
|
298 /** |
|
299 * Documented in CXnDomListItem::Name |
264 * Documented in CXnDomListItem::Name |
300 */ |
265 */ |
301 IMPORT_C const TDesC8& Name(); |
266 IMPORT_C const TDesC8& Name(); |
302 |
|
303 |
267 |
304 public: |
268 public: |
305 |
269 |
306 /** |
270 /** |
307 * Sets pointer to associated layout node |
271 * Sets pointer to associated layout node |
321 * Set the namespace for this node. |
285 * Set the namespace for this node. |
322 * @since Series 60 3.1 |
286 * @since Series 60 3.1 |
323 * @param aNS New namespace |
287 * @param aNS New namespace |
324 */ |
288 */ |
325 IMPORT_C void SetNamespaceL(const TDesC8& aNS); |
289 IMPORT_C void SetNamespaceL(const TDesC8& aNS); |
326 |
|
327 /** |
|
328 * Makes a clone from this node and it's child nodes. Sets new namespace. |
|
329 * @since Series 60 3.1 |
|
330 * @param aStringPool. A new string pool. |
|
331 * @param aNS. A new namespace. |
|
332 * @return Pointer to a clone node. Caller has the ownership. |
|
333 */ |
|
334 IMPORT_C CXnDomNode* CloneL( CXnDomStringPool& aStringPool, const TDesC8& aNS ); |
|
335 |
290 |
336 /** |
291 /** |
337 * Set ownership of node and its children |
292 * Set ownership of node and its children |
338 * @since Series 60 5.1 |
293 * @since Series 60 5.1 |
339 * @param aNS. A new namespace. |
294 * @param aNS. A new namespace. |
340 * @return void |
295 * @return void |
341 */ |
296 */ |
342 IMPORT_C void SetOwnershipL( const TDesC8& aNS ); |
297 IMPORT_C void SetOwnershipL( const TDesC8& aNS ); |
|
298 |
|
299 /** |
|
300 * Swap used string pool. |
|
301 * |
|
302 * @param aStringPool New string pool to be used. |
|
303 * Ownership not transferred! |
|
304 */ |
|
305 IMPORT_C void SwapStringPoolL( CXnDomStringPool* aStringPool ); |
343 |
306 |
344 private: |
307 private: |
345 /** |
308 /** |
346 * C++ default constructor. |
309 * C++ default constructor. |
347 */ |
310 */ |
348 CXnDomNode( CXnDomStringPool& aStringPool ); |
311 CXnDomNode( CXnDomStringPool* aStringPool ); |
349 |
312 |
350 /** |
313 /** |
351 * By default Symbian 2nd phase constructor is private. |
314 * By default Symbian 2nd phase constructor is private. |
352 */ |
315 */ |
353 void ConstructL( const TDesC8& aName, const TDesC8& aNS ); |
316 void ConstructL( const TDesC8& aName, const TDesC8& aNS ); |
359 |
322 |
360 //iNSRef refers to a namespace string in a string pool |
323 //iNSRef refers to a namespace string in a string pool |
361 TInt iNSRef; |
324 TInt iNSRef; |
362 |
325 |
363 //iStringPool is used to resolve strings based on references |
326 //iStringPool is used to resolve strings based on references |
364 CXnDomStringPool& iStringPool; |
327 CXnDomStringPool* iStringPool; |
365 |
328 |
366 //Type of the elements content |
329 //Type of the elements content |
367 TContentType iContentType; |
330 TContentType iContentType; |
368 |
331 |
369 //Parsed character data |
332 //Parsed character data |
382 CXnDomList* iAttributeList; |
345 CXnDomList* iAttributeList; |
383 |
346 |
384 //Node is the owner of the properties |
347 //Node is the owner of the properties |
385 CXnDomList* iPropertyList; |
348 CXnDomList* iPropertyList; |
386 |
349 |
387 //Flag is set if this node is reference node |
|
388 TBool iRefNode; |
|
389 |
|
390 // Not owned |
350 // Not owned |
391 CXnNode* iLayoutNode; |
351 CXnNode* iLayoutNode; |
392 }; |
352 }; |
393 |
353 |
394 #endif // XN_DOM_NODE_H |
354 #endif // XN_DOM_NODE_H |