S60 3rd Edition API Reference: aknappui.h Source File

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 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 
00045 #start_since SINCE_3_1_SDK
00046 
00052 class MAknAliasKeyCodeResolver
00053     {
00054 public:
00066     virtual TInt GetAliasKeyCode(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType)=0;        
00067     };
00068 #end_since SINCE_3_1_SDK
00069 
00070 // CLASS DECLARATION
00071 
00077 class CAknAppUiBase : public CEikAppUi
00078     {
00079 private:
00080     friend class CAknAppUi;
00081     enum
00082         {
00083         EAppOrientationSpecifiedFlag      = 0x00010000, // In area reserved for System Guis
00084         EAppOrientationLandscapeFlag      = 0x00020000,
00085         EAppOrientationAutomaticFlag      = 0x00040000,
00086         EAknEnableSkinFlag                = 0x00080000,
00087         // Since 3.0
00088         EAknDisableHighlightAnimationFlag = 0x00100000,
00089 #start_since SINCE_3_1_SDK
00090         EAknEnableMSKflag                 = 0x00200000
00091 #end_since SINCE_3_1_SDK
00092         };
00093 
00094     public:
00095 
00096     enum TAppUiOrientation
00097         {
00103         EAppUiOrientationUnspecified,
00110         EAppUiOrientationPortrait,
00117         EAppUiOrientationLandscape,
00123         EAppUiOrientationAutomatic
00124         };
00125     enum
00126         {
00140         EAknEnableSkin = EAknEnableSkinFlag,
00141         EAppOrientationPortrait     = EAppOrientationSpecifiedFlag,
00142                 EAppOrientationLandscape    = EAppOrientationSpecifiedFlag 
00143                                               | EAppOrientationLandscapeFlag,
00144                 EAppOrientationAutomatic    = EAppOrientationSpecifiedFlag
00145                                               | EAppOrientationAutomaticFlag,
00146         // Since 3.0
00147         EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag
00148 #start_since SINCE_3_1_SDK
00149         EAknEnableMSK = EAknEnableMSKflag
00150 #end_since SINCE_3_1_SDK
00151                 };
00152 
00153 
00154 public:
00158     IMPORT_C ~CAknAppUiBase();
00159     
00163     IMPORT_C CAknAppUiBase();
00164 public: 
00165     
00172     IMPORT_C void BaseConstructL( TInt aAppUiFlags );
00173     
00181     IMPORT_C void HandleForegroundEventL(TBool aForeground);
00182 
00183 public: // From CEikAppUi
00184     
00189     IMPORT_C void ConstructL();  // virtual
00190     
00194     IMPORT_C void Exit(); //virtual
00195     
00201         IMPORT_C void SetFadedL(TBool aFaded); // virtual
00202         
00210         IMPORT_C void HandleResourceChangeL(TInt aType); // virtual
00211         
00218         IMPORT_C TRect ApplicationRect() const; //virtual
00219 
00220 public: // from CCoeAppUiBase
00221     
00227         IMPORT_C void PrepareToExit();
00228 public: // New Functions
00233     IMPORT_C TBool IsFaded() const;
00234 
00240     IMPORT_C CAknWsEventMonitor* EventMonitor() const;
00241         
00246         IMPORT_C CAknKeySoundSystem* KeySounds() const;
00247 
00252         IMPORT_C TBool IsFullScreenApp() const;
00253         
00258         IMPORT_C TBool IsLayoutAwareApp() const;
00259         
00260 #start_since SINCE_3_1_SDK
00261 
00268         TBool IsMSKEnabledApp() const;
00269 #end_since SINCE_3_1_SDK
00270 
00276         IMPORT_C void SetLayoutAwareApp(TBool aLayoutAwareApp);
00277         
00282         IMPORT_C TBool IsForeground() const;
00283         
00288         IMPORT_C TBool IsPartialForeground() const;
00289 
00294         IMPORT_C TAppUiOrientation Orientation() const;
00295         
00301         IMPORT_C void SetOrientationL(TAppUiOrientation aOrientation);
00302 
00307         TInt FindAppWgIdBelowMeL();
00308         
00315         TInt EventForForegroundState(TBool aPartialFg, TBool aForeground);
00316         
00323         TBool ThreadIsForeground() const;
00324 
00329     void SimulateWsEventL(TInt aEvent);
00330 
00336     IMPORT_C TAknUiZoom LocalUiZoom() const;
00337 
00346     IMPORT_C void SetLocalUiZoom(TAknUiZoom aZoom);
00347 
00348 #start_since SINCE_3_1_SDK
00349 
00378     IMPORT_C void ApplyLayoutChangeL(TBool aReportChange);
00379 #end_since SINCE_3_1_SDK
00380     
00381     
00382 protected: // From CCoeAppUiBase
00387         IMPORT_C virtual void HandleScreenDeviceChangedL(); // was Reserved_1()
00388 
00389 protected: // From CCoeAppUi
00390      
00397     IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType,
00398         const TWsEvent& aEvent);
00399 
00400 protected: // New functions
00406     IMPORT_C void SetFullScreenApp(TBool aIsFullScreen);
00407     
00412     IMPORT_C void ReplaceKeySoundsL( TInt aUid );
00413 
00414 protected: // from MObjectProvider
00415         IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00416 
00417 public: // not exported
00418 #start_since SINCE_3_1_SDK
00419 
00422     void SetScreenModeL(TInt aModeNumber);
00426     TInt ScreenMode() const;
00427 #end_since SINCE_3_1_SDK
00428 
00429 private:
00430     void UpdateSettingCacheAndForwardEventL( TInt aEventId );
00431     // Method tests on aError. If < KErrNone, it calls CCoeEnv::SetAppUi in order to pass
00432     // ownership to the environment. CCoeEnv then will delete the AppUi at the usual point in the destruct order
00433     void SetAppUiAndLeaveIfErrorL( TInt aError );
00434     TBool AlwaysForwardEvent( TInt aEventId );
00435 
00436 private:
00437     // Avkon app ui class flags
00438     TBitFlags iAknFlags;
00439 
00440         // Added for Avkon. Monitor events for emergency call support
00441         CAknWsEventMonitor* iEventMonitor;
00442 
00443     // Added for Avkon. Provides access to keysound server.
00444     // Moved from CAknAppUi, because CEikSrvUi needs it as well
00445         CAknKeySoundSystem* iKeySounds; 
00446         
00447     CAknAppUiBaseExtension* iAppUiBaseExtension;
00448     };
00449 
00456 class CAknAppUi : public CAknAppUiBase, MEikStatusPaneObserver,
00457             public MCoeViewDeactivationObserver,
00458             public MAknTouchPaneObserver
00459     {
00460 public:
00461         
00470         IMPORT_C void BaseConstructL(TInt aAppUiFlags=EStandardApp);
00471         
00475         IMPORT_C ~CAknAppUi();
00476 
00477 public: // From CEikAppUi
00482     IMPORT_C void ConstructL();  // virtual
00483 
00484 public:
00489         IMPORT_C CEikStatusPane* StatusPane();
00494         IMPORT_C CEikButtonGroupContainer* Cba();
00495 
00501     IMPORT_C CAknTouchPane* TouchPane();
00502 
00508     IMPORT_C CAknToolbar* PopupToolbar() const; 
00509     
00515     IMPORT_C CAknToolbar* CurrentPopupToolbar() const;
00516     
00521     void StopDisplayingPopupToolbar(); 
00522         
00523       
00530         IMPORT_C void ProcessCommandL(TInt aCommand);
00531 
00532     
00542     IMPORT_C TErrorHandlerResponse HandleError (TInt aError,
00543         const SExtendedError& aExtErr, TDes& aErrorText, TDes& aContextText); 
00544 
00548         IMPORT_C void RunAppShutter();
00549         
00554         IMPORT_C TBool IsAppShutterRunning() const;
00555 
00556 public: // MCoeViewDeactivationObserver
00557 
00568         IMPORT_C virtual void HandleViewDeactivation(
00569             const TVwsViewId& aViewIdToBeDeactivated,
00570             const TVwsViewId &aNewlyActivatedViewId);
00571 
00572 public: // from CCoeAppUiBase
00573         
00578         IMPORT_C void PrepareToExit();
00579 
00580 public: // from MAknTouchPaneObserver
00581 
00586     IMPORT_C void HandleTouchPaneSizeChange();
00587 
00588 protected:
00589         // from MEikStatusPaneObserver
00594         IMPORT_C void HandleStatusPaneSizeChange();
00595 
00596         // from CCoeAppUi
00601         IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent);
00602 
00603 protected: // formerly from MTopSetMember<CEikMenuBar>, now reserved
00604         IMPORT_C virtual void Reserved_MtsmPosition();
00605         IMPORT_C virtual void Reserved_MtsmObject();
00606 protected:
00607     
00614     IMPORT_C void HandleForegroundEventL(TBool aForeground);
00615         
00621         IMPORT_C void HandleWsEventL(const TWsEvent& aEvent,
00622             CCoeControl* aDestination);
00623 
00631         IMPORT_C void SetKeyBlockMode(TAknKeyBlockMode aMode);
00632     IMPORT_C void HandleErrorL(TInt aError, HBufC** aErrorDesc, TBool aShowNote = ETrue );
00633 
00634 #ifdef _DEBUG
00635         
00643     void DumpControl(CCoeControl* aControl, TInt aLevel, RDebug& aDebug);
00644 #endif
00645 
00648     void DecideWsClientBufferSizesL();
00649 
00650 private:
00651         void UpdateKeyBlockMode();
00652 
00653 private:
00654         TBool iDumpNextControl;
00655         CAknAppShutter* iAppShutter;// May be set to NULL by the app shutter itself
00656         TAknKeyBlockMode iBlockMode;
00657         CAknAppUiExtension * iExtension;
00658 
00659 public:
00667     IMPORT_C void HideApplicationFromFSW(TBool aHide=ETrue);
00668 
00669 #start_since SINCE_3_1_SDK
00670 
00681     IMPORT_C void GetAliasKeyCodeL(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType);
00682 
00690     IMPORT_C void SetAliasKeyCodeResolverL(MAknAliasKeyCodeResolver* aResolver);
00691 #end_since SINCE_3_1_SDK
00692     };
00693 
00694 
00695 
00696 #endif
00697 
00698 
00699 
00700 
00701 
00702 
00703 

Copyright © Nokia Corporation 2001-2007
Back to top