9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: View Manager |
15 * Management of views in UiEngine |
|
16 * |
15 * |
17 */ |
16 */ |
18 |
17 |
19 #ifndef XNVIEWMANAGER_H |
18 #ifndef XNVIEWMANAGER_H |
20 #define XNVIEWMANAGER_H |
19 #define XNVIEWMANAGER_H |
21 |
20 |
22 // System includes |
21 // System includes |
23 #include <e32base.h> |
22 #include <e32base.h> |
24 #include <babitflags.h> |
|
25 |
23 |
26 // Forward declarations |
24 // Forward declarations |
27 class CXnUiEngine; |
25 class CXnUiEngine; |
28 class CXnComposer; |
26 class CXnComposer; |
29 class CXnODTParser; |
27 class CXnODTParser; |
84 * @lib xn3layoutengine.lib |
82 * @lib xn3layoutengine.lib |
85 * @since S60 5.0 |
83 * @since S60 5.0 |
86 */ |
84 */ |
87 NONSHARABLE_CLASS( CXnViewManager ) : public CBase |
85 NONSHARABLE_CLASS( CXnViewManager ) : public CBase |
88 { |
86 { |
89 // Friend classes |
|
90 friend class CXnViewAdapter; |
|
91 |
|
92 public: |
87 public: |
93 /** |
88 /** |
94 * Two-phased constructor. |
89 * Two-phased constructor. |
95 */ |
90 */ |
96 static CXnViewManager* NewL( |
91 static CXnViewManager* NewL( |
97 CXnAppUiAdapter& aAdapter ); |
92 CXnAppUiAdapter& aAdapter ); |
98 |
93 |
|
94 /** |
|
95 * Two-phased constructor. |
|
96 */ |
99 static CXnViewManager* NewLC( |
97 static CXnViewManager* NewLC( |
100 CXnAppUiAdapter& aAdapter ); |
98 CXnAppUiAdapter& aAdapter ); |
101 |
99 |
|
100 /** |
|
101 * Destructor |
|
102 */ |
102 ~CXnViewManager(); |
103 ~CXnViewManager(); |
103 |
104 |
104 private: |
105 private: |
|
106 // constructors |
|
107 |
|
108 /** |
|
109 * C++ constructor |
|
110 */ |
105 CXnViewManager( CXnAppUiAdapter& aAdapter ); |
111 CXnViewManager( CXnAppUiAdapter& aAdapter ); |
|
112 |
|
113 /** |
|
114 * 2nd phase constructor |
|
115 */ |
106 void ConstructL(); |
116 void ConstructL(); |
107 |
117 |
108 public: |
118 public: |
109 // New functions |
119 // New functions |
110 |
120 |
146 TInt LoadWidgetToPluginL( |
156 TInt LoadWidgetToPluginL( |
147 CHsContentInfo& aContentInfo, |
157 CHsContentInfo& aContentInfo, |
148 CXnPluginData& aPluginData ); |
158 CXnPluginData& aPluginData ); |
149 |
159 |
150 TInt UnloadWidgetFromPluginL( |
160 TInt UnloadWidgetFromPluginL( |
151 CXnPluginData& aPluginData ); |
161 CXnPluginData& aPluginData, TBool aForce = EFalse ); |
152 |
162 |
153 TInt ReplaceWidgetToPluginL( |
163 TInt ReplaceWidgetToPluginL( |
154 CHsContentInfo& aContentInfo, |
164 CHsContentInfo& aContentInfo, |
155 CXnPluginData& aPluginData, |
165 CXnPluginData& aPluginData, |
156 TBool aUseHsps = ETrue ); |
166 TBool aUseHsps = ETrue ); |
157 |
167 |
158 void ActivateNextViewL(); |
168 void ActivateNextViewL( TInt aEffectId = 0 ); |
159 |
169 |
160 void ActivatePreviousViewL(); |
170 void ActivatePreviousViewL( TInt aEffectId = 0 ); |
161 |
171 |
162 TInt AddViewL( CHsContentInfo& aInfo ); |
172 TInt AddViewL( CHsContentInfo& aInfo ); |
163 |
173 |
164 void AddViewL(); |
174 void AddViewL( TInt aEffectId = 0 ); |
165 |
175 |
166 TInt RemoveViewL( const CHsContentInfo& aInfo ); |
176 TInt RemoveViewL( const CHsContentInfo& aInfo ); |
167 |
177 |
168 void RemoveViewL(); |
178 void RemoveViewL( TInt aEffectId = 0 ); |
169 |
179 |
170 void AddObserver( const MXnViewObserver& aObserver ); |
180 void AddObserver( const MXnViewObserver& aObserver ); |
171 |
181 |
172 void RemoveObserver( const MXnViewObserver& aObserver ); |
182 void RemoveObserver( const MXnViewObserver& aObserver ); |
173 |
183 |
174 CXnRootData& ActiveAppData() const; |
184 CXnRootData& ActiveAppData() const; |
175 |
185 |
176 CXnViewData& ActiveViewData() const; |
186 CXnViewData& ActiveViewData() const; |
177 |
187 |
178 void SetFirstPassDrawCompleteL(); |
|
179 |
|
180 void SetDataPluginLoadCompleteL( const CXnPluginData& aPluginData ); |
|
181 |
|
182 void UpdatePluginStateL( CXnPluginData& aPluginData ); |
|
183 |
|
184 TInt ActivateAppL( const TDesC8& aPluginUid ); |
188 TInt ActivateAppL( const TDesC8& aPluginUid ); |
185 TInt ActivateViewL( const TDesC8& aPluginId ); |
189 TInt ActivateViewL( const TDesC8& aPluginId ); |
186 |
190 |
187 TInt ViewAmount() const; |
191 TInt ViewAmount() const; |
188 |
192 |
189 TInt ViewIndex() const; |
193 TInt ViewIndex() const; |
190 |
194 |
|
195 TInt MaxPages() const; |
|
196 |
191 CXnOomSysHandler& OomSysHandler() const; |
197 CXnOomSysHandler& OomSysHandler() const; |
192 |
198 |
193 /** |
199 void UpdatePageManagementInformationL(); |
194 * Get maximum pages allowed |
200 |
195 * |
|
196 * @return number of pages allowed |
|
197 */ |
|
198 TInt32 MaxPages(); |
|
199 |
|
200 private: |
201 private: |
|
202 // new functions |
|
203 |
201 void NotifyContainerChangedL( CXnViewData& aViewToActivate ); |
204 void NotifyContainerChangedL( CXnViewData& aViewToActivate ); |
202 |
205 |
203 void NotifyViewActivatedL( const CXnViewData& aViewData ); |
206 void NotifyViewActivatedL( const CXnViewData& aViewData ); |
204 |
207 |
205 void NotifyViewDeactivatedL( const CXnViewData& aViewData ); |
208 void NotifyViewDeactivatedL( const CXnViewData& aViewData ); |
221 CXnViewData& PreviousViewData() const; |
224 CXnViewData& PreviousViewData() const; |
222 |
225 |
223 CXnViewData& NextViewData() const; |
226 CXnViewData& NextViewData() const; |
224 |
227 |
225 void UpdateCachesL(); |
228 void UpdateCachesL(); |
226 |
229 |
227 void ValidateActiveViewL(); |
|
228 |
|
229 void InvalidateActiveView(); |
|
230 |
|
231 void ReportWidgetAmountL( const CXnViewData& aViewData ); |
230 void ReportWidgetAmountL( const CXnViewData& aViewData ); |
232 |
231 |
233 void ShowDiskFullMessageL() const; |
232 void ShowDiskFullMessageL() const; |
234 |
233 |
235 public: |
234 |
236 void UpdatePageManagementInformationL(); |
|
237 |
|
238 private: |
|
239 TInt ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const; |
235 TInt ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const; |
240 |
236 |
241 void UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew ); |
237 void UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew ); |
242 |
238 |
|
239 /** |
|
240 * Callback for stability timer |
|
241 * |
|
242 * @param aAny Pointer to CViewManager object |
|
243 * @return TInt System wide error code. |
|
244 */ |
|
245 static TInt SystemStabileTimerCallback( TAny* aAny ); |
|
246 |
|
247 /** |
|
248 * Reset crash count |
|
249 */ |
|
250 void ResetCrashCount(); |
|
251 |
|
252 /** |
|
253 * Show error note |
|
254 * |
|
255 * @param aResourceId Resource id for string to be displayed. |
|
256 */ |
|
257 void ShowErrorNoteL( const TInt aResourceId ); |
|
258 |
243 private: |
259 private: |
244 // data |
260 // data |
245 |
261 |
246 /** |
262 /** |
247 * AppUi adapter. |
263 * AppUi adapter. |