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 
00041 
00042 #define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi())
00043 #define iAvkonAppUiBase ((CAknAppUiBase*)CEikonEnv::Static()->EikAppUi())
00044 
00050 class MAknAliasKeyCodeResolver
00051     {
00052 public:
00062     virtual TInt GetAliasKeyCode(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType)=0;        
00063     };
00064 
00065 
00066 
00072 class CAknAppUiBase : public CEikAppUi
00073     {
00074 private:
00075     friend class CAknAppUi;
00076     enum
00077         {
00078         EAppOrientationSpecifiedFlag            = 0x00010000, 
00079         EAppOrientationLandscapeFlag            = 0x00020000,
00080         EAppOrientationAutomaticFlag            = 0x00040000,
00081         EAknEnableSkinFlag                      = 0x00080000,
00082         
00083         EAknDisableHighlightAnimationFlag       = 0x00100000,
00084         EAknEnableMSKflag                       = 0x00200000,
00092         EAknExplicitStartupEffectCompletionFlag     = 0x00400000
00093 
00094         };
00095 
00096     public:
00097 
00098     enum TAppUiOrientation
00099         {
00105         EAppUiOrientationUnspecified,
00112         EAppUiOrientationPortrait,
00119         EAppUiOrientationLandscape,
00125         EAppUiOrientationAutomatic
00126         };
00127     enum
00128         {
00142         EAknEnableSkin = EAknEnableSkinFlag,
00143         EAppOrientationPortrait     = EAppOrientationSpecifiedFlag,
00144         EAppOrientationLandscape    = EAppOrientationSpecifiedFlag 
00145                                       | EAppOrientationLandscapeFlag,
00146         EAppOrientationAutomatic    = EAppOrientationSpecifiedFlag
00147                                       | EAppOrientationAutomaticFlag,
00148         
00149         EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag,
00150         
00151         EAknEnableMSK = EAknEnableMSKflag,
00152         
00153         EAknExplicitStartupEffectCompletion = EAknExplicitStartupEffectCompletionFlag,
00154         };
00155 
00156 
00157 public:
00161     IMPORT_C ~CAknAppUiBase();
00162     
00166     IMPORT_C CAknAppUiBase();
00167 public: 
00168     
00175     IMPORT_C void BaseConstructL( TInt aAppUiFlags );
00176     
00184     IMPORT_C void HandleForegroundEventL(TBool aForeground);
00185 
00186 public: 
00187     
00192     IMPORT_C void ConstructL();  
00193     
00197     IMPORT_C void Exit(); 
00198     
00204     IMPORT_C void SetFadedL(TBool aFaded); 
00205     
00213     IMPORT_C void HandleResourceChangeL(TInt aType); 
00214     
00221     IMPORT_C TRect ApplicationRect() const; 
00222 
00223 public: 
00224     
00230     IMPORT_C void PrepareToExit();
00231 public: 
00236     IMPORT_C TBool IsFaded() const;
00237 
00243     IMPORT_C CAknWsEventMonitor* EventMonitor() const;
00244     
00249     IMPORT_C CAknKeySoundSystem* KeySounds() const;
00250 
00255     IMPORT_C TBool IsFullScreenApp() const;
00256     
00261     IMPORT_C TBool IsLayoutAwareApp() const;
00262     
00269     TBool IsMSKEnabledApp() const;
00270 
00278     TBool IsAppClosing() const;
00279     
00285     IMPORT_C void SetLayoutAwareApp(TBool aLayoutAwareApp);
00286     
00291     IMPORT_C TBool IsForeground() const;
00292     
00297     IMPORT_C TBool IsPartialForeground() const;
00298 
00303     IMPORT_C TAppUiOrientation Orientation() const;
00304     
00312     IMPORT_C TBool OrientationCanBeChanged() const;
00313     
00319     IMPORT_C void SetOrientationL(TAppUiOrientation aOrientation);
00320 
00325     TInt FindAppWgIdBelowMeL();
00326     
00333     TInt EventForForegroundState(TBool aPartialFg, TBool aForeground);
00334     
00341     TBool ThreadIsForeground() const;
00342 
00347     void SimulateWsEventL(TInt aEvent);
00348 
00354     IMPORT_C TAknUiZoom LocalUiZoom() const;
00355 
00364     IMPORT_C void SetLocalUiZoom(TAknUiZoom aZoom);
00365 
00366     
00367 
00368 
00369 
00370 
00371 
00372 
00373 
00374 
00375 
00376 
00377 
00378 
00379 
00380 
00381 
00382 
00383 
00384 
00385 
00386 
00387 
00388 
00389 
00390 
00391 
00392 
00393     
00394     IMPORT_C void ApplyLayoutChangeL(TBool aReportChange);
00395     
00402     TBool HasFullOrPartialForeground() const;    
00403     
00404 protected: 
00409     IMPORT_C virtual void HandleScreenDeviceChangedL(); 
00410 
00411 protected: 
00412      
00419     IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType,
00420         const TWsEvent& aEvent);
00421 
00422 protected: 
00428     IMPORT_C void SetFullScreenApp(TBool aIsFullScreen);
00429     
00434     IMPORT_C void ReplaceKeySoundsL( TInt aUid );
00435 
00436 protected: 
00437     IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00438 
00439 public: 
00440     void SetScreenModeL(TInt aModeNumber);
00441     TInt ScreenMode() const;
00442 
00443 private:
00444     void UpdateSettingCacheAndForwardEventL( TInt aEventId );
00445     
00446     
00447     void SetAppUiAndLeaveIfErrorL( TInt aError );
00448     TBool AlwaysForwardEvent( TInt aEventId );
00449     void RelinquishPriorityToForegroundAppLC();
00450 
00451 private:
00452     
00453     TBitFlags iAknFlags;
00454 
00455     
00456     CAknWsEventMonitor* iEventMonitor;
00457 
00458     
00459     
00460     CAknKeySoundSystem* iKeySounds; 
00461     
00462     CAknAppUiBaseExtension* iAppUiBaseExtension;
00463     };
00464 
00471 class CAknAppUi : public CAknAppUiBase, MEikStatusPaneObserver,
00472             public MCoeViewDeactivationObserver,
00473             public MAknTouchPaneObserver
00474     {
00475 public:
00476     
00485     IMPORT_C void BaseConstructL(TInt aAppUiFlags=EStandardApp);
00486     
00490     IMPORT_C ~CAknAppUi();
00491 
00492 public: 
00497     IMPORT_C void ConstructL();  
00498 
00499 public:
00504     IMPORT_C CEikStatusPane* StatusPane();
00509     IMPORT_C CEikButtonGroupContainer* Cba();
00510 
00516     IMPORT_C CAknTouchPane* TouchPane();
00517 
00523     IMPORT_C CAknToolbar* PopupToolbar() const; 
00524     
00530     IMPORT_C CAknToolbar* CurrentPopupToolbar() const;
00531     
00536     void StopDisplayingPopupToolbar(); 
00537         
00538       
00545     IMPORT_C void ProcessCommandL(TInt aCommand);
00546 
00547     
00557     IMPORT_C TErrorHandlerResponse HandleError (TInt aError,
00558         const SExtendedError& aExtErr, TDes& aErrorText, TDes& aContextText); 
00559 
00563     IMPORT_C void RunAppShutter();
00564     
00569     IMPORT_C TBool IsAppShutterRunning() const;
00570 
00571 public: 
00572 
00583     IMPORT_C virtual void HandleViewDeactivation(
00584         const TVwsViewId& aViewIdToBeDeactivated,
00585         const TVwsViewId &aNewlyActivatedViewId);
00586 
00587 public: 
00588     
00593     IMPORT_C void PrepareToExit();
00594 
00595 public: 
00596 
00601     IMPORT_C void HandleTouchPaneSizeChange();
00602 
00603 protected:
00604     
00609     IMPORT_C void HandleStatusPaneSizeChange();
00610 
00611     
00616     IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent);
00617 
00618 protected: 
00619     IMPORT_C virtual void Reserved_MtsmPosition();
00620     IMPORT_C virtual void Reserved_MtsmObject();
00621 protected:
00622     
00629     IMPORT_C void HandleForegroundEventL(TBool aForeground);
00630     
00636     IMPORT_C void HandleWsEventL(const TWsEvent& aEvent,
00637         CCoeControl* aDestination);
00638 
00646     IMPORT_C void SetKeyBlockMode(TAknKeyBlockMode aMode);
00647     IMPORT_C void HandleErrorL(TInt aError, HBufC** aErrorDesc, TBool aShowNote = ETrue );
00648 
00649 #ifdef _DEBUG
00650     
00658     void DumpControl(CCoeControl* aControl, TInt aLevel, RDebug& aDebug);
00659 #endif
00660 
00663     void DecideWsClientBufferSizesL();
00664 
00665 private:
00666     void UpdateKeyBlockMode();
00667     TBool SimulateHashKeyMarkingEvent(const TWsEvent& aEvent);
00668 
00669 private:
00670     TBool iDumpNextControl;
00671     CAknAppShutter* iAppShutter;
00672     TAknKeyBlockMode iBlockMode;
00673     CAknAppUiExtension * iExtension;
00674 
00675 public:
00682     IMPORT_C void HideApplicationFromFSW(TBool aHide=ETrue);
00683 
00694     IMPORT_C void GetAliasKeyCodeL(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType);
00695 
00702     IMPORT_C void SetAliasKeyCodeResolverL(MAknAliasKeyCodeResolver* aResolver);
00703     
00725     IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);         
00726     
00747     IMPORT_C void CaptureKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifier, TInt32& aHandle);
00748     };
00749 
00750 
00751 
00752 #endif
00753 
00754 
00755 
00756 
00757 
00758 
00759