|
1 /* |
|
2 * Copyright (c) 2006-2007 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: ODT iterator. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_PMODTITERATOR_H |
|
21 #define C_PMODTITERATOR_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CXnNodeAppIf; |
|
29 |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * @ingroup group_xmluicontroller |
|
35 * |
|
36 * Depth iterator walks through the dom tree using the depth first |
|
37 * principle. |
|
38 * |
|
39 * @lib presentationmanager.lib |
|
40 * @since S60 v5.0 |
|
41 */ |
|
42 class CPmODTIterator: public CBase |
|
43 { |
|
44 public: |
|
45 static CPmODTIterator* NewL( CXnNodeAppIf& aRootNode ); |
|
46 |
|
47 virtual ~CPmODTIterator(); |
|
48 |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Returns the first node of the dom tree. |
|
53 * |
|
54 * @since S60 v5.0 |
|
55 * @return First node. |
|
56 */ |
|
57 CXnNodeAppIf* First(); |
|
58 |
|
59 /** |
|
60 * Returns the next node according to depth first principle. |
|
61 * |
|
62 * @since S60 v5.0 |
|
63 * @return Next node. |
|
64 */ |
|
65 CXnNodeAppIf* NextL(); |
|
66 |
|
67 /** |
|
68 * Skips the current node branch and returns next sibling |
|
69 * or parent's sibling. Returns NULL if no nodes left. |
|
70 * |
|
71 * @since S60 v5.0 |
|
72 * @return Sibling node. |
|
73 */ |
|
74 CXnNodeAppIf* SkipBranchL(); |
|
75 |
|
76 private: |
|
77 |
|
78 CPmODTIterator( CXnNodeAppIf& aRootNode ); |
|
79 |
|
80 void ConstructL(); |
|
81 |
|
82 /** |
|
83 * Push node to stack. |
|
84 * @param aNode Node to push |
|
85 */ |
|
86 void PushL( CXnNodeAppIf& aNode ); |
|
87 |
|
88 /** |
|
89 * Pop node from the stack. |
|
90 * @return Pointer to node |
|
91 */ |
|
92 CXnNodeAppIf* Pop(); |
|
93 |
|
94 private: |
|
95 /** |
|
96 * Follow tree hierarchy with stack |
|
97 * Own. |
|
98 */ |
|
99 RPointerArray<CXnNodeAppIf> iDepthLevel; |
|
100 |
|
101 /** |
|
102 * First node |
|
103 * Own. |
|
104 */ |
|
105 CXnNodeAppIf* iFirst; |
|
106 |
|
107 /** |
|
108 * Current node. |
|
109 * Own. |
|
110 */ |
|
111 CXnNodeAppIf* iCurrent; |
|
112 |
|
113 }; |
|
114 |
|
115 #endif // C_PMODTITERATOR_H |