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 class CAknPointerEventModifier;
00041 
00042 // MACROS
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 // CLASS DECLARATION
00067 
00073 class CAknAppUiBase : public CEikAppUi
00074     {
00075 private:
00076     friend class CAknAppUi;
00077     enum
00078         {
00079         EAppOrientationSpecifiedFlag            = 0x00010000, // In area reserved for System Guis
00080         EAppOrientationLandscapeFlag            = 0x00020000,
00081         EAppOrientationAutomaticFlag            = 0x00040000,
00082         EAknEnableSkinFlag                      = 0x00080000,
00083         // Since 3.0
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         // Since 3.0
00159         EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag,
00160         // Since 3.1
00161         EAknEnableMSK = EAknEnableMSKflag,
00162         // Since 3.2
00163         EAknExplicitStartupEffectCompletion = EAknExplicitStartupEffectCompletionFlag,
00164         // Since 5.0
00165         EAknTouchCompatible = EAknTouchCompatibleFlag
00166         };
00167     enum TKeyEventFlag
00168         {
00169         EDisableSendKeyShort = 0x01, // Short press of send key
00170         EDisableSendKeyLong  = 0x02  // Long press of send key
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: // From CEikAppUi
00203     
00208     IMPORT_C void ConstructL();  // virtual
00209     
00213     IMPORT_C void Exit(); //virtual
00214     
00220     IMPORT_C void SetFadedL(TBool aFaded); // virtual
00221     
00229     IMPORT_C void HandleResourceChangeL(TInt aType); // virtual
00230     
00237     IMPORT_C TRect ApplicationRect() const; //virtual
00238 
00239 public: // from CCoeAppUiBase
00240     
00246     IMPORT_C void PrepareToExit();
00247 public: // New Functions
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     * Can be used to apply changes to settings that affect the current layout,
00384     * such as changes to the local zoom. Optionally reports the change
00385     * to the layout to all controls in the application. There are a number of 
00386     * different possible usages of this API:
00387     * <ul>
00388     * <li> Can be used to immediately change the local zoom, by passing in 
00389     * ETrue for the reporting parameter.</li>
00390     * <li> Can be called before BaseConstructL without leaving, the effect
00391     * is the same as passing EFalse for the reporting parameter, as 
00392     * the correct layout data is picked up later on during control layout.</li>
00393     * <li>Can be used by implementors of the 
00394     * @c MAknSettingCacheUpdatePlugin interface, in order to set the local 
00395     * zoom whilst updating the settings cache. By passing in EFalse for the 
00396     * reporting parameter, the layout switch is deferred to the usual 
00397     * processing in @c UpdateSettingCacheAndForwardEventL.</li>
00398     * <li> Can be used by controls that require a different local zoom to 
00399     * the underlying application, such as a dialog. By not 
00400     * reporting the change during construction, the dialog will lay itself out 
00401     * correctly. However, the dialog must then report the change back to the 
00402     * app zoom level when it closes, ignoring the resulting resource changed 
00403     * layout switch event.</li>
00404     * </ul>
00405     *
00406     * @param aReportChange if this is true, then the layout event will be 
00407     *               reported to controls on the control stack
00408     * @since 3.1 
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: // From CCoeAppUiBase
00451     IMPORT_C virtual void HandleScreenDeviceChangedL(); // was Reserved_1()
00452 
00453 protected: // From CCoeAppUi
00454      
00461     IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType,
00462         const TWsEvent& aEvent);
00463 
00464 protected: // New functions
00470     IMPORT_C void SetFullScreenApp(TBool aIsFullScreen);
00471     
00476     IMPORT_C void ReplaceKeySoundsL( TInt aUid );
00477 
00478 protected: // from MObjectProvider
00479     IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00480 
00481 public: // not exported
00482     void SetScreenModeL(TInt aModeNumber);
00483     TInt ScreenMode() const;
00484 
00485 private:
00486     void UpdateSettingCacheAndForwardEventL( TInt aEventId );
00487     // Method tests on aError. If < KErrNone, it calls CCoeEnv::SetAppUi in order to pass
00488     // ownership to the environment. CCoeEnv then will delete the AppUi at the usual point in the destruct order
00489     void SetAppUiAndLeaveIfErrorL( TInt aError );
00490     TBool AlwaysForwardEvent( TInt aEventId );
00491     void RelinquishPriorityToForegroundAppLC();
00492 
00493 private:
00494     // Avkon app ui class flags
00495     TBitFlags iAknFlags;
00496 
00497     // Added for Avkon. Monitor events for emergency call support
00498     CAknWsEventMonitor* iEventMonitor;
00499 
00500     // Added for Avkon. Provides access to keysound server.
00501     // Moved from CAknAppUi, because CEikSrvUi needs it as well
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: // From CEikAppUi
00539     IMPORT_C void ConstructL();  // virtual
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: // MCoeViewDeactivationObserver
00630 
00641     IMPORT_C virtual void HandleViewDeactivation(
00642         const TVwsViewId& aViewIdToBeDeactivated,
00643         const TVwsViewId &aNewlyActivatedViewId);
00644 
00645 public: // from CCoeAppUiBase
00646     
00651     IMPORT_C void PrepareToExit();
00652 
00653 public: // from MAknTouchPaneObserver
00654 
00659     IMPORT_C void HandleTouchPaneSizeChange();
00660 
00661 protected:
00662     // from MEikStatusPaneObserver
00667     IMPORT_C void HandleStatusPaneSizeChange();
00668 
00669     // from CCoeAppUi
00674     IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent);
00675 
00676 protected: // formerly from MTopSetMember<CEikMenuBar>, now reserved
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;// May be set to NULL by the app shutter itself
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 

Copyright © Nokia Corporation 2001-2007
Back to top