aknappui.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : AknAppUi.h
00004 *  Part of  : Avkon
00005 *
00006 *  Description:
00007 *  Version:
00008 *
00009 *  Copyright © 2002-2007 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation. All rights are reserved. Copying, 
00013 *  including reproducing, storing,  adapting or translating, any 
00014 *  or all of this material requires the prior written consent of 
00015 *  Nokia Corporation. This material also contains confidential 
00016 *  information which may not be disclosed to others without the 
00017 *  prior written consent of Nokia Corporation.
00018 * ============================================================================
00019 */
00020 #ifndef __AKNAPPUI_H__
00021 #define __AKNAPPUI_H__
00022 
00023 //  INCLUDES
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 // FORWARD DECLARATIONS
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 // MACROS
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 // CLASS DECLARATION
00066 
00072 class CAknAppUiBase : public CEikAppUi
00073     {
00074 private:
00075     friend class CAknAppUi;
00076     enum
00077         {
00078         EAppOrientationSpecifiedFlag            = 0x00010000, // In area reserved for System Guis
00079         EAppOrientationLandscapeFlag            = 0x00020000,
00080         EAppOrientationAutomaticFlag            = 0x00040000,
00081         EAknEnableSkinFlag                      = 0x00080000,
00082         // Since 3.0
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         // Since 3.0
00149         EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag,
00150         // Since 3.1
00151         EAknEnableMSK = EAknEnableMSKflag,
00152         // Since 3.2
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: // From CEikAppUi
00187     
00192     IMPORT_C void ConstructL();  // virtual
00193     
00197     IMPORT_C void Exit(); //virtual
00198     
00204     IMPORT_C void SetFadedL(TBool aFaded); // virtual
00205     
00213     IMPORT_C void HandleResourceChangeL(TInt aType); // virtual
00214     
00221     IMPORT_C TRect ApplicationRect() const; //virtual
00222 
00223 public: // from CCoeAppUiBase
00224     
00230     IMPORT_C void PrepareToExit();
00231 public: // New Functions
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     * Can be used to apply changes to settings that affect the current layout,
00368     * such as changes to the local zoom. Optionally reports the change
00369     * to the layout to all controls in the application. There are a number of 
00370     * different possible usages of this API:
00371     * <ul>
00372     * <li> Can be used to immediately change the local zoom, by passing in 
00373     * ETrue for the reporting parameter.</li>
00374     * <li> Can be called before BaseConstructL without leaving, the effect
00375     * is the same as passing EFalse for the reporting parameter, as 
00376     * the correct layout data is picked up later on during control layout.</li>
00377     * <li>Can be used by implementors of the 
00378     * @c MAknSettingCacheUpdatePlugin interface, in order to set the local 
00379     * zoom whilst updating the settings cache. By passing in EFalse for the 
00380     * reporting parameter, the layout switch is deferred to the usual 
00381     * processing in @c UpdateSettingCacheAndForwardEventL.</li>
00382     * <li> Can be used by controls that require a different local zoom to 
00383     * the underlying application, such as a dialog. By not 
00384     * reporting the change during construction, the dialog will lay itself out 
00385     * correctly. However, the dialog must then report the change back to the 
00386     * app zoom level when it closes, ignoring the resulting resource changed 
00387     * layout switch event.</li>
00388     * </ul>
00389     *
00390     * @param aReportChange if this is true, then the layout event will be 
00391     *               reported to controls on the control stack
00392     * 
00393     */    
00394     IMPORT_C void ApplyLayoutChangeL(TBool aReportChange);
00395     
00402     TBool HasFullOrPartialForeground() const;    
00403     
00404 protected: // From CCoeAppUiBase
00409     IMPORT_C virtual void HandleScreenDeviceChangedL(); // was Reserved_1()
00410 
00411 protected: // From CCoeAppUi
00412      
00419     IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType,
00420         const TWsEvent& aEvent);
00421 
00422 protected: // New functions
00428     IMPORT_C void SetFullScreenApp(TBool aIsFullScreen);
00429     
00434     IMPORT_C void ReplaceKeySoundsL( TInt aUid );
00435 
00436 protected: // from MObjectProvider
00437     IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00438 
00439 public: // not exported
00440     void SetScreenModeL(TInt aModeNumber);
00441     TInt ScreenMode() const;
00442 
00443 private:
00444     void UpdateSettingCacheAndForwardEventL( TInt aEventId );
00445     // Method tests on aError. If < KErrNone, it calls CCoeEnv::SetAppUi in order to pass
00446     // ownership to the environment. CCoeEnv then will delete the AppUi at the usual point in the destruct order
00447     void SetAppUiAndLeaveIfErrorL( TInt aError );
00448     TBool AlwaysForwardEvent( TInt aEventId );
00449     void RelinquishPriorityToForegroundAppLC();
00450 
00451 private:
00452     // Avkon app ui class flags
00453     TBitFlags iAknFlags;
00454 
00455     // Added for Avkon. Monitor events for emergency call support
00456     CAknWsEventMonitor* iEventMonitor;
00457 
00458     // Added for Avkon. Provides access to keysound server.
00459     // Moved from CAknAppUi, because CEikSrvUi needs it as well
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: // From CEikAppUi
00497     IMPORT_C void ConstructL();  // virtual
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: // MCoeViewDeactivationObserver
00572 
00583     IMPORT_C virtual void HandleViewDeactivation(
00584         const TVwsViewId& aViewIdToBeDeactivated,
00585         const TVwsViewId &aNewlyActivatedViewId);
00586 
00587 public: // from CCoeAppUiBase
00588     
00593     IMPORT_C void PrepareToExit();
00594 
00595 public: // from MAknTouchPaneObserver
00596 
00601     IMPORT_C void HandleTouchPaneSizeChange();
00602 
00603 protected:
00604     // from MEikStatusPaneObserver
00609     IMPORT_C void HandleStatusPaneSizeChange();
00610 
00611     // from CCoeAppUi
00616     IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent);
00617 
00618 protected: // formerly from MTopSetMember<CEikMenuBar>, now reserved
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;// May be set to NULL by the app shutter itself
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 

Copyright © Nokia Corporation 2001-2008
Back to top