|
1 /* |
|
2 * Copyright (c) 2005,2006 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: Primary datatype for the entire Document Object Model. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "hspsdomnode.h" |
|
22 #include "hspsdomattribute.h" |
|
23 #include "hspsdomlist.h" |
|
24 #include "hspsdomstringpool.h" |
|
25 |
|
26 // LOCAL CONSTANTS AND MACROS |
|
27 const TInt KNotDefined = -1; |
|
28 _LIT8( KIdAttr, "id" ); |
|
29 _LIT8( KRefAttr, "ref" ); |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS =============================== |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // ChspsDomNode::ChspsDomNode |
|
35 // C++ default constructor can NOT contain any code, that |
|
36 // might leave. |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 ChspsDomNode::ChspsDomNode( ChspsDomStringPool& aStringPool ): |
|
40 iStringPool( aStringPool ), |
|
41 iNodeId( KNotDefined ) |
|
42 { |
|
43 } |
|
44 |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // ChspsDomNode::ConstructL |
|
48 // Symbian 2nd phase constructor can leave. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 void ChspsDomNode::ConstructL( |
|
52 const TDesC8& aName, |
|
53 const TDesC8& aNS ) |
|
54 { |
|
55 iNameRef = iStringPool.AddStringL( aName ); |
|
56 iNSRef = iStringPool.AddStringL( aNS ); |
|
57 |
|
58 iChildList = ChspsDomList::NewL( ChspsDomList::ENodeList, iStringPool ); |
|
59 iAttributeList = ChspsDomList::NewL( ChspsDomList::EAttributeList, iStringPool ); |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // ChspsDomNode::NewL |
|
64 // Two-phased constructor. |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 ChspsDomNode* ChspsDomNode::NewL( |
|
68 const TDesC8& aName, |
|
69 const TDesC8& aNS, |
|
70 ChspsDomStringPool& aStringPool ) |
|
71 { |
|
72 ChspsDomNode* self = new( ELeave ) ChspsDomNode( aStringPool ); |
|
73 |
|
74 CleanupStack::PushL( self ); |
|
75 self->ConstructL( aName, aNS ); |
|
76 CleanupStack::Pop( self ); |
|
77 |
|
78 return self; |
|
79 } |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // ChspsDomNode::NewL |
|
83 // Two-phased stream constructor. |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 ChspsDomNode* ChspsDomNode::NewL( RReadStream& aStream, ChspsDomStringPool& aStringPool ) |
|
87 { |
|
88 ChspsDomNode* self = new( ELeave ) ChspsDomNode( aStringPool ); |
|
89 |
|
90 CleanupStack::PushL( self ); |
|
91 |
|
92 aStream >> *self; |
|
93 CleanupStack::Pop( self ); |
|
94 |
|
95 return self; |
|
96 } |
|
97 |
|
98 // Destructor |
|
99 ChspsDomNode::~ChspsDomNode() |
|
100 { |
|
101 delete iChildList; |
|
102 delete iAttributeList; |
|
103 |
|
104 delete iPCData; |
|
105 } |
|
106 |
|
107 // ----------------------------------------------------------------------------- |
|
108 // ChspsDomNode::CloneL |
|
109 // Clones this node and it's child nodes. This is a recursive function. |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 EXPORT_C ChspsDomNode* ChspsDomNode::CloneL( ChspsDomStringPool& aStringPool ) |
|
113 { |
|
114 const TDesC8& name = iStringPool.String( iNameRef ); |
|
115 const TDesC8& ns = iStringPool.String( iNSRef ); |
|
116 |
|
117 ChspsDomNode* clone = ChspsDomNode::NewL( name, ns, aStringPool ); |
|
118 CleanupStack::PushL( clone ); |
|
119 if ( iPCData ) |
|
120 { |
|
121 clone->AppendPCDataL( *iPCData ); |
|
122 } |
|
123 clone->iNodeId = iNodeId; |
|
124 clone->iRefNode = iRefNode; |
|
125 |
|
126 TInt childCount( iChildList->Length() ); |
|
127 |
|
128 for ( TInt i=0; i<childCount; i++ ) |
|
129 { |
|
130 ChspsDomNode* childClone = |
|
131 static_cast<ChspsDomNode*>( iChildList->Item(i) )->CloneL( aStringPool ); |
|
132 CleanupStack::PushL( childClone ); |
|
133 childClone->iParentNode = clone; |
|
134 clone->iChildList->AddItemL( childClone ); |
|
135 CleanupStack::Pop( childClone ); |
|
136 } |
|
137 |
|
138 TInt attrCount( iAttributeList->Length() ); |
|
139 for ( TInt j=0; j<attrCount; j++ ) |
|
140 { |
|
141 ChspsDomAttribute* attrClone = |
|
142 static_cast<ChspsDomAttribute*>( iAttributeList->Item(j) )->CloneL( aStringPool ); |
|
143 CleanupStack::PushL( attrClone ); |
|
144 clone->iAttributeList->AddItemL( attrClone ); |
|
145 CleanupStack::Pop( attrClone ); |
|
146 } |
|
147 CleanupStack::Pop( clone ); |
|
148 return clone; |
|
149 } |
|
150 |
|
151 // ----------------------------------------------------------------------------- |
|
152 // ChspsDomNode::CloneWithoutKidsL |
|
153 // Clones only this node. This is a recursive function. |
|
154 // ----------------------------------------------------------------------------- |
|
155 // |
|
156 EXPORT_C ChspsDomNode* ChspsDomNode::CloneWithoutKidsL( ChspsDomStringPool& aStringPool ) |
|
157 { |
|
158 const TDesC8& name = iStringPool.String( iNameRef ); |
|
159 const TDesC8& ns = iStringPool.String( iNSRef ); |
|
160 |
|
161 ChspsDomNode* clone = ChspsDomNode::NewL( name, ns, aStringPool ); |
|
162 CleanupStack::PushL( clone ); |
|
163 if ( iPCData ) |
|
164 { |
|
165 clone->AppendPCDataL( *iPCData ); |
|
166 } |
|
167 clone->iNodeId = iNodeId; |
|
168 clone->iRefNode = iRefNode; |
|
169 |
|
170 TInt attrCount( iAttributeList->Length() ); |
|
171 for ( TInt j=0; j<attrCount; j++ ) |
|
172 { |
|
173 ChspsDomAttribute* attrClone = |
|
174 static_cast<ChspsDomAttribute*>( iAttributeList->Item(j) )->CloneL( aStringPool ); |
|
175 CleanupStack::PushL( attrClone ); |
|
176 clone->iAttributeList->AddItemL( attrClone ); |
|
177 CleanupStack::Pop( attrClone ); |
|
178 } |
|
179 |
|
180 CleanupStack::Pop( clone ); |
|
181 return clone; |
|
182 } |
|
183 |
|
184 // ----------------------------------------------------------------------------- |
|
185 // ChspsDomNode::CreateRefNodeL |
|
186 // Recursive function to create referer nodes. |
|
187 // ----------------------------------------------------------------------------- |
|
188 // |
|
189 EXPORT_C ChspsDomNode* ChspsDomNode::CreateRefNodeL() |
|
190 { |
|
191 const TDesC8& name = iStringPool.String( iNameRef ); |
|
192 const TDesC8& ns = iStringPool.String( iNSRef ); |
|
193 |
|
194 ChspsDomNode* ref = ChspsDomNode::NewL( name, ns, iStringPool ); |
|
195 CleanupStack::PushL( ref ); |
|
196 |
|
197 ref->iRefNode = ETrue; |
|
198 |
|
199 TInt childCount( iChildList->Length() ); |
|
200 |
|
201 for ( TInt i=0; i<childCount; i++ ) |
|
202 { |
|
203 ChspsDomNode* childRef = |
|
204 static_cast<ChspsDomNode*>( iChildList->Item(i) )->CreateRefNodeL(); |
|
205 CleanupStack::PushL( childRef ); |
|
206 childRef->iParentNode = ref; |
|
207 ref->iChildList->AddItemL( childRef ); |
|
208 CleanupStack::Pop( childRef ); |
|
209 } |
|
210 |
|
211 ChspsDomAttribute* attr = NULL; |
|
212 if ( !iRefNode ) |
|
213 { |
|
214 attr = static_cast<ChspsDomAttribute*>( iAttributeList->FindByName( KIdAttr ) ); |
|
215 } |
|
216 else |
|
217 { |
|
218 attr = static_cast<ChspsDomAttribute*>( iAttributeList->FindByName( KRefAttr ) ); |
|
219 } |
|
220 |
|
221 if ( attr ) |
|
222 { |
|
223 ChspsDomAttribute* newAttr = ChspsDomAttribute::NewL( KRefAttr, iStringPool ); |
|
224 CleanupStack::PushL( newAttr ); |
|
225 newAttr->SetValueL( attr->Value() ); |
|
226 ref->iAttributeList->AddItemL( newAttr ); |
|
227 CleanupStack::Pop( newAttr ); |
|
228 } |
|
229 else |
|
230 { |
|
231 //referred node don't have an id or ref, thats not ok. |
|
232 User::Leave(KErrArgument); |
|
233 } |
|
234 |
|
235 CleanupStack::Pop( ref ); |
|
236 return ref; |
|
237 } |
|
238 |
|
239 |
|
240 // ----------------------------------------------------------------------------- |
|
241 // ChspsDomNode::Name |
|
242 // ----------------------------------------------------------------------------- |
|
243 // |
|
244 EXPORT_C const TDesC8& ChspsDomNode::Name() |
|
245 { |
|
246 return iStringPool.String( iNameRef ); |
|
247 } |
|
248 |
|
249 // ----------------------------------------------------------------------------- |
|
250 // ChspsDomNode::Namespace |
|
251 // ----------------------------------------------------------------------------- |
|
252 // |
|
253 EXPORT_C const TDesC8& ChspsDomNode::Namespace() |
|
254 { |
|
255 return iStringPool.String( iNSRef ); |
|
256 } |
|
257 |
|
258 // ----------------------------------------------------------------------------- |
|
259 // ChspsDomNode::AttributeList |
|
260 // ----------------------------------------------------------------------------- |
|
261 // |
|
262 EXPORT_C ChspsDomList& ChspsDomNode::AttributeList() const |
|
263 { |
|
264 return *iAttributeList; |
|
265 } |
|
266 // ----------------------------------------------------------------------------- |
|
267 // ChspsDomNode::SetParent |
|
268 // ----------------------------------------------------------------------------- |
|
269 // |
|
270 EXPORT_C void ChspsDomNode::SetParent( ChspsDomNode* aParent ) |
|
271 { |
|
272 iParentNode = aParent; |
|
273 } |
|
274 // ----------------------------------------------------------------------------- |
|
275 // ChspsDomNode::Parent |
|
276 // ----------------------------------------------------------------------------- |
|
277 // |
|
278 EXPORT_C ChspsDomNode* ChspsDomNode::Parent()const |
|
279 { |
|
280 return iParentNode; |
|
281 } |
|
282 // ----------------------------------------------------------------------------- |
|
283 // ChspsDomNode::AddChildL |
|
284 // ----------------------------------------------------------------------------- |
|
285 // |
|
286 EXPORT_C void ChspsDomNode::AddChildL( ChspsDomNode* aNode ) |
|
287 { |
|
288 aNode->SetParent( this ); |
|
289 iChildList->AddItemL( aNode ); |
|
290 } |
|
291 |
|
292 // ----------------------------------------------------------------------------- |
|
293 // ChspsDomNode::AddChildL |
|
294 // ----------------------------------------------------------------------------- |
|
295 // |
|
296 EXPORT_C void ChspsDomNode::AddChildL( ChspsDomNode* aNode, TInt aIndex ) |
|
297 { |
|
298 aNode->SetParent( this ); |
|
299 iChildList->AddItemL( aNode, aIndex ); |
|
300 } |
|
301 |
|
302 // ----------------------------------------------------------------------------- |
|
303 // ChspsDomNode::DeleteChild |
|
304 // ----------------------------------------------------------------------------- |
|
305 // |
|
306 EXPORT_C void ChspsDomNode::DeleteChild( ChspsDomNode* aNode ) |
|
307 { |
|
308 iChildList->DeleteItem( aNode ); |
|
309 } |
|
310 |
|
311 // ----------------------------------------------------------------------------- |
|
312 // ChspsDomNode::ReplaceChildL |
|
313 // ----------------------------------------------------------------------------- |
|
314 // |
|
315 EXPORT_C void ChspsDomNode::ReplaceChildL( |
|
316 ChspsDomNode* aNode, |
|
317 ChspsDomNode* aNewNode ) |
|
318 { |
|
319 ChspsDomNode* swapChild = NULL; |
|
320 ChspsDomList& childList = aNode->ChildNodes(); |
|
321 TInt childCount( childList.Length() ); |
|
322 for ( TInt i=0; i<childCount; i++ ) |
|
323 { |
|
324 swapChild = static_cast<ChspsDomNode*>( childList.Item(i) ); |
|
325 aNewNode->AddChildL( swapChild ); //Let the new node adopt the child |
|
326 //cannot remove it during iterating childlist |
|
327 //childList.RemoveItem( swapChild ); //Remove it from the orginal parent |
|
328 } |
|
329 iChildList->DeleteItem( aNode ); // Delete the old child |
|
330 |
|
331 aNewNode->SetParent( this ); //Set new child |
|
332 iChildList->AddItemL( aNewNode ); |
|
333 } |
|
334 |
|
335 // ----------------------------------------------------------------------------- |
|
336 // ChspsDomNode::ChildNodes |
|
337 // ----------------------------------------------------------------------------- |
|
338 // |
|
339 EXPORT_C ChspsDomList& ChspsDomNode::ChildNodes() |
|
340 { |
|
341 return *iChildList; |
|
342 } |
|
343 // ----------------------------------------------------------------------------- |
|
344 // ChspsDomNode::SetNodeId |
|
345 // ----------------------------------------------------------------------------- |
|
346 // |
|
347 EXPORT_C void ChspsDomNode::SetNodeId( const TInt aNodeId ) |
|
348 { |
|
349 iNodeId = aNodeId; |
|
350 } |
|
351 // ----------------------------------------------------------------------------- |
|
352 // ChspsDomNode::NodeId |
|
353 // ----------------------------------------------------------------------------- |
|
354 // |
|
355 EXPORT_C TInt ChspsDomNode::NodeId() const |
|
356 { |
|
357 return iNodeId; |
|
358 } |
|
359 |
|
360 // ----------------------------------------------------------------------------- |
|
361 // ChspsDomNode::ItemIndex |
|
362 // ----------------------------------------------------------------------------- |
|
363 // |
|
364 EXPORT_C TInt ChspsDomNode::ItemIndex( const MhspsDomListItem& aItem )const |
|
365 { |
|
366 return iChildList->ItemIndex( aItem ); |
|
367 } |
|
368 |
|
369 // ----------------------------------------------------------------------------- |
|
370 // ChspsDomNode::AppendPCDataL |
|
371 // ----------------------------------------------------------------------------- |
|
372 // |
|
373 EXPORT_C void ChspsDomNode::AppendPCDataL( const TDesC8& aPCData ) |
|
374 { |
|
375 if ( iPCData ) |
|
376 { |
|
377 iPCData = iPCData->ReAllocL( iPCData->Length() + aPCData.Length() ); |
|
378 iPCData->Des().Append( aPCData ); |
|
379 } |
|
380 else |
|
381 { |
|
382 iPCData = aPCData.AllocL(); |
|
383 } |
|
384 } |
|
385 |
|
386 |
|
387 // ----------------------------------------------------------------------------- |
|
388 // ChspsDomNode::PCData |
|
389 // ----------------------------------------------------------------------------- |
|
390 // |
|
391 EXPORT_C const TDesC8& ChspsDomNode::PCData() |
|
392 { |
|
393 if ( iPCData ) |
|
394 { |
|
395 return *iPCData; |
|
396 } |
|
397 return KNullDesC8; |
|
398 } |
|
399 |
|
400 // ----------------------------------------------------------------------------- |
|
401 // ChspsDomNode::SetPCDataL |
|
402 // ----------------------------------------------------------------------------- |
|
403 // |
|
404 EXPORT_C void ChspsDomNode::SetPCDataL( const TDesC8& aPCData ) |
|
405 { |
|
406 if ( iPCData ) |
|
407 { |
|
408 delete iPCData; |
|
409 iPCData = NULL; |
|
410 } |
|
411 iPCData = aPCData.AllocL(); |
|
412 } |
|
413 |
|
414 // ----------------------------------------------------------------------------- |
|
415 // ChspsDomNode::ContentType |
|
416 // ----------------------------------------------------------------------------- |
|
417 // |
|
418 EXPORT_C const TContentType& ChspsDomNode::ContentType() |
|
419 { |
|
420 return iContentType; |
|
421 } |
|
422 |
|
423 // ----------------------------------------------------------------------------- |
|
424 // ChspsDomNode::SetContentType |
|
425 // ----------------------------------------------------------------------------- |
|
426 // |
|
427 EXPORT_C void ChspsDomNode::SetContentType( const TContentType& aContentType ) |
|
428 { |
|
429 iContentType = aContentType; |
|
430 } |
|
431 |
|
432 // ----------------------------------------------------------------------------- |
|
433 // ChspsDomNode::StringPool |
|
434 // ----------------------------------------------------------------------------- |
|
435 // |
|
436 EXPORT_C ChspsDomStringPool& ChspsDomNode::StringPool() const |
|
437 { |
|
438 return iStringPool; |
|
439 } |
|
440 |
|
441 // ----------------------------------------------------------------------------- |
|
442 // ChspsDomNode::SetRefNode |
|
443 // ----------------------------------------------------------------------------- |
|
444 // |
|
445 EXPORT_C void ChspsDomNode::SetRefNode( TBool aRefNode ) |
|
446 { |
|
447 iRefNode = aRefNode; |
|
448 } |
|
449 |
|
450 // ----------------------------------------------------------------------------- |
|
451 // ChspsDomNode::IsRefNode |
|
452 // ----------------------------------------------------------------------------- |
|
453 // |
|
454 EXPORT_C TBool ChspsDomNode::IsRefNode() const |
|
455 { |
|
456 return iRefNode; |
|
457 } |
|
458 // ----------------------------------------------------------------------------- |
|
459 // ChspsDomNode::Size |
|
460 // ----------------------------------------------------------------------------- |
|
461 // |
|
462 TInt ChspsDomNode::Size() const |
|
463 { |
|
464 TInt size( 0 ); |
|
465 |
|
466 size += sizeof( TInt16 ); //iNameRef |
|
467 size += sizeof( TInt16 ); //iNSRef |
|
468 size += sizeof( TBool ); //iRefNode |
|
469 if ( iPCData ) |
|
470 { |
|
471 size += sizeof( TInt8 ); |
|
472 size += sizeof( TInt16 ); |
|
473 size += iPCData->Size(); |
|
474 size++; |
|
475 } |
|
476 else |
|
477 { |
|
478 size += sizeof( TInt8 ); |
|
479 } |
|
480 |
|
481 size += sizeof( TInt32 ); //For nodeId |
|
482 size += iAttributeList->Size(); |
|
483 |
|
484 size += iChildList->Size(); |
|
485 |
|
486 return size; |
|
487 } |
|
488 // ----------------------------------------------------------------------------- |
|
489 // ChspsDomNode::ExternalizeL |
|
490 // ----------------------------------------------------------------------------- |
|
491 // |
|
492 void ChspsDomNode::ExternalizeL( RWriteStream& aStream ) const |
|
493 { |
|
494 |
|
495 aStream.WriteInt16L( iNameRef ); |
|
496 aStream.WriteInt16L( iNSRef ); |
|
497 aStream.WriteInt8L( iRefNode ); |
|
498 |
|
499 if ( iPCData ) |
|
500 { |
|
501 aStream.WriteInt8L( ETrue ); |
|
502 aStream.WriteInt16L( iPCData->Length() ); |
|
503 aStream << *iPCData; |
|
504 } |
|
505 else |
|
506 { |
|
507 aStream.WriteInt8L( EFalse ); |
|
508 } |
|
509 |
|
510 aStream.WriteInt32L( iNodeId ); |
|
511 aStream << *iChildList; |
|
512 aStream << *iAttributeList; |
|
513 } |
|
514 |
|
515 // ----------------------------------------------------------------------------- |
|
516 // ChspsDomNode::InternalizeL |
|
517 // ----------------------------------------------------------------------------- |
|
518 // |
|
519 void ChspsDomNode::InternalizeL( RReadStream& aStream ) |
|
520 { |
|
521 iNameRef = aStream.ReadInt16L(); |
|
522 iNSRef = aStream.ReadInt16L(); |
|
523 iRefNode = aStream.ReadInt8L(); |
|
524 |
|
525 TInt len( 0 ); |
|
526 TBool exist( aStream.ReadInt8L() ); |
|
527 if ( exist ) |
|
528 { |
|
529 len = aStream.ReadInt16L(); |
|
530 delete iPCData; |
|
531 iPCData = NULL; |
|
532 iPCData = HBufC8::NewL( aStream, len ); |
|
533 } |
|
534 |
|
535 iNodeId = aStream.ReadInt32L(); |
|
536 |
|
537 iChildList = ChspsDomList::NewL( aStream, iStringPool ); |
|
538 TInt count( iChildList->Length() ); |
|
539 for( TInt i=0; i<count; i++ ) |
|
540 { |
|
541 ChspsDomNode* node = static_cast<ChspsDomNode*>( iChildList->Item( i ) ); |
|
542 if ( node ) |
|
543 { |
|
544 node->SetParent( this ); |
|
545 } |
|
546 else |
|
547 { |
|
548 User::Leave( KErrArgument ); |
|
549 } |
|
550 } |
|
551 |
|
552 iAttributeList = ChspsDomList::NewL( aStream, iStringPool ); |
|
553 } |
|
554 |
|
555 |
|
556 |
|
557 // ----------------------------------------------------------------------------- |
|
558 // ChspsDomNode::DescendantCount |
|
559 // Recursive counting function |
|
560 // ----------------------------------------------------------------------------- |
|
561 // |
|
562 EXPORT_C TInt ChspsDomNode::DescendantCount() const |
|
563 { |
|
564 TInt count( 1 ); //Node itself |
|
565 |
|
566 TInt length( iChildList->Length() ); |
|
567 for ( TInt i=0; i<length; i++ ) |
|
568 { |
|
569 count += static_cast<ChspsDomNode*>( iChildList->Item( i ) )->DescendantCount(); |
|
570 } |
|
571 |
|
572 return count; |
|
573 } |
|
574 |
|
575 |
|
576 // ----------------------------------------------------------------------------- |
|
577 // ChspsDomNode::DeleteAttributeList |
|
578 // Deletes the attribute list |
|
579 // ----------------------------------------------------------------------------- |
|
580 // |
|
581 EXPORT_C void ChspsDomNode::DeleteAttributeList() |
|
582 { |
|
583 delete iAttributeList; |
|
584 iAttributeList = NULL; |
|
585 |
|
586 } |
|
587 |
|
588 // ----------------------------------------------------------------------------- |
|
589 // ChspsDomNode::AttributeValue |
|
590 // Returns value of "name" attribute |
|
591 // ----------------------------------------------------------------------------- |
|
592 // |
|
593 EXPORT_C const TDesC8& ChspsDomNode::AttributeValue(const TDesC8& aAttribute) const |
|
594 { |
|
595 ChspsDomAttribute* attribute = |
|
596 static_cast<ChspsDomAttribute*>(iAttributeList->FindByName(aAttribute)); |
|
597 if(attribute) |
|
598 { |
|
599 return attribute->Value(); |
|
600 } |
|
601 else |
|
602 { |
|
603 return KNullDesC8; |
|
604 } |
|
605 } |
|
606 |
|
607 // ----------------------------------------------------------------------------- |
|
608 // ChspsDomNode::SetLayoutNode |
|
609 // Sets pointer to associated layout node |
|
610 // ----------------------------------------------------------------------------- |
|
611 // |
|
612 EXPORT_C void ChspsDomNode::SetLayoutNode(ChspsNode* aNode) |
|
613 { |
|
614 iLayoutNode = aNode; |
|
615 } |
|
616 |
|
617 // ----------------------------------------------------------------------------- |
|
618 // ChspsDomNode::LayoutNode |
|
619 // Gets pointer to associated layout node |
|
620 // ----------------------------------------------------------------------------- |
|
621 // |
|
622 EXPORT_C ChspsNode* ChspsDomNode::LayoutNode() |
|
623 { |
|
624 return iLayoutNode; |
|
625 } |
|
626 // End of File |