|
1 /* |
|
2 * Copyright (c) 2008 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: Data class to hold application configuration info |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _XNROOTDATA_H |
|
20 #define _XNROOTDATA_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 #include <babitflags.h> |
|
25 |
|
26 // User includes |
|
27 #include "xnplugindata.h" |
|
28 |
|
29 // Forward declarations |
|
30 class CXnViewManager; |
|
31 class CXnViewData; |
|
32 class CXnEcomHandler; |
|
33 class CXnODTParser; |
|
34 class CXnODT; |
|
35 |
|
36 /** |
|
37 * Holds root data in UiEngine |
|
38 * |
|
39 * @ingroup group_xnlayoutengine |
|
40 * @lib xn3layoutengine.lib |
|
41 * @since S60 5.0 |
|
42 */ |
|
43 NONSHARABLE_CLASS( CXnRootData ) : public CXnPluginData |
|
44 { |
|
45 public: |
|
46 // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CXnRootData* NewL( CXnViewManager& aManager, TUid aApplicationUid ); |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. Leaving on stack |
|
55 */ |
|
56 static CXnRootData* NewLC( CXnViewManager& aManager, TUid aApplicationUid ); |
|
57 |
|
58 /** |
|
59 * Destructor |
|
60 */ |
|
61 ~CXnRootData(); |
|
62 |
|
63 protected: |
|
64 /** |
|
65 * C++ constructor |
|
66 */ |
|
67 CXnRootData( CXnViewManager& aManager, TUid aApplicationUid ); |
|
68 |
|
69 private: |
|
70 // private constructors |
|
71 |
|
72 /** |
|
73 * Leaving constructor |
|
74 */ |
|
75 void ConstructL(); |
|
76 |
|
77 public: |
|
78 // From CXnPluginData |
|
79 |
|
80 /** |
|
81 * @see CXnPluginData |
|
82 */ |
|
83 void LoadL(); |
|
84 |
|
85 /** |
|
86 * @see CXnPluginData |
|
87 */ |
|
88 void Destroy(); |
|
89 |
|
90 public: |
|
91 // New functions |
|
92 |
|
93 /** |
|
94 * Loads remaining application views |
|
95 */ |
|
96 void LoadRemainingViews(); |
|
97 |
|
98 /** |
|
99 * Cancels load remaining application views |
|
100 */ |
|
101 void CancelLoadRemainingViews(); |
|
102 |
|
103 /** |
|
104 * Gets application active view data |
|
105 * |
|
106 * @return Active view data |
|
107 */ |
|
108 CXnViewData& ActiveViewData() const; |
|
109 |
|
110 /** |
|
111 * Gets previous view data from currently active one |
|
112 * |
|
113 * @return Previous view data |
|
114 */ |
|
115 CXnViewData& PreviousViewData() const; |
|
116 |
|
117 /** |
|
118 * Gets next view data from currently active one |
|
119 * |
|
120 * @return Next view data |
|
121 */ |
|
122 CXnViewData& NextViewData() const; |
|
123 |
|
124 /** |
|
125 * Sets view data to destroyal list |
|
126 * |
|
127 * @param aViewData View data to destroy |
|
128 */ |
|
129 void DestroyViewData( CXnViewData* aViewData ); |
|
130 |
|
131 /** |
|
132 * Gets ODT |
|
133 * |
|
134 * @return ODT |
|
135 */ |
|
136 CXnODT* ODT() const; |
|
137 |
|
138 /** |
|
139 * Gets root node from ODT |
|
140 * |
|
141 * @return Root node |
|
142 */ |
|
143 CXnNode* RootNode() const; |
|
144 |
|
145 /** |
|
146 * Gets ODT Parser |
|
147 * |
|
148 * @return ODT Parser |
|
149 */ |
|
150 CXnODTParser& Parser() const; |
|
151 |
|
152 /** |
|
153 * Gets Ecom handler |
|
154 * |
|
155 * @return Ecom handler |
|
156 */ |
|
157 CXnEcomHandler& EcomHandler() const; |
|
158 |
|
159 /** |
|
160 * Sets maximum pages allowed |
|
161 * |
|
162 * @param aPages maximum pages |
|
163 */ |
|
164 void SetMaxPages( TInt32 aPages ); |
|
165 |
|
166 /** |
|
167 * Get maximum pages allowed |
|
168 * |
|
169 * @return number of pages allowed |
|
170 */ |
|
171 TInt32 MaxPages(); |
|
172 |
|
173 private: |
|
174 // New functions |
|
175 |
|
176 TBool AllViewsLoaded() const; |
|
177 TBool AllViewsDestroyed() const; |
|
178 |
|
179 static TInt RunLoadL( TAny* aAny ); |
|
180 static TInt RunDestroyL( TAny *aAny ); |
|
181 |
|
182 private: |
|
183 // data |
|
184 |
|
185 /** Timer for loading views, Owned */ |
|
186 CPeriodic* iLoadTimer; |
|
187 /** Timer for deleting views, Owned */ |
|
188 CPeriodic* iDestroyTimer; |
|
189 /** Application Uid */ |
|
190 TUid iApplicationUid; |
|
191 /** ECom handler, Owned */ |
|
192 CXnEcomHandler* iEcomHandler; |
|
193 /** ODT Parser, Owned */ |
|
194 CXnODTParser* iParser; |
|
195 /** ODT which describes application configuration, Owned */ |
|
196 CXnODT* iODT; |
|
197 /** Array of views waiting destruction */ |
|
198 RPointerArray< CXnViewData > iViewsToDestroy; |
|
199 /** Flag to determine remaining view load direction */ |
|
200 TBool iLoadForward; |
|
201 /** Maximum of views allowed */ |
|
202 TInt32 iMaxPages; |
|
203 }; |
|
204 |
|
205 #endif // _XNROOTDATA_H |