00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __AKNAPPUI_H__
00021 #define __AKNAPPUI_H__
00022
00023
00024 #include <eikappui.h>
00025 #include <Eikspane.h>
00026 #include <eikcba.h>
00027 #include <avkon.hrh>
00028 #include <akndef.h>
00029 #include <AknTouchPaneObserver.h>
00030
00031
00032 class CEikButtonGroupContainer;
00033 class CAknAppShutter;
00034 class CAknAppUiExtension;
00035 class CAknWsEventMonitor;
00036 class CAknKeySoundSystem;
00037 class CAknAppUiBaseExtension;
00038 class CAknTouchPane;
00039 class CAknToolbar;
00040 class CAknPointerEventModifier;
00041
00042
00043 #define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi())
00044 #define iAvkonAppUiBase ((CAknAppUiBase*)CEikonEnv::Static()->EikAppUi())
00045
00051 class MAknAliasKeyCodeResolver
00052 {
00053 public:
00063 virtual TInt GetAliasKeyCode(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType)=0;
00064 };
00065
00066
00067
00073 class CAknAppUiBase : public CEikAppUi
00074 {
00075 private:
00076 friend class CAknAppUi;
00077 enum
00078 {
00079 EAppOrientationSpecifiedFlag = 0x00010000,
00080 EAppOrientationLandscapeFlag = 0x00020000,
00081 EAppOrientationAutomaticFlag = 0x00040000,
00082 EAknEnableSkinFlag = 0x00080000,
00083
00084 EAknDisableHighlightAnimationFlag = 0x00100000,
00085 EAknEnableMSKflag = 0x00200000,
00093 EAknExplicitStartupEffectCompletionFlag = 0x00400000,
00094
00103 EAknTouchCompatibleFlag = 0x00800000
00104 };
00105
00106 public:
00107
00108 enum TAppUiOrientation
00109 {
00115 EAppUiOrientationUnspecified,
00122 EAppUiOrientationPortrait,
00129 EAppUiOrientationLandscape,
00135 EAppUiOrientationAutomatic
00136 };
00137 enum
00138 {
00152 EAknEnableSkin = EAknEnableSkinFlag,
00153 EAppOrientationPortrait = EAppOrientationSpecifiedFlag,
00154 EAppOrientationLandscape = EAppOrientationSpecifiedFlag
00155 | EAppOrientationLandscapeFlag,
00156 EAppOrientationAutomatic = EAppOrientationSpecifiedFlag
00157 | EAppOrientationAutomaticFlag,
00158
00159 EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag,
00160
00161 EAknEnableMSK = EAknEnableMSKflag,
00162
00163 EAknExplicitStartupEffectCompletion = EAknExplicitStartupEffectCompletionFlag,
00164
00165 EAknTouchCompatible = EAknTouchCompatibleFlag
00166 };
00167 enum TKeyEventFlag
00168 {
00169 EDisableSendKeyShort = 0x01,
00170 EDisableSendKeyLong = 0x02
00171 };
00172
00173 public:
00177 IMPORT_C ~CAknAppUiBase();
00178
00182 IMPORT_C CAknAppUiBase();
00183 public:
00184
00191 IMPORT_C void BaseConstructL( TInt aAppUiFlags );
00192
00200 IMPORT_C void HandleForegroundEventL(TBool aForeground);
00201
00202 public:
00203
00208 IMPORT_C void ConstructL();
00209
00213 IMPORT_C void Exit();
00214
00220 IMPORT_C void SetFadedL(TBool aFaded);
00221
00229 IMPORT_C void HandleResourceChangeL(TInt aType);
00230
00237 IMPORT_C TRect ApplicationRect() const;
00238
00239 public:
00240
00246 IMPORT_C void PrepareToExit();
00247 public:
00252 IMPORT_C TBool IsFaded() const;
00253
00259 IMPORT_C CAknWsEventMonitor* EventMonitor() const;
00260
00265 IMPORT_C CAknKeySoundSystem* KeySounds() const;
00266
00271 IMPORT_C TBool IsFullScreenApp() const;
00272
00277 IMPORT_C TBool IsLayoutAwareApp() const;
00278
00285 TBool IsMSKEnabledApp() const;
00286
00294 TBool IsAppClosing() const;
00295
00301 IMPORT_C void SetLayoutAwareApp(TBool aLayoutAwareApp);
00302
00307 IMPORT_C TBool IsForeground() const;
00308
00313 IMPORT_C TBool IsPartialForeground() const;
00314
00319 IMPORT_C TAppUiOrientation Orientation() const;
00320
00328 IMPORT_C TBool OrientationCanBeChanged() const;
00329
00335 IMPORT_C void SetOrientationL(TAppUiOrientation aOrientation);
00336
00341 TInt FindAppWgIdBelowMeL();
00342
00349 TInt EventForForegroundState(TBool aPartialFg, TBool aForeground);
00350
00357 TBool ThreadIsForeground() const;
00358
00363 void SimulateWsEventL(TInt aEvent);
00364
00370 IMPORT_C TAknUiZoom LocalUiZoom() const;
00371
00380 IMPORT_C void SetLocalUiZoom(TAknUiZoom aZoom);
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410 IMPORT_C void ApplyLayoutChangeL(TBool aReportChange);
00411
00418 TBool HasFullOrPartialForeground() const;
00419
00426 IMPORT_C void SetKeyEventFlags( const TInt aFlags );
00427
00435 IMPORT_C CAknPointerEventModifier* PointerEventModifier();
00436
00444 IMPORT_C TBool IsTouchCompatible() const;
00445
00446 protected:
00451 IMPORT_C virtual void HandleScreenDeviceChangedL();
00452
00453 protected:
00454
00461 IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType,
00462 const TWsEvent& aEvent);
00463
00464 protected:
00470 IMPORT_C void SetFullScreenApp(TBool aIsFullScreen);
00471
00476 IMPORT_C void ReplaceKeySoundsL( TInt aUid );
00477
00478 protected:
00479 IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00480
00481 public:
00482 void SetScreenModeL(TInt aModeNumber);
00483 TInt ScreenMode() const;
00484
00485 private:
00486 void UpdateSettingCacheAndForwardEventL( TInt aEventId );
00487
00488
00489 void SetAppUiAndLeaveIfErrorL( TInt aError );
00490 TBool AlwaysForwardEvent( TInt aEventId );
00491 void RelinquishPriorityToForegroundAppLC();
00492
00493 private:
00494
00495 TBitFlags iAknFlags;
00496
00497
00498 CAknWsEventMonitor* iEventMonitor;
00499
00500
00501
00502 CAknKeySoundSystem* iKeySounds;
00503
00504 CAknAppUiBaseExtension* iAppUiBaseExtension;
00505 };
00506
00513 class CAknAppUi : public CAknAppUiBase, MEikStatusPaneObserver,
00514 public MCoeViewDeactivationObserver,
00515 public MAknTouchPaneObserver
00516 {
00517 public:
00518
00527 IMPORT_C void BaseConstructL(TInt aAppUiFlags=EStandardApp);
00528
00532 IMPORT_C ~CAknAppUi();
00533
00534 public:
00539 IMPORT_C void ConstructL();
00540
00541 public:
00546 IMPORT_C CEikStatusPane* StatusPane();
00551 IMPORT_C CEikButtonGroupContainer* Cba();
00552
00558 IMPORT_C CAknTouchPane* TouchPane();
00559
00565 IMPORT_C CAknToolbar* PopupToolbar() const;
00566
00572 IMPORT_C CAknToolbar* CurrentPopupToolbar() const;
00573
00579 IMPORT_C CAknToolbar* CurrentFixedToolbar() const;
00580
00581
00586 void StopDisplayingPopupToolbar();
00587
00588
00595 IMPORT_C void ProcessCommandL(TInt aCommand);
00596
00597
00607 IMPORT_C TErrorHandlerResponse HandleError (TInt aError,
00608 const SExtendedError& aExtErr, TDes& aErrorText, TDes& aContextText);
00609
00613 IMPORT_C void RunAppShutter();
00614
00619 IMPORT_C TBool IsAppShutterRunning() const;
00620
00627 TBool IsAppHiddenInBackground() const;
00628
00629 public:
00630
00641 IMPORT_C virtual void HandleViewDeactivation(
00642 const TVwsViewId& aViewIdToBeDeactivated,
00643 const TVwsViewId &aNewlyActivatedViewId);
00644
00645 public:
00646
00651 IMPORT_C void PrepareToExit();
00652
00653 public:
00654
00659 IMPORT_C void HandleTouchPaneSizeChange();
00660
00661 protected:
00662
00667 IMPORT_C void HandleStatusPaneSizeChange();
00668
00669
00674 IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent);
00675
00676 protected:
00677 IMPORT_C virtual void Reserved_MtsmPosition();
00678 IMPORT_C virtual void Reserved_MtsmObject();
00679 protected:
00680
00687 IMPORT_C void HandleForegroundEventL(TBool aForeground);
00688
00694 IMPORT_C void HandleWsEventL(const TWsEvent& aEvent,
00695 CCoeControl* aDestination);
00696
00704 IMPORT_C void SetKeyBlockMode(TAknKeyBlockMode aMode);
00705 IMPORT_C void HandleErrorL(TInt aError, HBufC** aErrorDesc, TBool aShowNote = ETrue );
00706
00707 #ifdef _DEBUG
00708
00716 void DumpControl(CCoeControl* aControl, TInt aLevel, RDebug& aDebug);
00717 #endif
00718
00721 void DecideWsClientBufferSizesL();
00722
00723 private:
00724 void UpdateKeyBlockMode();
00725 TBool SimulateHashKeyMarkingEvent(const TWsEvent& aEvent);
00726
00727 private:
00728 TBool iDumpNextControl;
00729 CAknAppShutter* iAppShutter;
00730 TAknKeyBlockMode iBlockMode;
00731 CAknAppUiExtension * iExtension;
00732
00733 public:
00740 IMPORT_C void HideApplicationFromFSW(TBool aHide=ETrue);
00741
00752 IMPORT_C void GetAliasKeyCodeL(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType);
00753
00760 IMPORT_C void SetAliasKeyCodeResolverL(MAknAliasKeyCodeResolver* aResolver);
00761
00783 IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
00784
00805 IMPORT_C void CaptureKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifier, TInt32& aHandle);
00806
00818 IMPORT_C TBool ExitHidesInBackground() const;
00819
00831 IMPORT_C void HideInBackground();
00832
00839 IMPORT_C void DisableNextKeySound( TInt aScanCode );
00840
00841 private:
00842 TBool ExitHidesInBackgroundL() const;
00843 };
00844
00845
00846
00847 #endif
00848
00849
00850
00851
00852
00853
00854