|
1 /* |
|
2 * Copyright (c) 2002-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __AKNAPPUI_H__ |
|
19 #define __AKNAPPUI_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <eikappui.h> |
|
23 #include <eikspane.h> |
|
24 #include <eikcba.h> |
|
25 #include <avkon.hrh> |
|
26 #include <AknDef.h> |
|
27 #include <akntouchpaneobserver.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CEikButtonGroupContainer; |
|
31 class CAknAppShutter; |
|
32 class CAknAppUiExtension; |
|
33 class CAknWsEventMonitor; |
|
34 class CAknKeySoundSystem; |
|
35 class CAknAppUiBaseExtension; |
|
36 class CAknTouchPane; |
|
37 class CAknToolbar; |
|
38 class CAknPointerEventModifier; |
|
39 |
|
40 // MACROS |
|
41 #define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi()) |
|
42 #define iAvkonAppUiBase ((CAknAppUiBase*)CEikonEnv::Static()->EikAppUi()) |
|
43 |
|
44 /** |
|
45 * Avkon key resolver interface |
|
46 * |
|
47 * @since S60 3.1 |
|
48 */ |
|
49 class MAknAliasKeyCodeResolver |
|
50 { |
|
51 public: |
|
52 /** |
|
53 * Resolves keyboard layout dependent keycode for the given event |
|
54 * |
|
55 * @since S60 3.1 |
|
56 * @param aCode reference to variable to contain new keycode |
|
57 * @param aKeyEvent reference to original, complete, event |
|
58 * @param aType indicating original event type |
|
59 * @return KErrNone on success, otherwise system wide error codes |
|
60 */ |
|
61 virtual TInt GetAliasKeyCode(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType)=0; |
|
62 }; |
|
63 |
|
64 // CLASS DECLARATION |
|
65 |
|
66 /** |
|
67 * Abstract Avkon application UI base class |
|
68 * |
|
69 * @since S60 3.0 |
|
70 */ |
|
71 class CAknAppUiBase : public CEikAppUi |
|
72 { |
|
73 private: |
|
74 friend class CAknAppUi; |
|
75 enum |
|
76 { |
|
77 EAppOrientationSpecifiedFlag = 0x00010000, // In area reserved for System Guis |
|
78 EAppOrientationLandscapeFlag = 0x00020000, |
|
79 EAppOrientationAutomaticFlag = 0x00040000, |
|
80 EAknEnableSkinFlag = 0x00080000, |
|
81 // Since 3.0 |
|
82 EAknDisableHighlightAnimationFlag = 0x00100000, |
|
83 EAknEnableMSKflag = 0x00200000, |
|
84 /** |
|
85 * When enabled, avkon does not complete startup effect |
|
86 * application has to do it by itself. |
|
87 * |
|
88 * @since S60 3.2 |
|
89 * |
|
90 */ |
|
91 EAknExplicitStartupEffectCompletionFlag = 0x00400000, |
|
92 |
|
93 /** |
|
94 * Application supports touch (doesn't need keyboard). If the flag |
|
95 * is missing and compatibility mode is enabled in a device, |
|
96 * application is run in a compatibility mode (QVGA window with a |
|
97 * virtual keypad. |
|
98 * |
|
99 * @since S60 5.0 |
|
100 */ |
|
101 EAknTouchCompatibleFlag = 0x00800000, |
|
102 |
|
103 /** |
|
104 * Application supports single click. |
|
105 * |
|
106 * @since S60 5.2 |
|
107 */ |
|
108 EAknSingleClickCompatibleFlag = 0x01000000 |
|
109 }; |
|
110 |
|
111 public: |
|
112 |
|
113 enum TAppUiOrientation |
|
114 { |
|
115 /** |
|
116 * Use the default device screen rotation of the product for this |
|
117 * application. This is the default rotation setting for an |
|
118 * application, and it should be used by nearly all applications. |
|
119 */ |
|
120 EAppUiOrientationUnspecified, |
|
121 /** |
|
122 * Use a portrait screen rotation for this application. |
|
123 * This should only be used when an application specifically wants |
|
124 * portrait rotation. The device will select an appropriate portrait |
|
125 * rotation, if one is available. |
|
126 */ |
|
127 EAppUiOrientationPortrait, |
|
128 /** |
|
129 * Use a landscape screen rotation for this application. |
|
130 * This should only be used when an application specifically wants |
|
131 * landscape rotation. The device will select an appropriate landscape |
|
132 * rotation, if one is available. |
|
133 */ |
|
134 EAppUiOrientationLandscape, |
|
135 /** |
|
136 * Use the normal device screen rotation for this application. |
|
137 * Both portrait and landscape screen rotations are possible. The |
|
138 * application rotation follows device screen rotation. |
|
139 */ |
|
140 EAppUiOrientationAutomatic |
|
141 }; |
|
142 enum |
|
143 { |
|
144 /** |
|
145 * Flag indicating that default skin parameters should be provided by |
|
146 * UI controls created within the scope of this AppUi instance. |
|
147 * This value (or binary combination with some other values) should |
|
148 * be given as a parameter to <code>BaseConstructL</code> in case |
|
149 * the application wants to enable default skin parameters for all |
|
150 * the Avkon controls supporting them. |
|
151 * |
|
152 * Note: The value can be queried by using |
|
153 * <code>AknsUtils::AvkonSkinEnabled()</code> from AknSkins.lib. |
|
154 * |
|
155 * @since S60 2.0 |
|
156 */ |
|
157 EAknEnableSkin = EAknEnableSkinFlag, |
|
158 EAppOrientationPortrait = EAppOrientationSpecifiedFlag, |
|
159 EAppOrientationLandscape = EAppOrientationSpecifiedFlag |
|
160 | EAppOrientationLandscapeFlag, |
|
161 EAppOrientationAutomatic = EAppOrientationSpecifiedFlag |
|
162 | EAppOrientationAutomaticFlag, |
|
163 // Since 3.0 |
|
164 EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag, |
|
165 // Since 3.1 |
|
166 EAknEnableMSK = EAknEnableMSKflag, |
|
167 // Since 3.2 |
|
168 EAknExplicitStartupEffectCompletion = EAknExplicitStartupEffectCompletionFlag, |
|
169 // Since 5.0 |
|
170 EAknTouchCompatible = EAknTouchCompatibleFlag, |
|
171 // Since 5.2 |
|
172 EAknSingleClickCompatible = EAknSingleClickCompatibleFlag |
|
173 }; |
|
174 enum TKeyEventFlag |
|
175 { |
|
176 EDisableSendKeyShort = 0x01, // Short press of send key |
|
177 EDisableSendKeyLong = 0x02 // Long press of send key |
|
178 }; |
|
179 |
|
180 public: |
|
181 /** |
|
182 * Destructor. |
|
183 */ |
|
184 IMPORT_C ~CAknAppUiBase(); |
|
185 |
|
186 /** |
|
187 * C++ Default constructor. |
|
188 */ |
|
189 IMPORT_C CAknAppUiBase(); |
|
190 public: |
|
191 |
|
192 /** |
|
193 * Initialises this Avkon base app UI with standard values. |
|
194 * @c aAppUiFlags values are common with |
|
195 * @c CEikAppUi::BaseConstructL(aAppUiFlags). |
|
196 * @param aAppUiFlags Application user interface flags. |
|
197 */ |
|
198 IMPORT_C void BaseConstructL( TInt aAppUiFlags ); |
|
199 |
|
200 /** |
|
201 * Handles changes in keyboard focus when an application switches to, |
|
202 * or from, the foreground. This function calls |
|
203 * @c CEikAppUi::HandleForegroundEventL. |
|
204 * @param aForeground @c ETrue if the application is in the foreground, |
|
205 * otherwise @c EFalse. |
|
206 */ |
|
207 IMPORT_C void HandleForegroundEventL(TBool aForeground); |
|
208 |
|
209 public: // From CEikAppUi |
|
210 |
|
211 /** |
|
212 * From @c CEikAppUi. Completes construction. The implementation of |
|
213 * @c ConstructL() in @c CAknAppUiBase simply calls @c BaseConstructL(). |
|
214 */ |
|
215 IMPORT_C void ConstructL(); // virtual |
|
216 |
|
217 /** |
|
218 * From @c CEikAppUi. Closes the app UI. |
|
219 */ |
|
220 IMPORT_C void Exit(); //virtual |
|
221 |
|
222 /** |
|
223 * From @c CEikAppUi. Sets whether the windows are faded. |
|
224 * @param aFaded @c ETrue if windows are faded, otherwise windows are |
|
225 * unfaded. |
|
226 */ |
|
227 IMPORT_C void SetFadedL(TBool aFaded); // virtual |
|
228 |
|
229 /** |
|
230 * From @c CEikAppUi. Handles a change to the application's resources which |
|
231 * are shared across the environment. This function calls |
|
232 * @c CEikAppUi::HandleResourceChangeL except when @c aType is |
|
233 * @c KEikDynamicLayoutVariantSwitch. |
|
234 * @param aType The type of resources that have changed. |
|
235 */ |
|
236 IMPORT_C void HandleResourceChangeL(TInt aType); // virtual |
|
237 |
|
238 /** |
|
239 * From @c CEikAppUi. Gets the total area of the screen available to the |
|
240 * application. This includes the space that is available for a toolbar, |
|
241 * toolband or title band, if the application requires them. |
|
242 * @return The total area of the screen available to the application. |
|
243 */ |
|
244 IMPORT_C TRect ApplicationRect() const; //virtual |
|
245 |
|
246 public: // from CCoeAppUiBase |
|
247 |
|
248 /** |
|
249 * From @c CCoeAppUiBase. Performs pre-exit processing by calling |
|
250 * @c CEikAppUi::PrepareToExit() to ensure the application will exit |
|
251 * cleanly. |
|
252 */ |
|
253 IMPORT_C void PrepareToExit(); |
|
254 public: // New Functions |
|
255 /** |
|
256 * Determines whether the system is faded. |
|
257 * @return @c ETrue if system is faded |
|
258 */ |
|
259 IMPORT_C TBool IsFaded() const; |
|
260 |
|
261 /** |
|
262 * Returns the object which allows events to be spyed upon in addition to |
|
263 * normal event handling. |
|
264 * @return Pointer to window server event monitor object. |
|
265 */ |
|
266 IMPORT_C CAknWsEventMonitor* EventMonitor() const; |
|
267 |
|
268 /** |
|
269 * Gets a pointer to KeySound API object. |
|
270 * @return Pointer to KeySound API object. |
|
271 */ |
|
272 IMPORT_C CAknKeySoundSystem* KeySounds() const; |
|
273 |
|
274 /** |
|
275 * Determines whether the application is full screen application. |
|
276 * @return @c ETrue if the application is full screen application. |
|
277 */ |
|
278 IMPORT_C TBool IsFullScreenApp() const; |
|
279 |
|
280 /** |
|
281 * Determines whether the application is layout aware. |
|
282 * @return @c ETrue if the application is layout aware. |
|
283 */ |
|
284 IMPORT_C TBool IsLayoutAwareApp() const; |
|
285 |
|
286 /** |
|
287 * Determines whether the application has MSK enabled. |
|
288 * @return @c ETrue if the application has MSK enabled. |
|
289 * |
|
290 * @since 3.1 |
|
291 */ |
|
292 TBool IsMSKEnabledApp() const; |
|
293 |
|
294 /** |
|
295 * Determines whether the application is closing. |
|
296 * In practice this means that CEikonEnv has been destroyed. |
|
297 * @return @c ETrue if the application is closing. |
|
298 * |
|
299 * @since 3.2 |
|
300 */ |
|
301 TBool IsAppClosing() const; |
|
302 |
|
303 /** |
|
304 * Set application layout aware. |
|
305 * @param aLayoutAwareApp @c ETrue if the application is layout aware, |
|
306 * @c EFlase otherwise. |
|
307 */ |
|
308 IMPORT_C void SetLayoutAwareApp(TBool aLayoutAwareApp); |
|
309 |
|
310 /** |
|
311 * Determines whether the application is foreground. |
|
312 * @return @c ETrue if the application is foreground. |
|
313 */ |
|
314 IMPORT_C TBool IsForeground() const; |
|
315 |
|
316 /** |
|
317 * Determines whether the application is partially foreground. |
|
318 * @return @c ETrue if the application is partially foreground. |
|
319 */ |
|
320 IMPORT_C TBool IsPartialForeground() const; |
|
321 |
|
322 /** |
|
323 * Gets the application screen orientation. |
|
324 * @return Application screen orientation. |
|
325 */ |
|
326 IMPORT_C TAppUiOrientation Orientation() const; |
|
327 |
|
328 /** |
|
329 * Tests whether it is possible for this app to have a |
|
330 * practical effect on the screen orientation, through |
|
331 * SetOrientationL(). |
|
332 * @since S60 3.2 |
|
333 * @return ETrue if SetOrientationL can change the orientation, EFalse otherwise. |
|
334 */ |
|
335 IMPORT_C TBool OrientationCanBeChanged() const; |
|
336 |
|
337 /** |
|
338 * Sets the application screen orientation. |
|
339 * Note: this API has no effect on non-full-screen app UIs. |
|
340 * @param aOrientation application screen orientation. |
|
341 */ |
|
342 IMPORT_C void SetOrientationL(TAppUiOrientation aOrientation); |
|
343 |
|
344 /** |
|
345 * Find the window group ID of the application below this application. |
|
346 * @return the window group ID of the application below this application. |
|
347 */ |
|
348 TInt FindAppWgIdBelowMeL(); |
|
349 |
|
350 /** |
|
351 * Simply return @c KEikPartialForeground if @c aPartialFg == @c ETrue, |
|
352 * otherwise if @c aForeground == @c ETrue then return @c EEventFocusGained |
|
353 * else return @c EEventFocusLost. |
|
354 * @return if @c aPartialFg then return KEikPartialForeground. |
|
355 */ |
|
356 TInt EventForForegroundState(TBool aPartialFg, TBool aForeground); |
|
357 |
|
358 /** |
|
359 * Determines whether the thread owning this application window group is |
|
360 * foreground. |
|
361 * @return @c ETrue if the thread owning this application window group is |
|
362 * foreground, @c EFlase otherwise. |
|
363 */ |
|
364 TBool ThreadIsForeground() const; |
|
365 |
|
366 /** |
|
367 * Simulates an event being received from wserv |
|
368 * @param aEvent the event id being simulated. |
|
369 */ |
|
370 void SimulateWsEventL(TInt aEvent); |
|
371 |
|
372 /** |
|
373 * Gets the application local zoom |
|
374 * @return Application local zoom |
|
375 * @since 3.1 |
|
376 */ |
|
377 IMPORT_C TAknUiZoom LocalUiZoom() const; |
|
378 |
|
379 /** |
|
380 * Sets the application local zoom. However, in order to have any |
|
381 * effect, it may be necessary to make a subsequent call to |
|
382 * @c ApplyLayoutChangeL. |
|
383 * |
|
384 * @param aZoom application local zoom |
|
385 * @since 3.1 |
|
386 */ |
|
387 IMPORT_C void SetLocalUiZoom(TAknUiZoom aZoom); |
|
388 |
|
389 /* |
|
390 * Can be used to apply changes to settings that affect the current layout, |
|
391 * such as changes to the local zoom. Optionally reports the change |
|
392 * to the layout to all controls in the application. There are a number of |
|
393 * different possible usages of this API: |
|
394 * <ul> |
|
395 * <li> Can be used to immediately change the local zoom, by passing in |
|
396 * ETrue for the reporting parameter.</li> |
|
397 * <li> Can be called before BaseConstructL without leaving, the effect |
|
398 * is the same as passing EFalse for the reporting parameter, as |
|
399 * the correct layout data is picked up later on during control layout.</li> |
|
400 * <li>Can be used by implementors of the |
|
401 * @c MAknSettingCacheUpdatePlugin interface, in order to set the local |
|
402 * zoom whilst updating the settings cache. By passing in EFalse for the |
|
403 * reporting parameter, the layout switch is deferred to the usual |
|
404 * processing in @c UpdateSettingCacheAndForwardEventL.</li> |
|
405 * <li> Can be used by controls that require a different local zoom to |
|
406 * the underlying application, such as a dialog. By not |
|
407 * reporting the change during construction, the dialog will lay itself out |
|
408 * correctly. However, the dialog must then report the change back to the |
|
409 * app zoom level when it closes, ignoring the resulting resource changed |
|
410 * layout switch event.</li> |
|
411 * </ul> |
|
412 * |
|
413 * @param aReportChange if this is true, then the layout event will be |
|
414 * reported to controls on the control stack |
|
415 * @since 3.1 |
|
416 */ |
|
417 IMPORT_C void ApplyLayoutChangeL(TBool aReportChange); |
|
418 |
|
419 /** |
|
420 * Checks if application UI has full or partial foreground status. |
|
421 * @since 3.2 |
|
422 * @return ETrue if application UI has full or partial foreground status. |
|
423 * Otherwise EFalse. |
|
424 */ |
|
425 TBool HasFullOrPartialForeground() const; |
|
426 |
|
427 /** |
|
428 * Sets the flags for default key event handling |
|
429 * @since 5.0 |
|
430 * @param aFlags which can be a combination of flags |
|
431 * declared in enumeration TKeyEventFlag |
|
432 */ |
|
433 IMPORT_C void SetKeyEventFlags( const TInt aFlags ); |
|
434 |
|
435 /** |
|
436 * Returns a pointer to appui's pointer event modifier. This method is |
|
437 * intended for internal usage only. |
|
438 * |
|
439 * @since S60 v5.0 |
|
440 * @return pointer event modifier |
|
441 */ |
|
442 IMPORT_C CAknPointerEventModifier* PointerEventModifier(); |
|
443 |
|
444 /** |
|
445 * Checks if the application is touch compatible i.e. it has been |
|
446 * constructed with the flag EAknTouchCompatible. |
|
447 * |
|
448 * @since S60 v5.0 |
|
449 * @return ETrue if the application is touch compatible |
|
450 */ |
|
451 IMPORT_C TBool IsTouchCompatible() const; |
|
452 |
|
453 /** |
|
454 * Checks if the application is single click compatible i.e. |
|
455 * it has been constructed with the flag EAknSingleClickCompatible. |
|
456 * |
|
457 * @since S60 v5.0 |
|
458 * @return ETrue if the application is single click compatible |
|
459 */ |
|
460 IMPORT_C TBool IsSingleClickCompatible() const; |
|
461 |
|
462 protected: // From CCoeAppUiBase |
|
463 /** |
|
464 * From @c CCoeAppUiBase. |
|
465 * Calls CCoeAppUi::HandleScreenDeviceChangedL(). |
|
466 */ |
|
467 IMPORT_C virtual void HandleScreenDeviceChangedL(); // was Reserved_1() |
|
468 |
|
469 protected: // From CCoeAppUi |
|
470 |
|
471 /** |
|
472 * From @c CCoeAppUi. Handles an application specific event. |
|
473 * @param aType The type of the event that occurred. This should be a |
|
474 * unique identifier constant. |
|
475 * @param aEvent The window server event that occurred. |
|
476 */ |
|
477 IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType, |
|
478 const TWsEvent& aEvent); |
|
479 |
|
480 protected: // New functions |
|
481 /** |
|
482 * Set the application to be a full screen application. |
|
483 * @param aIsFullScreen is @c ETrue if the application is a full screen |
|
484 * application, @c EFlase otherwise. |
|
485 */ |
|
486 IMPORT_C void SetFullScreenApp(TBool aIsFullScreen); |
|
487 |
|
488 /** |
|
489 * Replace current key sound server with new one. |
|
490 * @param aUid ID of the new key sound server. |
|
491 */ |
|
492 IMPORT_C void ReplaceKeySoundsL( TInt aUid ); |
|
493 |
|
494 protected: // from MObjectProvider |
|
495 IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
496 |
|
497 public: // not exported |
|
498 void SetScreenModeL(TInt aModeNumber); |
|
499 TInt ScreenMode() const; |
|
500 |
|
501 private: |
|
502 void UpdateSettingCacheAndForwardEventL( TInt aEventId ); |
|
503 // Method tests on aError. If < KErrNone, it calls CCoeEnv::SetAppUi in order to pass |
|
504 // ownership to the environment. CCoeEnv then will delete the AppUi at the usual point in the destruct order |
|
505 void SetAppUiAndLeaveIfErrorL( TInt aError ); |
|
506 TBool AlwaysForwardEvent( TInt aEventId ); |
|
507 void RelinquishPriorityToForegroundAppLC(); |
|
508 |
|
509 private: |
|
510 // Avkon app ui class flags |
|
511 TBitFlags iAknFlags; |
|
512 |
|
513 // Added for Avkon. Monitor events for emergency call support |
|
514 CAknWsEventMonitor* iEventMonitor; |
|
515 |
|
516 // Added for Avkon. Provides access to keysound server. |
|
517 // Moved from CAknAppUi, because CEikSrvUi needs it as well |
|
518 CAknKeySoundSystem* iKeySounds; |
|
519 |
|
520 CAknAppUiBaseExtension* iAppUiBaseExtension; |
|
521 }; |
|
522 |
|
523 /** |
|
524 * Abstract Avkon application UI class |
|
525 * |
|
526 * @since S60 0.9 |
|
527 */ |
|
528 |
|
529 class CAknAppUi : public CAknAppUiBase, MEikStatusPaneObserver, |
|
530 public MCoeViewDeactivationObserver, |
|
531 public MAknTouchPaneObserver |
|
532 { |
|
533 public: |
|
534 |
|
535 /** |
|
536 * Initialises this Avkon app UI with standard values. @c aAppUiFlags |
|
537 * values are common with @c CEikAppUi::BaseConstructL(aAppUiFlags). |
|
538 * Additionally those @c aAppUiFlags values can be bitwise ORed with |
|
539 * @c EAknEnableSkin flag to provide default skin parameters for this AppUi |
|
540 * instance. |
|
541 * @param aAppUiFlags Application user interface flags. |
|
542 */ |
|
543 IMPORT_C void BaseConstructL(TInt aAppUiFlags=EStandardApp); |
|
544 |
|
545 /** |
|
546 * Destructor. |
|
547 */ |
|
548 IMPORT_C ~CAknAppUi(); |
|
549 |
|
550 public: // From CEikAppUi |
|
551 /** |
|
552 * From @c CEikAppUi. Completes construction. The implementation of |
|
553 * @c ConstructL() in @c CAknAppUi simply calls @c BaseConstructL(). |
|
554 */ |
|
555 IMPORT_C void ConstructL(); // virtual |
|
556 |
|
557 public: |
|
558 /** |
|
559 * Gets a pointer to the status pane. |
|
560 * @return Pointer to the status pane |
|
561 */ |
|
562 IMPORT_C CEikStatusPane* StatusPane(); |
|
563 /** |
|
564 * Gets a pointer to the Command Button Area. |
|
565 * @return Pointer to the CBA |
|
566 */ |
|
567 IMPORT_C CEikButtonGroupContainer* Cba(); |
|
568 |
|
569 /** |
|
570 * Gets a pointer to the touch pane. |
|
571 * @return Pointer to the the touch pane |
|
572 * @since S60 5.0 |
|
573 */ |
|
574 IMPORT_C CAknTouchPane* TouchPane(); |
|
575 |
|
576 /** |
|
577 * Gets a pointer to the application toolbar. |
|
578 * @return Pointer to the applicaton toolbar or NULL |
|
579 * @since S60 3.1 |
|
580 */ |
|
581 IMPORT_C CAknToolbar* PopupToolbar() const; |
|
582 |
|
583 /** |
|
584 * Gets a pointer to the current toolbar( view toolbar is priority ). |
|
585 * @return Pointer to the current toolbar or NULL |
|
586 * @since S60 3.1 |
|
587 */ |
|
588 IMPORT_C CAknToolbar* CurrentPopupToolbar() const; |
|
589 |
|
590 /** |
|
591 * Gets a pointer to the current fixed toolbar( view toolbar is priority ). |
|
592 * @return Pointer to the current fixed toolbar or NULL |
|
593 * @since S60 5.0 |
|
594 */ |
|
595 IMPORT_C CAknToolbar* CurrentFixedToolbar() const; |
|
596 |
|
597 |
|
598 /** |
|
599 * Hides popup toolbar if it is visible |
|
600 * @since S60 3.1 |
|
601 */ |
|
602 void StopDisplayingPopupToolbar(); |
|
603 |
|
604 |
|
605 /** |
|
606 * Processes user commands. |
|
607 * This function passes @c aCommand (except values @c EAknSoftkeyOptions, |
|
608 * @c EAknCmdExit, @c EEikCmdCanceled) to user derived @c HandleCommandL. |
|
609 * @param aCommand A command ID. |
|
610 */ |
|
611 IMPORT_C void ProcessCommandL(TInt aCommand); |
|
612 |
|
613 |
|
614 /** |
|
615 * Handles errors. |
|
616 * @param aError The error code. |
|
617 * @param aExtErr For extended error messages. Not used. |
|
618 * @param aErrorText Error text. Not used. |
|
619 * @param aContextText Text describing the context of the error. Not used. |
|
620 * @return @c ENoDisplay if Error handled proper way, else |
|
621 * @c EErrorNotHandled |
|
622 */ |
|
623 IMPORT_C TErrorHandlerResponse HandleError (TInt aError, |
|
624 const SExtendedError& aExtErr, TDes& aErrorText, TDes& aContextText); |
|
625 |
|
626 /** |
|
627 * Run the application shutter if it exists. |
|
628 */ |
|
629 IMPORT_C void RunAppShutter(); |
|
630 |
|
631 /** |
|
632 * Determines whether the application shutter is active. |
|
633 * @return @c ETrue if application shutter is active. |
|
634 */ |
|
635 IMPORT_C TBool IsAppShutterRunning() const; |
|
636 |
|
637 /** |
|
638 * Determines whether the application is hidden in background. |
|
639 * (i.e. HideInBackground has been called and application has not |
|
640 * yet been activated) |
|
641 * @return @c ETrue if application is hidden in background. |
|
642 */ |
|
643 TBool IsAppHiddenInBackground() const; |
|
644 |
|
645 public: // MCoeViewDeactivationObserver |
|
646 |
|
647 /** |
|
648 * From @c MCoeViewDeactivationObserver. |
|
649 * Handles the deactivation of the view identified by |
|
650 * @c aViewIdToBeDeactivated before the newly activated view with id |
|
651 * @c aNewlyActivatedViewId is marked as current. |
|
652 * Default implementation calls @c iAvkonEnv->CloseAllIntermediateStates() |
|
653 * without using @c aViewIdToBeDeactivated and @c aNewlyActivatedViewId. |
|
654 * @param aViewIdToBeDeactivated |
|
655 * @param aNewlyActivatedViewId |
|
656 */ |
|
657 IMPORT_C virtual void HandleViewDeactivation( |
|
658 const TVwsViewId& aViewIdToBeDeactivated, |
|
659 const TVwsViewId &aNewlyActivatedViewId); |
|
660 |
|
661 public: // from CCoeAppUiBase |
|
662 |
|
663 /** |
|
664 * From @c CCoeAppUiBase. Performs pre-exit processing to ensure the |
|
665 * application will exit cleanly. |
|
666 */ |
|
667 IMPORT_C void PrepareToExit(); |
|
668 |
|
669 public: // from MAknTouchPaneObserver |
|
670 |
|
671 /** |
|
672 * From @MAknTouchPaneObserver. |
|
673 * Handles a change in the size or position of touch pane. |
|
674 */ |
|
675 IMPORT_C void HandleTouchPaneSizeChange(); |
|
676 |
|
677 protected: |
|
678 // from MEikStatusPaneObserver |
|
679 /** |
|
680 * From @c MEikStatusPaneObserver. Handles a change in the position or size |
|
681 * of the screen area occupied by the status pane. |
|
682 */ |
|
683 IMPORT_C void HandleStatusPaneSizeChange(); |
|
684 |
|
685 // from CCoeAppUi |
|
686 /** |
|
687 * From @c CCoeAppUi. Handles system events generated by the window server. |
|
688 * @param aEvent The window server event that occurred. |
|
689 */ |
|
690 IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent); |
|
691 |
|
692 protected: // formerly from MTopSetMember<CEikMenuBar>, now reserved |
|
693 IMPORT_C virtual void Reserved_MtsmPosition(); |
|
694 IMPORT_C virtual void Reserved_MtsmObject(); |
|
695 protected: |
|
696 |
|
697 /** |
|
698 * Handles changes in keyboard focus when an application switches to, |
|
699 * or from, the foreground. |
|
700 * @param aForeground @c ETrue if the application is in the foreground, |
|
701 * otherwise @c EFalse. |
|
702 */ |
|
703 IMPORT_C void HandleForegroundEventL(TBool aForeground); |
|
704 |
|
705 /** |
|
706 * Handles window server events. |
|
707 * @param aEvent The window server event that occurred. |
|
708 * @param aDestination The control associated with the event. |
|
709 */ |
|
710 IMPORT_C void HandleWsEventL(const TWsEvent& aEvent, |
|
711 CCoeControl* aDestination); |
|
712 |
|
713 /** |
|
714 * Set key block mode. |
|
715 * In default mode, the S60 Developer Platform blocks simultaneous key |
|
716 * presses. |
|
717 * @param aMode @c ENoKeyBlock if no key block, otherwise |
|
718 * @c EDefaultBlockMode |
|
719 */ |
|
720 IMPORT_C void SetKeyBlockMode(TAknKeyBlockMode aMode); |
|
721 IMPORT_C void HandleErrorL(TInt aError, HBufC** aErrorDesc, TBool aShowNote = ETrue ); |
|
722 |
|
723 #ifdef _DEBUG |
|
724 |
|
725 /** |
|
726 * Prints out information about the control and all its subcontrols to |
|
727 * RDebug console. |
|
728 * @param aControl object to be printed. |
|
729 * @param aLevel positioning constant. |
|
730 * @param aDebug stream for printing. |
|
731 */ |
|
732 void DumpControl(CCoeControl* aControl, TInt aLevel, RDebug& aDebug); |
|
733 #endif |
|
734 /** |
|
735 * Try to set window server buffer size to @c KAknDefaultWsBufferSize. |
|
736 */ |
|
737 void DecideWsClientBufferSizesL(); |
|
738 |
|
739 private: |
|
740 void UpdateKeyBlockMode(); |
|
741 TBool SimulateHashKeyMarkingEvent(const TWsEvent& aEvent); |
|
742 |
|
743 private: |
|
744 TBool iDumpNextControl; |
|
745 CAknAppShutter* iAppShutter;// May be set to NULL by the app shutter itself |
|
746 TAknKeyBlockMode iBlockMode; |
|
747 CAknAppUiExtension * iExtension; |
|
748 |
|
749 public: |
|
750 /** |
|
751 * Hide application from Fast-swap window. |
|
752 * @since S60 2.6 |
|
753 * @param aHide @c ETrue if application is hided from Fast-swap window, otherwise |
|
754 * @c EFalse |
|
755 */ |
|
756 IMPORT_C void HideApplicationFromFSW(TBool aHide=ETrue); |
|
757 |
|
758 /** |
|
759 * Gets keyboard layout specific keycode. Uses given resolver |
|
760 * SetAliasKeyCodeResolverL() if set, by default |
|
761 * fetches alternative code from avkon server. |
|
762 * |
|
763 * @since S60 3.1 |
|
764 * @param aCode reference to variable to contain new keycode |
|
765 * @param aKeyEvent reference to original, complete, event |
|
766 * @param aType indicating original event type |
|
767 */ |
|
768 IMPORT_C void GetAliasKeyCodeL(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType); |
|
769 |
|
770 /** |
|
771 * Sets custom resolver for keycode aliases |
|
772 * Creates iExtension if it doesn't exist |
|
773 * @since S60 3.1 |
|
774 * @param aHandler instance implementing MAknAliasKeyCodeResolver |
|
775 */ |
|
776 IMPORT_C void SetAliasKeyCodeResolverL(MAknAliasKeyCodeResolver* aResolver); |
|
777 |
|
778 /** |
|
779 * This is same as RWindowGroup::CaptureKey, except that this version takes |
|
780 * S60 keymappings into account and captures the key that produces requested |
|
781 * aKeyCode according to S60 keymappings. Standard RWindowgroup::CaptureKey |
|
782 * functionality takes place before S60 AppUi framework and has no knowledge |
|
783 * of S60 keymappings. |
|
784 * Note: This method requires same capabilites as RWindowGroup::CaptureKey() |
|
785 * |
|
786 * @since S60 V3.2 |
|
787 * @param aKeycode The key code for the key to be captured. Key codes for |
|
788 * special keys are defined in TKeyCode. |
|
789 * @param aModifier Mask Only the modifier keys in this mask are tested against |
|
790 * the states specified in aModifier. |
|
791 * @param aModifier The key is captured only when the modifier keys specified in |
|
792 * aModifierMask match these states, where 1=modifier set, |
|
793 * and 0=modifier not set. Modifier key states are defined |
|
794 * in TEventModifier. |
|
795 * @return A handle identifying the capture key, or one of the system-wide error |
|
796 * codes (if <0). Handles should be kept in order to be passed to |
|
797 * CancelCaptureKey() later. |
|
798 */ |
|
799 IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier); |
|
800 |
|
801 /** |
|
802 * This is same as RWindowGroup::CaptureKey, except that this version takes |
|
803 * S60 keymappings into account and captures the key that produces requested |
|
804 * aKeyCode according to S60 keymappings. This version leaves instead of returning |
|
805 * an error code. Standard RWindowgroup::CaptureKey functionality takes place |
|
806 * before S60 AppUi framework and has no knowledge of S60 keymappings. |
|
807 * Note: This method requires same capabilites as RWindowGroup::CaptureKey() |
|
808 * |
|
809 * @since S60 V3.2 |
|
810 * @param aKeycode The key code for the key to be captured. Key codes for |
|
811 * special keys are defined in TKeyCode. |
|
812 * @param aModifier Mask Only the modifier keys in this mask are tested against |
|
813 * the states specified in aModifier. |
|
814 * @param aModifier The key is captured only when the modifier keys specified in |
|
815 * aModifierMask match these states, where 1=modifier set, |
|
816 * and 0=modifier not set. Modifier key states are defined |
|
817 * in TEventModifier. |
|
818 * @param aHandle identifying the capture key. Handles should be kept in order |
|
819 * to be passed to CancelCaptureKey() later. |
|
820 */ |
|
821 IMPORT_C void CaptureKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifier, TInt32& aHandle); |
|
822 |
|
823 /** |
|
824 * This tells the application if it is allowed to hide itself in the |
|
825 * background in response to a user (menu or softkey) exit command, |
|
826 * instead of actually exiting. |
|
827 * If the application appears to exit, but actually leaves itself in |
|
828 * memory, it may appear to start faster next time the user activates it. |
|
829 * |
|
830 * @since S60 V5.0 |
|
831 * @return ETrue if the application can hide itself in the background, |
|
832 * EFalse if it must exit properly by calling Exit(). |
|
833 */ |
|
834 IMPORT_C TBool ExitHidesInBackground() const; |
|
835 |
|
836 /** |
|
837 * Hide the running instance of this application from the user, which |
|
838 * makes it appear as if the application has exited. |
|
839 * This is done by placing the application in the background, behind |
|
840 * all other apps, and removing the application from the Fast Swap Window. |
|
841 * When the application comes to the foreground again, it will be |
|
842 * restored to the Fast Swap Window (in HandleForegroundEventL). If the |
|
843 * application is not supposed to be in the Fast Swap Window, it will have |
|
844 * to remove itself again. |
|
845 * @since S60 V5.0 |
|
846 */ |
|
847 IMPORT_C void HideInBackground(); |
|
848 |
|
849 /** |
|
850 * Disables next key sound (and repeated key sounds until pointer up event). |
|
851 * |
|
852 * @since S60 V5.0 |
|
853 * @param aScanCode Scan code of disabled key. |
|
854 */ |
|
855 IMPORT_C void DisableNextKeySound( TInt aScanCode ); |
|
856 |
|
857 private: |
|
858 TBool ExitHidesInBackgroundL() const; |
|
859 }; |
|
860 |
|
861 |
|
862 |
|
863 #endif |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |