|
1 /* |
|
2 * Copyright (c) 2007-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: Application UI class |
|
15 * Version : %version: MM_83.1.2.1.23.1.18 % << Don't touch! Updated by Synergy at check-out. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef C_MMAPPUI_H |
|
21 #define C_MMAPPUI_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <gfxtranseffect/gfxtranseffect.h> // for transition effects |
|
25 #include <akntranseffect.h> // for transition effects |
|
26 |
|
27 #include <e32hashtab.h> |
|
28 #include <aknappui.h> |
|
29 #include <akntoolbarobserver.h> |
|
30 #include <eiklbo.h> |
|
31 #include <hwrmdomainpskeys.h> //for flip change status |
|
32 #include <AknsSrvClient.h> |
|
33 |
|
34 #include "hncontrollerinterface.h" |
|
35 #include "mmwidgetobserver.h" |
|
36 #include "hnsuiteobserver.h" |
|
37 #include "mmactionrequest.h" |
|
38 #include "mmpropertysubscriber.h" |
|
39 #include "hnglobals.h" |
|
40 |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 |
|
44 class CHnInterface; |
|
45 class CHnSuiteModel; |
|
46 class MHnMenuItemModelIterator; |
|
47 class CAknToolbar; |
|
48 class CMmWidgetContainer; |
|
49 class CMmListBoxContainer; |
|
50 class CMmGridContainer; |
|
51 class CMmHighlightManager; |
|
52 class CLiwGenericParamList; |
|
53 class CHnItemModel; |
|
54 class CMMExtensionManager; |
|
55 class CMmTemplateLibrary; |
|
56 class CMmNoMemory; |
|
57 class CMmAppkeyHandler; |
|
58 class CAknStylusPopUpMenu; |
|
59 |
|
60 /** |
|
61 * @ingroup group_matrixmenu |
|
62 * Matrix Menu Application UI. |
|
63 * Regular AVKON Application UI class, acts as controller for the application. |
|
64 * <br>Implements: |
|
65 * <ul> |
|
66 * <li>MHnControllerInterface - for notifications about model changes.</li> |
|
67 * <li>MAknToolbarObserver - to get notifications about toolbar events.</li> |
|
68 * <li>MMmWidgetObserver - |
|
69 * to get notifications about widget highlight changes.</li> |
|
70 * </ul> |
|
71 * |
|
72 * @since S60 v5.0 |
|
73 */ |
|
74 NONSHARABLE_CLASS(CMmAppUi) : public CAknAppUi, |
|
75 public MHnControllerInterface, |
|
76 public MAknToolbarObserver, |
|
77 public MMmWidgetObserver, |
|
78 public MMmActionRequest, |
|
79 public MMmPropertyChangeObserver, |
|
80 public MAknsSkinChangeObserver |
|
81 { |
|
82 |
|
83 public: |
|
84 |
|
85 /** |
|
86 * 2nd phase constructor. |
|
87 * |
|
88 * @since S60 v5.0 |
|
89 */ |
|
90 void ConstructL(); |
|
91 |
|
92 /** |
|
93 * C++ default constructor. This needs to be public due to |
|
94 * the way the framework constructs the AppUi. |
|
95 * |
|
96 * @since S60 v5.0 |
|
97 */ |
|
98 CMmAppUi(); |
|
99 |
|
100 /** |
|
101 * Virtual Destructor. |
|
102 * |
|
103 * @since S60 v5.0 |
|
104 */ |
|
105 ~CMmAppUi(); |
|
106 |
|
107 // from base class CEikAppUi |
|
108 |
|
109 /** |
|
110 * From CEikAppUi. |
|
111 * Handles a change to the application's resources which |
|
112 * are shared across the environment. This function calls |
|
113 * CEikAppUi::HandleResourceChangeL except when aType is |
|
114 * KEikDynamicLayoutVariantSwitch. |
|
115 * |
|
116 * @since S60 v5.0 |
|
117 * @param aType The type of resources that have changed. |
|
118 */ |
|
119 void HandleResourceChangeL( TInt aType ); |
|
120 |
|
121 /** |
|
122 * From CEikAppUi. |
|
123 * Takes care of Command Line tail handling. |
|
124 * |
|
125 * @since S60 v5.0 |
|
126 * @param aCommand Not used by this app. |
|
127 * @param aDocumentName Not used by this app. |
|
128 * @param aTail Command line tail. |
|
129 */ |
|
130 TBool ProcessCommandParametersL( TApaCommand aCommand, |
|
131 TFileName& aDocumentName, |
|
132 const TDesC8& aTail ); |
|
133 |
|
134 /** |
|
135 * From CAknAppUi. |
|
136 * This method is overriden to ignore certain commands in |
|
137 * certain situations. For not ignored commands it simply |
|
138 * calls the base class implementation. |
|
139 * |
|
140 * @param aCommand A command ID. |
|
141 */ |
|
142 void ProcessCommandL(TInt aCommand); |
|
143 |
|
144 /** |
|
145 * From CEikAppUi. |
|
146 * Takes care of Command Line tail handling. |
|
147 * |
|
148 * @since S60 v5.0 |
|
149 * @param aUid UID of the message. |
|
150 * @param aParams Message params. |
|
151 */ |
|
152 void ProcessMessageL( TUid aUid, const TDesC8& aParams ); |
|
153 |
|
154 /** |
|
155 * From MCoeMessageObserver. |
|
156 * Handles window server messages. |
|
157 * |
|
158 * @since S60 v5.0 |
|
159 * @param aClientHandleOfTargetWindowGroup The window group that the message was sent to. |
|
160 * @param aMessageUid The message UID. |
|
161 * @param aMessageParameters The message parameters. |
|
162 * @return Indicates whether the message was handled or not handled by the function. |
|
163 */ |
|
164 MCoeMessageObserver::TMessageResponse HandleMessageL( |
|
165 TUint32 aClientHandleOfTargetWindowGroup, |
|
166 TUid aMessageUid, |
|
167 const TDesC8& aMessageParameters ); |
|
168 |
|
169 /** |
|
170 * From MEikMenuObserver (CEikAppUi). |
|
171 * Handles dynamic menu pane initialization. |
|
172 * |
|
173 * @since S60 v5.0 |
|
174 * @param aResourceId Resource ID of the menu pane. |
|
175 * @param aMenuPane The menu pane itself. |
|
176 */ |
|
177 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
178 |
|
179 // from base class MHnControllerInterface |
|
180 |
|
181 /** |
|
182 * From MHnControllerInterface. |
|
183 * Notifies UI to start a refresh after content change. |
|
184 * |
|
185 * @since S60 v5.0 |
|
186 * @param aRefreshType Type of refresh. |
|
187 */ |
|
188 void NotifyUiRefreshL( const THnUiRefreshType aRefreshType ); |
|
189 |
|
190 // from base class MHnSuiteObserver |
|
191 |
|
192 /** |
|
193 * From MHnSuiteObserver. |
|
194 * Trigger appropriate action on suite model. |
|
195 * |
|
196 * @since S60 v5.0 |
|
197 * @param aCustomSuiteEvent Event to perform. |
|
198 * @param aModel Suite model where aCustomSuiteEvent should be envoked. |
|
199 */ |
|
200 void HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, |
|
201 CHnSuiteModel* aModel ); |
|
202 |
|
203 // from base class MEikListBoxObserver |
|
204 |
|
205 /** |
|
206 * From MEikListBoxObserver. |
|
207 * Handles list box events. |
|
208 * |
|
209 * This pure virtual function is invoked by CEikListBox to |
|
210 * notify the observer of list box events. |
|
211 * |
|
212 * @since S60 v5.0 |
|
213 * @param aListBox The originating list box. |
|
214 * @param aEventType A code for the event. Further information |
|
215 * may be obtained by accessing the list box itself. |
|
216 */ |
|
217 void HandleListBoxEventL( CEikListBox* aListBox, |
|
218 MEikListBoxObserver::TListBoxEvent aEventType ); |
|
219 |
|
220 // from base class MMmLongTapObserver |
|
221 |
|
222 /** |
|
223 * From MMmLongTapObserver. |
|
224 * Handles long tap event reported by widget container. |
|
225 * |
|
226 * @since S60 v5.0 |
|
227 * @param aPenEventLocation The relative to screen pen event location. |
|
228 */ |
|
229 void HandleLongTapEventL( const TPoint& aPenEventLocation ); |
|
230 |
|
231 // from base class MMmKeyEventObserver |
|
232 |
|
233 /** |
|
234 * From MMmKeyEventObserver. |
|
235 * Handles key press events. |
|
236 * |
|
237 * @since S60 v5.0 |
|
238 * @param aKeyEvent Key event. |
|
239 * @param aType Event type. |
|
240 */ |
|
241 TKeyResponse HandleKeyPressedL( const TKeyEvent &aKeyEvent, |
|
242 TEventCode aType ); |
|
243 |
|
244 // from base class MMmDragAndDropObserver |
|
245 |
|
246 /** |
|
247 * From MMmDragAndDropObserver. |
|
248 * Handles the start of dragging of an item. |
|
249 * |
|
250 * @since S60 v5.0 |
|
251 * @param aModelItemIndex Index of the dragged item. |
|
252 */ |
|
253 void HandleDragStartL( TInt aModelItemIndex ); |
|
254 |
|
255 /** |
|
256 * From MMmDragAndDropObserver. |
|
257 * Handles the event of dragging an item over a different one. |
|
258 * Used to change presentation of folder icons to indicate drop into action. |
|
259 * |
|
260 * @since S60 v5.0 |
|
261 * @param aModelItemIndex Index of the item. |
|
262 */ |
|
263 void HandleDragOverL( TInt aModelItemIndex ); |
|
264 |
|
265 /** |
|
266 * From MMmDragAndDropObserver. |
|
267 * Handles the stop of dragging of an item. |
|
268 * |
|
269 * @since S60 v5.0 |
|
270 * @param aModelItemIndex Index of the dragged item. |
|
271 */ |
|
272 void HandleDragStopL( TInt aModelItemIndex ); |
|
273 |
|
274 /** |
|
275 * From MMmDragAndDropObserver. |
|
276 * Handles update of dragged item index. |
|
277 * |
|
278 * @since S60 v5.0 |
|
279 * @param aModelItemIndex New dragged item index. |
|
280 */ |
|
281 void HandleDraggedIndexUpdatedL( TInt aModelItemIndex ); |
|
282 |
|
283 // from base class MAknToolbarObserver |
|
284 |
|
285 /** |
|
286 * From MAknToolbarObserver. |
|
287 * Handles toolbar events for a certain toolbar item. |
|
288 * |
|
289 * @since S60 v5.0 |
|
290 * @param aCommand The command ID of some toolbar item. |
|
291 */ |
|
292 void OfferToolbarEventL( TInt aCommand ); |
|
293 |
|
294 // from base class MHnControllerInterface |
|
295 /** |
|
296 * From MHnControllerInterface. |
|
297 * Execute extension manager action. |
|
298 * |
|
299 * @since S60 v5.0 |
|
300 * @param aUid UID of the ECom plugin's. |
|
301 * @param aCommand Command which has to be executed on the plugin. |
|
302 * Request to the Service. |
|
303 * @param aEventParamList List of the event parameters needed to |
|
304 * execute action. Extention Manager is its owner. |
|
305 * @return Number representing error code. |
|
306 */ |
|
307 TInt ExecuteExtensionActionL( const TUid aUid , const TDesC& aCommand, |
|
308 CLiwGenericParamList* aEventParamList ); |
|
309 |
|
310 // from MMmPropertyChangeObserver |
|
311 /** |
|
312 * Called when property changed |
|
313 * @since S60 v3.0 |
|
314 */ |
|
315 void PropertyChangedL(TInt aValue); |
|
316 |
|
317 /** |
|
318 * Sets the zoom for the application. |
|
319 */ |
|
320 void SetZoom( TAknUiZoom aZoom ); |
|
321 |
|
322 /** |
|
323 * Reloads cascade menu map. |
|
324 */ |
|
325 void ReloadCascadeMenuMapL(); |
|
326 |
|
327 |
|
328 /** |
|
329 * Called by the skin server when skin content is changed and the |
|
330 * connected client wants to be informed. |
|
331 * |
|
332 * @since 2.0 |
|
333 */ |
|
334 void SkinContentChanged(); |
|
335 |
|
336 /** |
|
337 * Called by the skin server to indicate that the current skin |
|
338 * configuration has changed. |
|
339 * |
|
340 * @param aReason Reason code. |
|
341 * |
|
342 * @since 2.5 |
|
343 */ |
|
344 void SkinConfigurationChanged( |
|
345 const TAknsSkinStatusConfigurationChangeReason aReason ); |
|
346 |
|
347 /** |
|
348 * Called by the skin server to indicate that the available |
|
349 * skin packages have changed. |
|
350 * |
|
351 * @param aReason Reason code. |
|
352 * |
|
353 * @since 2.5 |
|
354 */ |
|
355 void SkinPackageChanged( |
|
356 const TAknsSkinStatusPackageChangeReason aReason ); |
|
357 |
|
358 private: |
|
359 |
|
360 /** |
|
361 * Enum defining possible exit types for ExitMenuL method. |
|
362 * |
|
363 * @since S60 v5.0 |
|
364 */ |
|
365 enum TExitType |
|
366 { |
|
367 EExitReally, |
|
368 EExitToIdle, |
|
369 EExitToPhone |
|
370 }; |
|
371 |
|
372 /** |
|
373 * Enum defining possible exit types for ExitMenuL method. |
|
374 * |
|
375 * @since S60 v5.0 |
|
376 */ |
|
377 enum TExitKeyType |
|
378 { |
|
379 EExitKeyApplication, |
|
380 EExitKeyRed |
|
381 }; |
|
382 |
|
383 /** |
|
384 * Defiens edit mode state. |
|
385 * |
|
386 * @since S60 v5.0 |
|
387 */ |
|
388 enum TEditModeStatus |
|
389 { |
|
390 ENoEditMode, |
|
391 ETransitionToEditMode, |
|
392 EEditMode, |
|
393 ETransitionFromEditMode, |
|
394 EFastTransitionFromEditMode |
|
395 }; |
|
396 |
|
397 /** |
|
398 * Indicates if edit mode is on. |
|
399 * |
|
400 * @since S60 v5.0 |
|
401 * @return Returns edit mode status. |
|
402 */ |
|
403 TBool IsEditMode(); |
|
404 |
|
405 /** |
|
406 * Adjusts highlight when entering or leaving edit mode. |
|
407 * |
|
408 * @since S60 v5.0 |
|
409 * @param aOriginalHighlight Highlight that would normally be set |
|
410 * @return A modified value of highlight |
|
411 */ |
|
412 TInt AdjustEditModeHighlightL( TInt aOriginalHighlight ); |
|
413 |
|
414 /** |
|
415 * Manages the container lookup. |
|
416 * |
|
417 * @since S60 v5.0 |
|
418 * @return Pointer to the container to be loaded, of NULL |
|
419 * if a new container should be created. |
|
420 */ |
|
421 CMmWidgetContainer* GetAppropriateContainerToLoadL(); |
|
422 |
|
423 /** |
|
424 * Submits an asynchronous service request to show user a message |
|
425 * when Matrix Menu is out of memory. |
|
426 * |
|
427 * @since S60 v5.0 |
|
428 */ |
|
429 void HandleOutOfMemoryL(); |
|
430 |
|
431 /** |
|
432 * Resets MM App UI to the initial state (most of the fields). |
|
433 * |
|
434 * @since S60 v5.0 |
|
435 */ |
|
436 void ResetToInitialStateL(); |
|
437 |
|
438 /** |
|
439 * Refreshes menu pane if needed |
|
440 */ |
|
441 void HideMenuPaneIfVisibleL(); |
|
442 |
|
443 // from base class CEikAppUi |
|
444 |
|
445 /** |
|
446 * From CEikAppUi. |
|
447 * Takes care of command handling. |
|
448 * |
|
449 * @since S60 v5.0 |
|
450 * @param aCommand Command to be handled. |
|
451 */ |
|
452 void HandleCommandL( TInt aCommand ); |
|
453 |
|
454 /** |
|
455 * From CEikAppUi. |
|
456 * Handles Window Server events. |
|
457 * |
|
458 * @since S60 v5.0 |
|
459 * @param aEvent Event to be handled. |
|
460 * @param aDestination Destination control. |
|
461 */ |
|
462 void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); |
|
463 |
|
464 /** |
|
465 * Indicates if root (main) view is displayed. |
|
466 * |
|
467 * @since S60 v5.0 |
|
468 * @return ETrue if root displayed, EFalse otherwise. |
|
469 */ |
|
470 TBool IsRootdisplayedL(); |
|
471 |
|
472 /** |
|
473 * Handles pen down events for an item. |
|
474 * |
|
475 * @since S60 v5.0 |
|
476 * @param aIndex Item index. |
|
477 */ |
|
478 void HandleHighlightItemPenDownL( TInt aIndex ); |
|
479 |
|
480 /** |
|
481 * Handles single click event on widget item. |
|
482 * |
|
483 * @since S60 v5.0 |
|
484 * @param aIndex Clicked item index. |
|
485 */ |
|
486 void HandleHighlightItemSingleClickedL( TInt aIndex ); |
|
487 |
|
488 /** |
|
489 * Handles drag event. |
|
490 * |
|
491 * @since S60 v5.0 |
|
492 */ |
|
493 void HandleEventDraggingActionedL(); |
|
494 |
|
495 /** |
|
496 * Handles click (select) events for an item. |
|
497 * |
|
498 * @since S60 v5.0 |
|
499 * @param aIndex Item index. |
|
500 */ |
|
501 void HandleHighlightItemDoubleClickedL( TInt aIndex ); |
|
502 |
|
503 /** |
|
504 * Handles suite model initialized event. |
|
505 * |
|
506 * @param aModel Suite model that has been initialized. |
|
507 * @since S60 v5.0 |
|
508 */ |
|
509 void HandleSuiteModelInitializedL( CHnSuiteModel* aModel ); |
|
510 |
|
511 /** |
|
512 * Handles suite update events. |
|
513 * |
|
514 * @since S60 v5.0 |
|
515 */ |
|
516 void UpdateL(); |
|
517 |
|
518 /** |
|
519 * Handles suite remove events. |
|
520 * |
|
521 * @since S60 v5.0 |
|
522 */ |
|
523 void RemoveL(); |
|
524 |
|
525 /** |
|
526 * Handles suite insert events. |
|
527 * |
|
528 * @since S60 v5.0 |
|
529 */ |
|
530 void InsertL(); |
|
531 |
|
532 /** |
|
533 * Handles the "Back" softkey event. |
|
534 * |
|
535 * @since S60 v5.0 |
|
536 */ |
|
537 void HandleBackCommandL(); |
|
538 |
|
539 /** |
|
540 * Refreshes toolbar. |
|
541 * |
|
542 * @since S60 v5.0 |
|
543 */ |
|
544 void RefreshToolbarL(); |
|
545 |
|
546 /** |
|
547 * Updates app's presentation to show desired suite content. |
|
548 * |
|
549 * @since S60 v5.0 |
|
550 */ |
|
551 void ShowSuiteL(); |
|
552 |
|
553 /** |
|
554 * Creates new container for suite model. |
|
555 * |
|
556 * @since S60 v5.0 |
|
557 * @param aSuiteModel Suite model to load. |
|
558 * @param aContainerToLoad Target pointer for the new container. |
|
559 * @return ETrue if operation is succesful, EFalse otherwise |
|
560 */ |
|
561 TBool CreateNewContainerL( CHnSuiteModel* aSuiteModel, |
|
562 CMmWidgetContainer*& aContainerToLoad ); |
|
563 |
|
564 /** |
|
565 * Forwards the passed event code to Hierarchy Navigator for handling. |
|
566 * |
|
567 * @since S60 v5.0 |
|
568 * @param aEvent Event code. |
|
569 */ |
|
570 void ForwardEventToHNL( TInt aEvent ); |
|
571 |
|
572 /** |
|
573 * Forwards the passed event code to Hierarchy Navigator for handling |
|
574 * regarding the current suite's item referred to by itemid. |
|
575 * |
|
576 * @since S60 v5.0 |
|
577 * @param aEvent Event code. |
|
578 * @param aItemId Item ID. |
|
579 * @param aEventParams Additional parameters. |
|
580 */ |
|
581 void ForwardEventToHNL( TInt aEvent, TInt aItemId, |
|
582 CLiwGenericParamList* aEventParams = NULL ); |
|
583 |
|
584 /** |
|
585 * Sets the Status Pane and CBA to indicate the current open suite. |
|
586 * |
|
587 * @param aReset Indicates if status pane should be reset. |
|
588 * @since S60 v5.0 |
|
589 */ |
|
590 void RefreshUiPanesL( TBool aReset = EFalse ); |
|
591 |
|
592 /** |
|
593 * Checks recieved messages and forwards to HN. |
|
594 * |
|
595 * @since S60 v5.0 |
|
596 * @param aMessage The message. |
|
597 */ |
|
598 void HandleMessageL( const TDesC8& aMessage ); |
|
599 |
|
600 /** |
|
601 * Gets the resource ID of the first free cascade menu pane container. |
|
602 * Resource containers are defined in nsui.rss under |
|
603 * r_main_menu_pane_cascade_* tags. |
|
604 * |
|
605 * @since @since S60 v5.0 |
|
606 * @return The ID of the first available cascade manu pane resource |
|
607 * container, or KErrNotFound if none available. |
|
608 */ |
|
609 TInt GetNextCascadeMenuResourceId(); |
|
610 |
|
611 /** |
|
612 * Handles the update of current shown container. |
|
613 * |
|
614 * @since S60 v5.0 |
|
615 * @param aWidgetContainer The widget container to be shown. |
|
616 */ |
|
617 void HandlePresentationChangeL( CMmWidgetContainer* aWidgetContainer ); |
|
618 |
|
619 /** |
|
620 * Handles the switching of visible containers. |
|
621 * |
|
622 * @since S60 v5.0 |
|
623 * @param aWidgetContainer The widget to switch to. |
|
624 */ |
|
625 void HandleWidgetChangeRefreshL( CMmWidgetContainer* aWidgetContainer ); |
|
626 |
|
627 /** |
|
628 * Handles the refresh if no widget change occured. |
|
629 * Just model on the stack changed. |
|
630 * |
|
631 * @since S60 v5.0 |
|
632 */ |
|
633 void HandleNoWidgetChangeRefreshL(); |
|
634 |
|
635 /** |
|
636 * Shows or hides toolbar depending on context. |
|
637 * |
|
638 * @since S60 v5.0 |
|
639 */ |
|
640 void HandleToolbarVisibilityL(); |
|
641 |
|
642 /** |
|
643 * Updates the toolbar content. |
|
644 * |
|
645 * @since S60 v5.0 |
|
646 */ |
|
647 void UpdateToolbarL(); |
|
648 |
|
649 /** |
|
650 * Sets the Edit Mode. |
|
651 * |
|
652 * @since S60 v5.0 |
|
653 * @param aIsEditMode ETrue if edit mode needs to be turned on. |
|
654 */ |
|
655 void SetEditModeL( TBool aIsEditMode ); |
|
656 |
|
657 /** |
|
658 * Returns TAT/Kastor effect rectangle. |
|
659 * |
|
660 * @since S60 v5.0 |
|
661 * @param aItemModel Model of the selected item. |
|
662 * @param aItemId Item ID. |
|
663 * @return Screen rect of the selected item. |
|
664 */ |
|
665 TRect GetKastorRectL( CHnItemModel* aItemModel, TInt aItemId ); |
|
666 |
|
667 /** |
|
668 * Returns TAT/Kastor effect depends on selected item. |
|
669 * |
|
670 * @since S60 v5.0 |
|
671 * @param aItemModel Model of the selected item. |
|
672 * @return Effect id depends on item type and status. |
|
673 */ |
|
674 TInt GetKastorEffectL( CHnItemModel* aItemModel ); |
|
675 |
|
676 /** |
|
677 * Handles exiting Matrix. |
|
678 * |
|
679 * @since S60 v5.0 |
|
680 * @param aExitType type of exit. |
|
681 */ |
|
682 void ExitMatrix( TExitType aExitType ); |
|
683 |
|
684 /** |
|
685 * Cleans up before exiting Matrix. |
|
686 * Stops edit mode and resets to root. |
|
687 * |
|
688 * @param aExitKey Red key or application key. |
|
689 * @since S60 v5.0 |
|
690 */ |
|
691 void CleanupForExitL( TExitKeyType aExitKey ); |
|
692 |
|
693 /** |
|
694 * Manages bringing homescreen and relevant apps to foreground. |
|
695 * |
|
696 * @since S60 v5.0 |
|
697 * @param aExitType type of exit. |
|
698 */ |
|
699 void ShowHomescreenL( TExitType aExitType ); |
|
700 |
|
701 /** |
|
702 * Places the homescreen window underneath the menu window. |
|
703 * |
|
704 * This method puts the homescreen window just below the matrix menu |
|
705 * window (assuming that matrix menu is running in the foreground) so |
|
706 * that if matrix gets closed and disappears from the screen, then |
|
707 * homescreen will be visible immediately. If it is impossible to do |
|
708 * so (for any reason), this method will call ShowHomescreenL. |
|
709 * |
|
710 * @since S60 v5.0 |
|
711 */ |
|
712 void PrepareHomescreenForMatrixExitL(); |
|
713 |
|
714 /** |
|
715 * Opens the desired application. |
|
716 * Used in exiting Matrix. |
|
717 * |
|
718 * @since S60 v5.0 |
|
719 * @param aUid UID of the app to open. |
|
720 */ |
|
721 void OpenAppL( const TUid aUid ); |
|
722 |
|
723 /** |
|
724 * Loads default root suite |
|
725 * |
|
726 * @since S60 v5.0 |
|
727 */ |
|
728 void InitializeL(); |
|
729 |
|
730 /** |
|
731 * Refreshes Cba according to current context. |
|
732 * |
|
733 * @since S60 v5.0 |
|
734 */ |
|
735 void RefreshCbaL(); |
|
736 |
|
737 /** |
|
738 * MSK text. |
|
739 * |
|
740 * @since S60 v5.0 |
|
741 */ |
|
742 void SetMiddleSoftKeyL(); |
|
743 |
|
744 /** |
|
745 * Starts fullscreen. |
|
746 * @param aKastorEffect Id of the TAT/Kastor effect. |
|
747 * |
|
748 * @since S60 v5.0 |
|
749 */ |
|
750 void StartLayoutSwitchFullScreen( TInt aKastorEffect |
|
751 = AknTransEffect::ELayoutSwitchStart); |
|
752 |
|
753 /** |
|
754 * Ends fullscreen |
|
755 * |
|
756 * @since S60 v5.0 |
|
757 */ |
|
758 void EndFullScreen(); |
|
759 |
|
760 // From MMActionRequest |
|
761 |
|
762 /** |
|
763 * Enables to issue a request to Hn engine. |
|
764 * |
|
765 * @since S60 v5.0 |
|
766 * @param aParam Input Parameters. |
|
767 * @param aOutput Target list for output. |
|
768 */ |
|
769 void HandleRequestL( const CLiwGenericParamList& aParam, |
|
770 CLiwGenericParamList* aOutput = NULL ); |
|
771 |
|
772 /** |
|
773 * Resets map of widget containers. |
|
774 * |
|
775 * @since S60 v5.0 |
|
776 */ |
|
777 void ResetContainerMap(); |
|
778 |
|
779 /** |
|
780 * Resets map of widget container to root. |
|
781 * |
|
782 * @since S60 v5.0 |
|
783 */ |
|
784 void ResetContainerMapToRootL(); |
|
785 |
|
786 /** |
|
787 * Called to retrive flip status. |
|
788 * |
|
789 * @since S60 v5.0 |
|
790 * @return Is flip open. |
|
791 */ |
|
792 TBool FlipOpen(); |
|
793 |
|
794 /** |
|
795 * Resets view to root. |
|
796 * |
|
797 * @return ETrue if view was not displaying root suite already, EFalse otherwise |
|
798 */ |
|
799 TBool ResetToRootL(); |
|
800 |
|
801 /** |
|
802 * Refreshes icons after skin changing |
|
803 */ |
|
804 void RefreshIconsL(); |
|
805 |
|
806 /** |
|
807 * Forward event to hierarchy navigator. |
|
808 * |
|
809 * @param aOffset Highlight offset. |
|
810 */ |
|
811 void HandleHighlightOffsetL( TInt aOffset ); |
|
812 |
|
813 /** |
|
814 * Replaces ETransitionFromEditMode or EFastTransitionFromEditMode to ENoEditMode |
|
815 */ |
|
816 void ClearTransitionFromEditModeFlag(); |
|
817 /** |
|
818 * Method inherited from CEikAppUi to handle |
|
819 * out of memory problem. |
|
820 * |
|
821 * @param aError KErrNoMemory is handled. |
|
822 * @param aExtErr Not used. |
|
823 * @param aErrorText Not used. |
|
824 * @param aContextText Not used. |
|
825 * @return EErrorNotHandled in order to display proper information. |
|
826 */ |
|
827 TErrorHandlerResponse HandleError( TInt aError, |
|
828 const SExtendedError &aExtErr, |
|
829 TDes &aErrorText, |
|
830 TDes &aContextText ); |
|
831 |
|
832 /** |
|
833 * Update widget data for number of items changed. |
|
834 * |
|
835 * @param aChange type of change. |
|
836 */ |
|
837 void HandleNumberOfItemsChangedL( TItemsChangeType aChange ); |
|
838 |
|
839 /** |
|
840 * Sets the highlighted item in gui objects accordingly to what |
|
841 * is stored in the model. The exact result of calling this |
|
842 * method depends on @c iMakeHightlightedItemFullyVisible |
|
843 * flag. |
|
844 */ |
|
845 void ApplyHighlightFromModelL(); |
|
846 |
|
847 /** |
|
848 * Called when EFocusGained message is received by menu. |
|
849 * Should be called only from HandleWsEvent. |
|
850 */ |
|
851 void HandleFocusGainedL(); |
|
852 |
|
853 /** |
|
854 * Called when application is sent to foreground. |
|
855 * Should be called only from HandleWsEvent. |
|
856 */ |
|
857 void HandleFullOrPartialForegroundGainedL(); |
|
858 |
|
859 /** |
|
860 * Called when application is sent to background. |
|
861 * Should be called only from HandleWsEvent. |
|
862 */ |
|
863 void HandleFullOrPartialForegroundLostL(); |
|
864 |
|
865 /** |
|
866 * Called when EFocusLost message is received by menu. |
|
867 * Should be called only from HandleWsEvent. |
|
868 */ |
|
869 void HandleFocusLostL(); |
|
870 |
|
871 /** |
|
872 * Detects when options menu pops up and hides. |
|
873 */ |
|
874 void DetectOptionsMenuOpenDisplayChangeL(); |
|
875 |
|
876 private: // Data |
|
877 |
|
878 /** |
|
879 * Grid's Container Widget. |
|
880 * Own. |
|
881 */ |
|
882 //CMmWidgetContainer* iGridContainer; |
|
883 |
|
884 /** |
|
885 * List's Container Widget. |
|
886 * Own. |
|
887 */ |
|
888 //CMmWidgetContainer* iListboxContainer; |
|
889 |
|
890 /** |
|
891 * Current visible Widget. |
|
892 * Not own. |
|
893 */ |
|
894 CMmWidgetContainer* iCurrentContainer; |
|
895 |
|
896 /** |
|
897 * Hash map containig widget containers, with corresponding |
|
898 * suite id. |
|
899 */ |
|
900 RHashMap< TInt, CMmWidgetContainer* > iContainerMap; |
|
901 |
|
902 /** |
|
903 * Array of container pointers, whose deletion should |
|
904 * be delayed. |
|
905 */ |
|
906 RPointerArray< CMmWidgetContainer > iGarbage; |
|
907 |
|
908 /** |
|
909 * Current suite model |
|
910 * Not own. |
|
911 */ |
|
912 CHnSuiteModel* iCurrentSuiteModel; |
|
913 |
|
914 /** |
|
915 * Hierarchy Navigator |
|
916 * Own. |
|
917 */ |
|
918 CHnInterface* iHNInterface; |
|
919 |
|
920 /** |
|
921 * Hash map for dynamic initialization of cascade menu panes. |
|
922 * Contains item iterator pointers indexed with cascade pane resource IDs. |
|
923 * MHnMdMenuItemIterator items not owned. |
|
924 */ |
|
925 RHashMap<TInt, MHnMenuItemModelIterator*> iCascadeMenuMap; |
|
926 |
|
927 /** |
|
928 * Indicates the edit mode status. |
|
929 */ |
|
930 TEditModeStatus iEditModeStatus; |
|
931 |
|
932 /** |
|
933 * Pointer to application's custom toolbar. |
|
934 * Own. |
|
935 */ |
|
936 CAknToolbar* iToolbar; |
|
937 |
|
938 /** |
|
939 * Index of dragged item. |
|
940 */ |
|
941 TInt iItemDragged; |
|
942 |
|
943 /** |
|
944 * Model ID of the dragged item. |
|
945 */ |
|
946 TInt iIdDragged; |
|
947 |
|
948 /** |
|
949 * Locks select events for highlight based scrolling. |
|
950 */ |
|
951 TBool iKeyClickLocked; |
|
952 |
|
953 /** |
|
954 * Indicates if TAT/Kastor effect is started. |
|
955 */ |
|
956 TBool iIsKastorEffectStarted; |
|
957 |
|
958 /** |
|
959 * Extension manager. |
|
960 * Own. |
|
961 */ |
|
962 CMMExtensionManager* iMmExtManager; |
|
963 |
|
964 /** |
|
965 * Sliding keyboard (flip) status |
|
966 */ |
|
967 EPSHWRMFlipStatus iKeyboardFlipStatus; |
|
968 |
|
969 /** |
|
970 * Slider event subscriber |
|
971 * own |
|
972 */ |
|
973 CMmPropertySubscriber* iSliderEventSubscriber; |
|
974 |
|
975 /** |
|
976 * Current zoom; |
|
977 */ |
|
978 TAknUiZoom iZoom; |
|
979 |
|
980 /** |
|
981 * Screen state. |
|
982 */ |
|
983 TBool iScreenOn; |
|
984 |
|
985 /** |
|
986 * Skin change needed |
|
987 */ |
|
988 TBool iSkinChangeNeeded; |
|
989 |
|
990 /** |
|
991 * Template library. |
|
992 */ |
|
993 CMmTemplateLibrary* iTemplateLibrary; |
|
994 |
|
995 /** |
|
996 * Skin server session. |
|
997 */ |
|
998 RAknsSrvSession iSkinSrvSession; |
|
999 |
|
1000 /** |
|
1001 * Skin change in progress |
|
1002 */ |
|
1003 TBool iSkinChangeInProgress; |
|
1004 |
|
1005 /** |
|
1006 * Widget container that contains only an empty listbox. |
|
1007 * It is displayed only when there is no other container that |
|
1008 * could be displayed. It is needed to avoid ugly flicker |
|
1009 * effects where homescreen becomes visible for a fraction of |
|
1010 * second. |
|
1011 */ |
|
1012 CMmWidgetContainer* iDummyContainer; |
|
1013 |
|
1014 /** |
|
1015 * A template library for iDummyContainer; |
|
1016 */ |
|
1017 CMmTemplateLibrary* iDummyTemplateLib; |
|
1018 |
|
1019 /** |
|
1020 * Out-of-memory condition handler. |
|
1021 */ |
|
1022 CMmNoMemory* iOutOfMemoryHandler; |
|
1023 |
|
1024 /** |
|
1025 * This flag is intended for indicating that the highlithted item must |
|
1026 * be fully visible. It is only used in two cases: |
|
1027 * 1. When an item has been drag-and-dropped into a folder (the item |
|
1028 * moved into the folder must be fully visible when the target suite |
|
1029 * is displayed). |
|
1030 * 2. When turning on edit mode (the item highlighted must be fully |
|
1031 * visible once edit mode is turned on). |
|
1032 */ |
|
1033 TBool iMakeHightlightedItemFullyVisible; |
|
1034 |
|
1035 /** |
|
1036 * An low priority active object used as a helper to detect frequent and |
|
1037 * quick appkey pressing. |
|
1038 * Owns. |
|
1039 */ |
|
1040 CMmAppkeyHandler* iAppkeyHandler; |
|
1041 |
|
1042 /** |
|
1043 * ETrue if Matrix menu has focus i.e. it is in foreground and is not eclipsed |
|
1044 * by any popup note that is not originating from Matrix menu. |
|
1045 */ |
|
1046 TBool iHasFocus; |
|
1047 |
|
1048 /** |
|
1049 * Own. |
|
1050 * Popup menu displayed after long tap. |
|
1051 */ |
|
1052 CAknStylusPopUpMenu* iPopupMenu; |
|
1053 |
|
1054 /** |
|
1055 * Application UI factory for this app UI object. |
|
1056 */ |
|
1057 MEikAppUiFactory* iAppUiFactory; |
|
1058 |
|
1059 /** |
|
1060 * ETrue if Options menu is open. |
|
1061 */ |
|
1062 TBool iOptionsMenuIsOpen; |
|
1063 |
|
1064 }; |
|
1065 |
|
1066 #endif // C_MMAPPUI_H |
|
1067 |
|
1068 // End of File |
|
1069 |