|
1 /* |
|
2 * Copyright (c) 2002-2004 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: |
|
15 * Avkon adapter for Xuikon |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef XNAPPUIADAPTER_H |
|
20 #define XNAPPUIADAPTER_H |
|
21 |
|
22 // System includes |
|
23 #include <aknViewAppUi.h> |
|
24 |
|
25 // User includes |
|
26 |
|
27 // Forward declarations |
|
28 class TAiFwPublisherInfo; |
|
29 class THsPublisherInfo; |
|
30 class TXnUiEngineAppIf; |
|
31 class CXnNodeAppIf; |
|
32 class CXnNode; |
|
33 class CXnDomNode; |
|
34 class CXnAppUiAdapterImpl; |
|
35 class CXnUiEngine; |
|
36 class CXnUiStateListener; |
|
37 class CXnViewManager; |
|
38 class CXnViewAdapter; |
|
39 class MHsContentControlUi; |
|
40 class CXnEffectManager; |
|
41 class MHsContentControl; |
|
42 class CXnItemActivator; |
|
43 |
|
44 // Class declaration |
|
45 /** |
|
46 * Avkon adapter for Xuikon. |
|
47 * |
|
48 * @ingroup group_xnlayoutengine |
|
49 * @lib xnlayoutengine.lib |
|
50 * @since Series 60 3.1 |
|
51 */ |
|
52 class CXnAppUiAdapter : public CAknViewAppUi |
|
53 { |
|
54 public: |
|
55 /** |
|
56 * C++ default constructor. |
|
57 * |
|
58 * @param aApplicationUid Application UID |
|
59 */ |
|
60 IMPORT_C CXnAppUiAdapter( TUid aApplicationUid ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 IMPORT_C virtual ~CXnAppUiAdapter(); |
|
66 |
|
67 public: |
|
68 // New functions |
|
69 |
|
70 /** |
|
71 * Removes and deregisters view from AppUi |
|
72 * |
|
73 * @since S60 5.2 |
|
74 * @param aView view to deregister |
|
75 */ |
|
76 IMPORT_C void RemoveViewL( CAknView& aView ); |
|
77 |
|
78 /** |
|
79 * Get the UI engine |
|
80 * |
|
81 * @since Series 60 3.1 |
|
82 * @return UI engine |
|
83 */ |
|
84 IMPORT_C TXnUiEngineAppIf* UiEngineL(); |
|
85 |
|
86 /** |
|
87 * Handle interaction notification from the engine |
|
88 * |
|
89 * @since Series 60 3.1 |
|
90 * @param aOrigin Node that originated the event |
|
91 * @param aTrigger Trigger information of the event, as created by event |
|
92 * originator |
|
93 * @param aTriggerDefinition Trigger information as it exists in the action |
|
94 * definition in xml |
|
95 * @param aEvent Event information of the event |
|
96 */ |
|
97 IMPORT_C virtual void HandleXuikonEventL( |
|
98 CXnNodeAppIf& aOrigin, |
|
99 CXnNodeAppIf& aTrigger, |
|
100 CXnDomNode& aTriggerDefinition, |
|
101 CXnDomNode& aEvent ); |
|
102 |
|
103 /** |
|
104 * Handles data plugin loading. |
|
105 * To be overriden by subclass. |
|
106 * |
|
107 * @since S60 5.0 |
|
108 * @param aPublisher Publisher to load |
|
109 */ |
|
110 IMPORT_C virtual void LoadPublisher( |
|
111 const TAiFwPublisherInfo& aPublisher ); |
|
112 |
|
113 /** |
|
114 * Handles data plugin destroying. |
|
115 * To be overriden by subclass. |
|
116 * |
|
117 * @since S60 5.0 |
|
118 * @param aPublisher Publisher to destroy |
|
119 */ |
|
120 IMPORT_C virtual void DestroyPublisher( |
|
121 const TAiFwPublisherInfo& aPublisher ); |
|
122 |
|
123 /** |
|
124 * Handles dynamic menuitem element initialisation. |
|
125 * To be overriden by subclass. |
|
126 * |
|
127 * @since S60 5.0 |
|
128 * @param aItemType Menuitem type |
|
129 * @param aList List of data plugins |
|
130 * @return ETrue if menuitem should be shown, EFalse otherwise |
|
131 */ |
|
132 IMPORT_C virtual TBool DynInitMenuItemL( |
|
133 const TDesC& aItemType, |
|
134 RPointerArray< CXnNodeAppIf >* aList = NULL ); |
|
135 |
|
136 /* |
|
137 * Returns the Xml Ui view as CAknView reference. |
|
138 * |
|
139 * @since S60 5.0 |
|
140 * @return Xml Ui View |
|
141 */ |
|
142 IMPORT_C CAknView& CXnAppUiAdapter::View() const; |
|
143 |
|
144 /** |
|
145 * Handles changes when entering or exiting edit mode |
|
146 * To be overriden by subclass. |
|
147 * |
|
148 * @since S60 5.0 |
|
149 * @param aEnter enter or exit edit mode |
|
150 */ |
|
151 IMPORT_C virtual void HandleEnterEditModeL( TBool aEnter ); |
|
152 |
|
153 /** |
|
154 * Routes the events from external rendering plug-ins to content plug-ins. |
|
155 * To be overriden by subclass. |
|
156 * |
|
157 * @since S60 5.2 |
|
158 * @param aEvent Event string |
|
159 * @param aDestination Destination node for the event |
|
160 */ |
|
161 IMPORT_C virtual void HandleEventL( const TDesC& aEvent, |
|
162 CXnNodeAppIf& aDestination ); |
|
163 |
|
164 /** |
|
165 * Constructs THsPublisherInfo from aNode |
|
166 * To be overriden by subclass. |
|
167 * |
|
168 * @since S60 5.2 |
|
169 * @param aNode <contentsource> elements |
|
170 * @param aInfo Publisher info which is constructed from aNode |
|
171 * @return KErrNone if aInfo is succesfully build |
|
172 */ |
|
173 EXPORT_C virtual TInt PublisherInfo( CXnNodeAppIf& aNode, |
|
174 THsPublisherInfo& aInfo ); |
|
175 |
|
176 /** |
|
177 * Constructs THsPublisherInfo from aNode |
|
178 * |
|
179 * @since S60 5.2 |
|
180 * @param aNode <contentsource> elements |
|
181 * @param aInfo Publisher info which is constructed from aNode |
|
182 * @return KErrNone if aInfo is succesfully build |
|
183 */ |
|
184 TInt PublisherInfo( CXnNode& aNode, THsPublisherInfo& aInfo ); |
|
185 |
|
186 /** |
|
187 * This is called when (initial) view is ready |
|
188 * To be overriden by subclass. |
|
189 * |
|
190 * @since S60 5.2 |
|
191 */ |
|
192 IMPORT_C virtual void HandleUiReadyEventL(); |
|
193 |
|
194 /** |
|
195 * Second-phase constructor |
|
196 * |
|
197 * @since Series 60 3.1 |
|
198 */ |
|
199 IMPORT_C void ConstructL(); |
|
200 |
|
201 /** |
|
202 * From CEikAppUi. |
|
203 * |
|
204 * @since Series 60 3.1 |
|
205 */ |
|
206 IMPORT_C void ProcessMessageL( TUid aUid, const TDesC8& aParams ); |
|
207 |
|
208 protected: |
|
209 // from CAknViewAppUi |
|
210 |
|
211 /** |
|
212 * @see CAknViewAppUi |
|
213 * |
|
214 * @since Series 60 3.1 |
|
215 */ |
|
216 IMPORT_C void HandleResourceChangeL( TInt aType ); |
|
217 |
|
218 /** |
|
219 * @see CAknViewAppUi |
|
220 * |
|
221 * @since S60 5.2 |
|
222 */ |
|
223 IMPORT_C void PrepareToExit(); |
|
224 |
|
225 public: |
|
226 // new functions |
|
227 |
|
228 /** |
|
229 * Reloads the UI |
|
230 */ |
|
231 void ReloadUiL(); |
|
232 |
|
233 /** |
|
234 * Gets UiEngine |
|
235 * |
|
236 * @since S60 5.0 |
|
237 * @return UiEngine |
|
238 */ |
|
239 CXnUiEngine& UiEngine() const; |
|
240 |
|
241 /** |
|
242 * Gets ViewManager |
|
243 * |
|
244 * @since S60 5.0 |
|
245 * @return ViewManager |
|
246 */ |
|
247 CXnViewManager& ViewManager() const; |
|
248 |
|
249 /** |
|
250 * Gets ViewAdapter |
|
251 * |
|
252 * @since S60 5.0 |
|
253 * @return ViewAdapter |
|
254 */ |
|
255 CXnViewAdapter& ViewAdapter() const; |
|
256 |
|
257 /** |
|
258 * Gets UiStateListener |
|
259 * |
|
260 * @since S60 5.0 |
|
261 * @return UiStateListener |
|
262 */ |
|
263 CXnUiStateListener& UiStateListener() const; |
|
264 |
|
265 /** |
|
266 * Gets a Content Control UI |
|
267 * |
|
268 * @since S60 5.0 |
|
269 * @param aType Content control UI type |
|
270 * @return Interface to content control UI, NULL if not present |
|
271 */ |
|
272 MHsContentControlUi* HsContentController( const TDesC8& aType ) const; |
|
273 |
|
274 /** |
|
275 * Get effect manager |
|
276 * |
|
277 * @since S60 5.0 |
|
278 * @return effect manager |
|
279 */ |
|
280 CXnEffectManager* EffectManager() const; |
|
281 |
|
282 /** |
|
283 * Gets a Content Control server interface |
|
284 * |
|
285 * @since S60 5.0 |
|
286 * @return Interface to content control server, NULL if not present |
|
287 */ |
|
288 MHsContentControl* HsContentControlSrv() const; |
|
289 |
|
290 /** |
|
291 * Gets a Item activator |
|
292 * |
|
293 * @since S60 5.0 |
|
294 * @return Item activator |
|
295 */ |
|
296 CXnItemActivator& ItemActivator() const; |
|
297 |
|
298 /** |
|
299 * Queries whether the focus control is visible |
|
300 * |
|
301 * @since S60 5.0 |
|
302 * @return ETrue focus is shown, EFalse otherwise |
|
303 */ |
|
304 TBool FocusShown() const; |
|
305 |
|
306 /** |
|
307 * Makes focus control invisible |
|
308 * |
|
309 * @since S60 5.0 |
|
310 */ |
|
311 void HideFocus(); |
|
312 |
|
313 /** |
|
314 * Makes focus control visible |
|
315 * |
|
316 * @since S60 5.0 |
|
317 */ |
|
318 void ShowFocus(); |
|
319 |
|
320 private: |
|
321 // Data |
|
322 |
|
323 /** |
|
324 * flag for application exit |
|
325 */ |
|
326 TBool iExitingApp; |
|
327 |
|
328 /** |
|
329 * application uid |
|
330 */ |
|
331 TUid iApplicationUid; |
|
332 |
|
333 /** |
|
334 * appui adapter impl. |
|
335 * Own. |
|
336 */ |
|
337 CXnAppUiAdapterImpl* iImpl; |
|
338 |
|
339 /** |
|
340 * Proxy to UiEngine. |
|
341 * Own. |
|
342 */ |
|
343 TXnUiEngineAppIf* iUiEngineAppIf; |
|
344 }; |
|
345 |
|
346 #endif |
|
347 |
|
348 // End of file |