williamr@2: /* williamr@2: * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: #ifndef __AKNAPPUI_H__ williamr@2: #define __AKNAPPUI_H__ williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CEikButtonGroupContainer; williamr@2: class CAknAppShutter; williamr@2: class CAknAppUiExtension; williamr@2: class CAknWsEventMonitor; williamr@2: class CAknKeySoundSystem; williamr@2: class CAknAppUiBaseExtension; williamr@2: class CAknTouchPane; williamr@2: class CAknToolbar; williamr@2: class CAknPointerEventModifier; williamr@2: williamr@2: // MACROS williamr@2: #define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi()) williamr@2: #define iAvkonAppUiBase ((CAknAppUiBase*)CEikonEnv::Static()->EikAppUi()) williamr@2: williamr@2: /** williamr@2: * Avkon key resolver interface williamr@2: * williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: class MAknAliasKeyCodeResolver williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Resolves keyboard layout dependent keycode for the given event williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aCode reference to variable to contain new keycode williamr@2: * @param aKeyEvent reference to original, complete, event williamr@2: * @param aType indicating original event type williamr@2: * @return KErrNone on success, otherwise system wide error codes williamr@2: */ williamr@2: virtual TInt GetAliasKeyCode(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType)=0; williamr@2: }; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Abstract Avkon application UI base class williamr@2: * williamr@2: * @since S60 3.0 williamr@2: */ williamr@2: class CAknAppUiBase : public CEikAppUi williamr@2: { williamr@2: private: williamr@2: friend class CAknAppUi; williamr@2: enum williamr@2: { williamr@2: EAppOrientationSpecifiedFlag = 0x00010000, // In area reserved for System Guis williamr@2: EAppOrientationLandscapeFlag = 0x00020000, williamr@2: EAppOrientationAutomaticFlag = 0x00040000, williamr@2: EAknEnableSkinFlag = 0x00080000, williamr@2: // Since 3.0 williamr@2: EAknDisableHighlightAnimationFlag = 0x00100000, williamr@2: EAknEnableMSKflag = 0x00200000, williamr@2: /** williamr@2: * When enabled, avkon does not complete startup effect williamr@2: * application has to do it by itself. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * williamr@2: */ williamr@2: EAknExplicitStartupEffectCompletionFlag = 0x00400000, williamr@2: williamr@2: /** williamr@2: * Application supports touch (doesn't need keyboard). If the flag williamr@2: * is missing and compatibility mode is enabled in a device, williamr@2: * application is run in a compatibility mode (QVGA window with a williamr@2: * virtual keypad. williamr@2: * williamr@2: * @since S60 5.0 williamr@2: */ williamr@2: EAknTouchCompatibleFlag = 0x00800000 williamr@2: }; williamr@2: williamr@2: public: williamr@2: williamr@2: enum TAppUiOrientation williamr@2: { williamr@2: /** williamr@2: * Use the default device screen rotation of the product for this williamr@2: * application. This is the default rotation setting for an williamr@2: * application, and it should be used by nearly all applications. williamr@2: */ williamr@2: EAppUiOrientationUnspecified, williamr@2: /** williamr@2: * Use a portrait screen rotation for this application. williamr@2: * This should only be used when an application specifically wants williamr@2: * portrait rotation. The device will select an appropriate portrait williamr@2: * rotation, if one is available. williamr@2: */ williamr@2: EAppUiOrientationPortrait, williamr@2: /** williamr@2: * Use a landscape screen rotation for this application. williamr@2: * This should only be used when an application specifically wants williamr@2: * landscape rotation. The device will select an appropriate landscape williamr@2: * rotation, if one is available. williamr@2: */ williamr@2: EAppUiOrientationLandscape, williamr@2: /** williamr@2: * Use the normal device screen rotation for this application. williamr@2: * Both portrait and landscape screen rotations are possible. The williamr@2: * application rotation follows device screen rotation. williamr@2: */ williamr@2: EAppUiOrientationAutomatic williamr@2: }; williamr@2: enum williamr@2: { williamr@2: /** williamr@2: * Flag indicating that default skin parameters should be provided by williamr@2: * UI controls created within the scope of this AppUi instance. williamr@2: * This value (or binary combination with some other values) should williamr@2: * be given as a parameter to BaseConstructL in case williamr@2: * the application wants to enable default skin parameters for all williamr@2: * the Avkon controls supporting them. williamr@2: * williamr@2: * Note: The value can be queried by using williamr@2: * AknsUtils::AvkonSkinEnabled() from AknSkins.lib. williamr@2: * williamr@2: * @since S60 2.0 williamr@2: */ williamr@2: EAknEnableSkin = EAknEnableSkinFlag, williamr@2: EAppOrientationPortrait = EAppOrientationSpecifiedFlag, williamr@2: EAppOrientationLandscape = EAppOrientationSpecifiedFlag williamr@2: | EAppOrientationLandscapeFlag, williamr@2: EAppOrientationAutomatic = EAppOrientationSpecifiedFlag williamr@2: | EAppOrientationAutomaticFlag, williamr@2: // Since 3.0 williamr@2: EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag, williamr@2: // Since 3.1 williamr@2: EAknEnableMSK = EAknEnableMSKflag, williamr@2: // Since 3.2 williamr@2: EAknExplicitStartupEffectCompletion = EAknExplicitStartupEffectCompletionFlag, williamr@2: // Since 5.0 williamr@2: EAknTouchCompatible = EAknTouchCompatibleFlag williamr@2: }; williamr@2: enum TKeyEventFlag williamr@2: { williamr@2: EDisableSendKeyShort = 0x01, // Short press of send key williamr@2: EDisableSendKeyLong = 0x02 // Long press of send key williamr@2: }; williamr@2: williamr@2: public: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CAknAppUiBase(); williamr@2: williamr@2: /** williamr@2: * C++ Default constructor. williamr@2: */ williamr@2: IMPORT_C CAknAppUiBase(); williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Initialises this Avkon base app UI with standard values. williamr@2: * @c aAppUiFlags values are common with williamr@2: * @c CEikAppUi::BaseConstructL(aAppUiFlags). williamr@2: * @param aAppUiFlags Application user interface flags. williamr@2: */ williamr@2: IMPORT_C void BaseConstructL( TInt aAppUiFlags ); williamr@2: williamr@2: /** williamr@2: * Handles changes in keyboard focus when an application switches to, williamr@2: * or from, the foreground. This function calls williamr@2: * @c CEikAppUi::HandleForegroundEventL. williamr@2: * @param aForeground @c ETrue if the application is in the foreground, williamr@2: * otherwise @c EFalse. williamr@2: */ williamr@2: IMPORT_C void HandleForegroundEventL(TBool aForeground); williamr@2: williamr@2: public: // From CEikAppUi williamr@2: williamr@2: /** williamr@2: * From @c CEikAppUi. Completes construction. The implementation of williamr@2: * @c ConstructL() in @c CAknAppUiBase simply calls @c BaseConstructL(). williamr@2: */ williamr@2: IMPORT_C void ConstructL(); // virtual williamr@2: williamr@2: /** williamr@2: * From @c CEikAppUi. Closes the app UI. williamr@2: */ williamr@2: IMPORT_C void Exit(); //virtual williamr@2: williamr@2: /** williamr@2: * From @c CEikAppUi. Sets whether the windows are faded. williamr@2: * @param aFaded @c ETrue if windows are faded, otherwise windows are williamr@2: * unfaded. williamr@2: */ williamr@2: IMPORT_C void SetFadedL(TBool aFaded); // virtual williamr@2: williamr@2: /** williamr@2: * From @c CEikAppUi. Handles a change to the application's resources which williamr@2: * are shared across the environment. This function calls williamr@2: * @c CEikAppUi::HandleResourceChangeL except when @c aType is williamr@2: * @c KEikDynamicLayoutVariantSwitch. williamr@2: * @param aType The type of resources that have changed. williamr@2: */ williamr@2: IMPORT_C void HandleResourceChangeL(TInt aType); // virtual williamr@2: williamr@2: /** williamr@2: * From @c CEikAppUi. Gets the total area of the screen available to the williamr@2: * application. This includes the space that is available for a toolbar, williamr@2: * toolband or title band, if the application requires them. williamr@2: * @return The total area of the screen available to the application. williamr@2: */ williamr@2: IMPORT_C TRect ApplicationRect() const; //virtual williamr@2: williamr@2: public: // from CCoeAppUiBase williamr@2: williamr@2: /** williamr@2: * From @c CCoeAppUiBase. Performs pre-exit processing by calling williamr@2: * @c CEikAppUi::PrepareToExit() to ensure the application will exit williamr@2: * cleanly. williamr@2: */ williamr@2: IMPORT_C void PrepareToExit(); williamr@2: public: // New Functions williamr@2: /** williamr@2: * Determines whether the system is faded. williamr@2: * @return @c ETrue if system is faded williamr@2: */ williamr@2: IMPORT_C TBool IsFaded() const; williamr@2: williamr@2: /** williamr@2: * Returns the object which allows events to be spyed upon in addition to williamr@2: * normal event handling. williamr@2: * @return Pointer to window server event monitor object. williamr@2: */ williamr@2: IMPORT_C CAknWsEventMonitor* EventMonitor() const; williamr@2: williamr@2: /** williamr@2: * Gets a pointer to KeySound API object. williamr@2: * @return Pointer to KeySound API object. williamr@2: */ williamr@2: IMPORT_C CAknKeySoundSystem* KeySounds() const; williamr@2: williamr@2: /** williamr@2: * Determines whether the application is full screen application. williamr@2: * @return @c ETrue if the application is full screen application. williamr@2: */ williamr@2: IMPORT_C TBool IsFullScreenApp() const; williamr@2: williamr@2: /** williamr@2: * Determines whether the application is layout aware. williamr@2: * @return @c ETrue if the application is layout aware. williamr@2: */ williamr@2: IMPORT_C TBool IsLayoutAwareApp() const; williamr@2: williamr@2: /** williamr@2: * Determines whether the application has MSK enabled. williamr@2: * @return @c ETrue if the application has MSK enabled. williamr@2: * williamr@2: * @since 3.1 williamr@2: */ williamr@2: TBool IsMSKEnabledApp() const; williamr@2: williamr@2: /** williamr@2: * Determines whether the application is closing. williamr@2: * In practice this means that CEikonEnv has been destroyed. williamr@2: * @return @c ETrue if the application is closing. williamr@2: * williamr@2: * @since 3.2 williamr@2: */ williamr@2: TBool IsAppClosing() const; williamr@2: williamr@2: /** williamr@2: * Set application layout aware. williamr@2: * @param aLayoutAwareApp @c ETrue if the application is layout aware, williamr@2: * @c EFlase otherwise. williamr@2: */ williamr@2: IMPORT_C void SetLayoutAwareApp(TBool aLayoutAwareApp); williamr@2: williamr@2: /** williamr@2: * Determines whether the application is foreground. williamr@2: * @return @c ETrue if the application is foreground. williamr@2: */ williamr@2: IMPORT_C TBool IsForeground() const; williamr@2: williamr@2: /** williamr@2: * Determines whether the application is partially foreground. williamr@2: * @return @c ETrue if the application is partially foreground. williamr@2: */ williamr@2: IMPORT_C TBool IsPartialForeground() const; williamr@2: williamr@2: /** williamr@2: * Gets the application screen orientation. williamr@2: * @return Application screen orientation. williamr@2: */ williamr@2: IMPORT_C TAppUiOrientation Orientation() const; williamr@2: williamr@2: /** williamr@2: * Tests whether it is possible for this app to have a williamr@2: * practical effect on the screen orientation, through williamr@2: * SetOrientationL(). williamr@2: * @since S60 3.2 williamr@2: * @return ETrue if SetOrientationL can change the orientation, EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool OrientationCanBeChanged() const; williamr@2: williamr@2: /** williamr@2: * Sets the application screen orientation. williamr@2: * Note: this API has no effect on non-full-screen app UIs. williamr@2: * @param aOrientation application screen orientation. williamr@2: */ williamr@2: IMPORT_C void SetOrientationL(TAppUiOrientation aOrientation); williamr@2: williamr@2: /** williamr@2: * Find the window group ID of the application below this application. williamr@2: * @return the window group ID of the application below this application. williamr@2: */ williamr@2: TInt FindAppWgIdBelowMeL(); williamr@2: williamr@2: /** williamr@2: * Simply return @c KEikPartialForeground if @c aPartialFg == @c ETrue, williamr@2: * otherwise if @c aForeground == @c ETrue then return @c EEventFocusGained williamr@2: * else return @c EEventFocusLost. williamr@2: * @return if @c aPartialFg then return KEikPartialForeground. williamr@2: */ williamr@2: TInt EventForForegroundState(TBool aPartialFg, TBool aForeground); williamr@2: williamr@2: /** williamr@2: * Determines whether the thread owning this application window group is williamr@2: * foreground. williamr@2: * @return @c ETrue if the thread owning this application window group is williamr@2: * foreground, @c EFlase otherwise. williamr@2: */ williamr@2: TBool ThreadIsForeground() const; williamr@2: williamr@2: /** williamr@2: * Simulates an event being received from wserv williamr@2: * @param aEvent the event id being simulated. williamr@2: */ williamr@2: void SimulateWsEventL(TInt aEvent); williamr@2: williamr@2: /** williamr@2: * Gets the application local zoom williamr@2: * @return Application local zoom williamr@2: * @since 3.1 williamr@2: */ williamr@2: IMPORT_C TAknUiZoom LocalUiZoom() const; williamr@2: williamr@2: /** williamr@2: * Sets the application local zoom. However, in order to have any williamr@2: * effect, it may be necessary to make a subsequent call to williamr@2: * @c ApplyLayoutChangeL. williamr@2: * williamr@2: * @param aZoom application local zoom williamr@2: * @since 3.1 williamr@2: */ williamr@2: IMPORT_C void SetLocalUiZoom(TAknUiZoom aZoom); williamr@2: williamr@2: /* williamr@2: * Can be used to apply changes to settings that affect the current layout, williamr@2: * such as changes to the local zoom. Optionally reports the change williamr@2: * to the layout to all controls in the application. There are a number of williamr@2: * different possible usages of this API: williamr@2: *
    williamr@2: *
  • Can be used to immediately change the local zoom, by passing in williamr@2: * ETrue for the reporting parameter.
  • williamr@2: *
  • Can be called before BaseConstructL without leaving, the effect williamr@2: * is the same as passing EFalse for the reporting parameter, as williamr@2: * the correct layout data is picked up later on during control layout.
  • williamr@2: *
  • Can be used by implementors of the williamr@2: * @c MAknSettingCacheUpdatePlugin interface, in order to set the local williamr@2: * zoom whilst updating the settings cache. By passing in EFalse for the williamr@2: * reporting parameter, the layout switch is deferred to the usual williamr@2: * processing in @c UpdateSettingCacheAndForwardEventL.
  • williamr@2: *
  • Can be used by controls that require a different local zoom to williamr@2: * the underlying application, such as a dialog. By not williamr@2: * reporting the change during construction, the dialog will lay itself out williamr@2: * correctly. However, the dialog must then report the change back to the williamr@2: * app zoom level when it closes, ignoring the resulting resource changed williamr@2: * layout switch event.
  • williamr@2: *
williamr@2: * williamr@2: * @param aReportChange if this is true, then the layout event will be williamr@2: * reported to controls on the control stack williamr@2: * @since 3.1 williamr@2: */ williamr@2: IMPORT_C void ApplyLayoutChangeL(TBool aReportChange); williamr@2: williamr@2: /** williamr@2: * Checks if application UI has full or partial foreground status. williamr@2: * @since 3.2 williamr@2: * @return ETrue if application UI has full or partial foreground status. williamr@2: * Otherwise EFalse. williamr@2: */ williamr@2: TBool HasFullOrPartialForeground() const; williamr@2: williamr@2: /** williamr@2: * Sets the flags for default key event handling williamr@2: * @since 5.0 williamr@2: * @param aFlags which can be a combination of flags williamr@2: * declared in enumeration TKeyEventFlag williamr@2: */ williamr@2: IMPORT_C void SetKeyEventFlags( const TInt aFlags ); williamr@2: williamr@2: /** williamr@2: * Returns a pointer to appui's pointer event modifier. This method is williamr@2: * intended for internal usage only. williamr@2: * williamr@2: * @since S60 v5.0 williamr@2: * @return pointer event modifier williamr@2: */ williamr@2: IMPORT_C CAknPointerEventModifier* PointerEventModifier(); williamr@2: williamr@2: /** williamr@2: * Checks if the application is touch compatible i.e. it has been williamr@2: * constructed with the flag EAknTouchCompatible. williamr@2: * williamr@2: * @since S60 v5.0 williamr@2: * @return ETrue if the application is touch compatible williamr@2: */ williamr@2: IMPORT_C TBool IsTouchCompatible() const; williamr@2: williamr@2: protected: // From CCoeAppUiBase williamr@2: /** williamr@2: * From @c CCoeAppUiBase. williamr@2: * Calls CCoeAppUi::HandleScreenDeviceChangedL(). williamr@2: */ williamr@2: IMPORT_C virtual void HandleScreenDeviceChangedL(); // was Reserved_1() williamr@2: williamr@2: protected: // From CCoeAppUi williamr@2: williamr@2: /** williamr@2: * From @c CCoeAppUi. Handles an application specific event. williamr@2: * @param aType The type of the event that occurred. This should be a williamr@2: * unique identifier constant. williamr@2: * @param aEvent The window server event that occurred. williamr@2: */ williamr@2: IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType, williamr@2: const TWsEvent& aEvent); williamr@2: williamr@2: protected: // New functions williamr@2: /** williamr@2: * Set the application to be a full screen application. williamr@2: * @param aIsFullScreen is @c ETrue if the application is a full screen williamr@2: * application, @c EFlase otherwise. williamr@2: */ williamr@2: IMPORT_C void SetFullScreenApp(TBool aIsFullScreen); williamr@2: williamr@2: /** williamr@2: * Replace current key sound server with new one. williamr@2: * @param aUid ID of the new key sound server. williamr@2: */ williamr@2: IMPORT_C void ReplaceKeySoundsL( TInt aUid ); williamr@2: williamr@2: protected: // from MObjectProvider williamr@2: IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId); williamr@2: williamr@2: public: // not exported williamr@2: void SetScreenModeL(TInt aModeNumber); williamr@2: TInt ScreenMode() const; williamr@2: williamr@2: private: williamr@2: void UpdateSettingCacheAndForwardEventL( TInt aEventId ); williamr@2: // Method tests on aError. If < KErrNone, it calls CCoeEnv::SetAppUi in order to pass williamr@2: // ownership to the environment. CCoeEnv then will delete the AppUi at the usual point in the destruct order williamr@2: void SetAppUiAndLeaveIfErrorL( TInt aError ); williamr@2: TBool AlwaysForwardEvent( TInt aEventId ); williamr@2: void RelinquishPriorityToForegroundAppLC(); williamr@2: williamr@2: private: williamr@2: // Avkon app ui class flags williamr@2: TBitFlags iAknFlags; williamr@2: williamr@2: // Added for Avkon. Monitor events for emergency call support williamr@2: CAknWsEventMonitor* iEventMonitor; williamr@2: williamr@2: // Added for Avkon. Provides access to keysound server. williamr@2: // Moved from CAknAppUi, because CEikSrvUi needs it as well williamr@2: CAknKeySoundSystem* iKeySounds; williamr@2: williamr@2: CAknAppUiBaseExtension* iAppUiBaseExtension; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Abstract Avkon application UI class williamr@2: * williamr@2: * @since S60 0.9 williamr@2: */ williamr@2: williamr@2: class CAknAppUi : public CAknAppUiBase, MEikStatusPaneObserver, williamr@2: public MCoeViewDeactivationObserver, williamr@2: public MAknTouchPaneObserver williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Initialises this Avkon app UI with standard values. @c aAppUiFlags williamr@2: * values are common with @c CEikAppUi::BaseConstructL(aAppUiFlags). williamr@2: * Additionally those @c aAppUiFlags values can be bitwise ORed with williamr@2: * @c EAknEnableSkin flag to provide default skin parameters for this AppUi williamr@2: * instance. williamr@2: * @param aAppUiFlags Application user interface flags. williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(TInt aAppUiFlags=EStandardApp); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CAknAppUi(); williamr@2: williamr@2: public: // From CEikAppUi williamr@2: /** williamr@2: * From @c CEikAppUi. Completes construction. The implementation of williamr@2: * @c ConstructL() in @c CAknAppUi simply calls @c BaseConstructL(). williamr@2: */ williamr@2: IMPORT_C void ConstructL(); // virtual williamr@2: williamr@2: public: williamr@2: /** williamr@2: * Gets a pointer to the status pane. williamr@2: * @return Pointer to the status pane williamr@2: */ williamr@2: IMPORT_C CEikStatusPane* StatusPane(); williamr@2: /** williamr@2: * Gets a pointer to the Command Button Area. williamr@2: * @return Pointer to the CBA williamr@2: */ williamr@2: IMPORT_C CEikButtonGroupContainer* Cba(); williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the touch pane. williamr@2: * @return Pointer to the the touch pane williamr@2: * @since S60 5.0 williamr@2: */ williamr@2: IMPORT_C CAknTouchPane* TouchPane(); williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the application toolbar. williamr@2: * @return Pointer to the applicaton toolbar or NULL williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: IMPORT_C CAknToolbar* PopupToolbar() const; williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the current toolbar( view toolbar is priority ). williamr@2: * @return Pointer to the current toolbar or NULL williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: IMPORT_C CAknToolbar* CurrentPopupToolbar() const; williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the current fixed toolbar( view toolbar is priority ). williamr@2: * @return Pointer to the current fixed toolbar or NULL williamr@2: * @since S60 5.0 williamr@2: */ williamr@2: IMPORT_C CAknToolbar* CurrentFixedToolbar() const; williamr@2: williamr@2: williamr@2: /** williamr@2: * Hides popup toolbar if it is visible williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: void StopDisplayingPopupToolbar(); williamr@2: williamr@2: williamr@2: /** williamr@2: * Processes user commands. williamr@2: * This function passes @c aCommand (except values @c EAknSoftkeyOptions, williamr@2: * @c EAknCmdExit, @c EEikCmdCanceled) to user derived @c HandleCommandL. williamr@2: * @param aCommand A command ID. williamr@2: */ williamr@2: IMPORT_C void ProcessCommandL(TInt aCommand); williamr@2: williamr@2: williamr@2: /** williamr@2: * Handles errors. williamr@2: * @param aError The error code. williamr@2: * @param aExtErr For extended error messages. Not used. williamr@2: * @param aErrorText Error text. Not used. williamr@2: * @param aContextText Text describing the context of the error. Not used. williamr@2: * @return @c ENoDisplay if Error handled proper way, else williamr@2: * @c EErrorNotHandled williamr@2: */ williamr@2: IMPORT_C TErrorHandlerResponse HandleError (TInt aError, williamr@2: const SExtendedError& aExtErr, TDes& aErrorText, TDes& aContextText); williamr@2: williamr@2: /** williamr@2: * Run the application shutter if it exists. williamr@2: */ williamr@2: IMPORT_C void RunAppShutter(); williamr@2: williamr@2: /** williamr@2: * Determines whether the application shutter is active. williamr@2: * @return @c ETrue if application shutter is active. williamr@2: */ williamr@2: IMPORT_C TBool IsAppShutterRunning() const; williamr@2: williamr@2: /** williamr@2: * Determines whether the application is hidden in background. williamr@2: * (i.e. HideInBackground has been called and application has not williamr@2: * yet been activated) williamr@2: * @return @c ETrue if application is hidden in background. williamr@2: */ williamr@2: TBool IsAppHiddenInBackground() const; williamr@2: williamr@2: public: // MCoeViewDeactivationObserver williamr@2: williamr@2: /** williamr@2: * From @c MCoeViewDeactivationObserver. williamr@2: * Handles the deactivation of the view identified by williamr@2: * @c aViewIdToBeDeactivated before the newly activated view with id williamr@2: * @c aNewlyActivatedViewId is marked as current. williamr@2: * Default implementation calls @c iAvkonEnv->CloseAllIntermediateStates() williamr@2: * without using @c aViewIdToBeDeactivated and @c aNewlyActivatedViewId. williamr@2: * @param aViewIdToBeDeactivated williamr@2: * @param aNewlyActivatedViewId williamr@2: */ williamr@2: IMPORT_C virtual void HandleViewDeactivation( williamr@2: const TVwsViewId& aViewIdToBeDeactivated, williamr@2: const TVwsViewId &aNewlyActivatedViewId); williamr@2: williamr@2: public: // from CCoeAppUiBase williamr@2: williamr@2: /** williamr@2: * From @c CCoeAppUiBase. Performs pre-exit processing to ensure the williamr@2: * application will exit cleanly. williamr@2: */ williamr@2: IMPORT_C void PrepareToExit(); williamr@2: williamr@2: public: // from MAknTouchPaneObserver williamr@2: williamr@2: /** williamr@2: * From @MAknTouchPaneObserver. williamr@2: * Handles a change in the size or position of touch pane. williamr@2: */ williamr@2: IMPORT_C void HandleTouchPaneSizeChange(); williamr@2: williamr@2: protected: williamr@2: // from MEikStatusPaneObserver williamr@2: /** williamr@2: * From @c MEikStatusPaneObserver. Handles a change in the position or size williamr@2: * of the screen area occupied by the status pane. williamr@2: */ williamr@2: IMPORT_C void HandleStatusPaneSizeChange(); williamr@2: williamr@2: // from CCoeAppUi williamr@2: /** williamr@2: * From @c CCoeAppUi. Handles system events generated by the window server. williamr@2: * @param aEvent The window server event that occurred. williamr@2: */ williamr@2: IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent); williamr@2: williamr@2: protected: // formerly from MTopSetMember, now reserved williamr@2: IMPORT_C virtual void Reserved_MtsmPosition(); williamr@2: IMPORT_C virtual void Reserved_MtsmObject(); williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Handles changes in keyboard focus when an application switches to, williamr@2: * or from, the foreground. williamr@2: * @param aForeground @c ETrue if the application is in the foreground, williamr@2: * otherwise @c EFalse. williamr@2: */ williamr@2: IMPORT_C void HandleForegroundEventL(TBool aForeground); williamr@2: williamr@2: /** williamr@2: * Handles window server events. williamr@2: * @param aEvent The window server event that occurred. williamr@2: * @param aDestination The control associated with the event. williamr@2: */ williamr@2: IMPORT_C void HandleWsEventL(const TWsEvent& aEvent, williamr@2: CCoeControl* aDestination); williamr@2: williamr@2: /** williamr@2: * Set key block mode. williamr@2: * In default mode, the S60 Developer Platform blocks simultaneous key williamr@2: * presses. williamr@2: * @param aMode @c ENoKeyBlock if no key block, otherwise williamr@2: * @c EDefaultBlockMode williamr@2: */ williamr@2: IMPORT_C void SetKeyBlockMode(TAknKeyBlockMode aMode); williamr@2: IMPORT_C void HandleErrorL(TInt aError, HBufC** aErrorDesc, TBool aShowNote = ETrue ); williamr@2: williamr@2: #ifdef _DEBUG williamr@2: williamr@2: /** williamr@2: * Prints out information about the control and all its subcontrols to williamr@2: * RDebug console. williamr@2: * @param aControl object to be printed. williamr@2: * @param aLevel positioning constant. williamr@2: * @param aDebug stream for printing. williamr@2: */ williamr@2: void DumpControl(CCoeControl* aControl, TInt aLevel, RDebug& aDebug); williamr@2: #endif williamr@2: /** williamr@2: * Try to set window server buffer size to @c KAknDefaultWsBufferSize. williamr@2: */ williamr@2: void DecideWsClientBufferSizesL(); williamr@2: williamr@2: private: williamr@2: void UpdateKeyBlockMode(); williamr@2: TBool SimulateHashKeyMarkingEvent(const TWsEvent& aEvent); williamr@2: williamr@2: private: williamr@2: TBool iDumpNextControl; williamr@2: CAknAppShutter* iAppShutter;// May be set to NULL by the app shutter itself williamr@2: TAknKeyBlockMode iBlockMode; williamr@2: CAknAppUiExtension * iExtension; williamr@2: williamr@2: public: williamr@2: /** williamr@2: * Hide application from Fast-swap window. williamr@2: * @since S60 2.6 williamr@2: * @param aHide @c ETrue if application is hided from Fast-swap window, otherwise williamr@2: * @c EFalse williamr@2: */ williamr@2: IMPORT_C void HideApplicationFromFSW(TBool aHide=ETrue); williamr@2: williamr@2: /** williamr@2: * Gets keyboard layout specific keycode. Uses given resolver williamr@2: * SetAliasKeyCodeResolverL() if set, by default williamr@2: * fetches alternative code from avkon server. williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aCode reference to variable to contain new keycode williamr@2: * @param aKeyEvent reference to original, complete, event williamr@2: * @param aType indicating original event type williamr@2: */ williamr@2: IMPORT_C void GetAliasKeyCodeL(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType); williamr@2: williamr@2: /** williamr@2: * Sets custom resolver for keycode aliases williamr@2: * Creates iExtension if it doesn't exist williamr@2: * @since S60 3.1 williamr@2: * @param aHandler instance implementing MAknAliasKeyCodeResolver williamr@2: */ williamr@2: IMPORT_C void SetAliasKeyCodeResolverL(MAknAliasKeyCodeResolver* aResolver); williamr@2: williamr@2: /** williamr@2: * This is same as RWindowGroup::CaptureKey, except that this version takes williamr@2: * S60 keymappings into account and captures the key that produces requested williamr@2: * aKeyCode according to S60 keymappings. Standard RWindowgroup::CaptureKey williamr@2: * functionality takes place before S60 AppUi framework and has no knowledge williamr@2: * of S60 keymappings. williamr@2: * Note: This method requires same capabilites as RWindowGroup::CaptureKey() williamr@2: * williamr@2: * @since S60 V3.2 williamr@2: * @param aKeycode The key code for the key to be captured. Key codes for williamr@2: * special keys are defined in TKeyCode. williamr@2: * @param aModifier Mask Only the modifier keys in this mask are tested against williamr@2: * the states specified in aModifier. williamr@2: * @param aModifier The key is captured only when the modifier keys specified in williamr@2: * aModifierMask match these states, where 1=modifier set, williamr@2: * and 0=modifier not set. Modifier key states are defined williamr@2: * in TEventModifier. williamr@2: * @return A handle identifying the capture key, or one of the system-wide error williamr@2: * codes (if <0). Handles should be kept in order to be passed to williamr@2: * CancelCaptureKey() later. williamr@2: */ williamr@2: IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier); williamr@2: williamr@2: /** williamr@2: * This is same as RWindowGroup::CaptureKey, except that this version takes williamr@2: * S60 keymappings into account and captures the key that produces requested williamr@2: * aKeyCode according to S60 keymappings. This version leaves instead of returning williamr@2: * an error code. Standard RWindowgroup::CaptureKey functionality takes place williamr@2: * before S60 AppUi framework and has no knowledge of S60 keymappings. williamr@2: * Note: This method requires same capabilites as RWindowGroup::CaptureKey() williamr@2: * williamr@2: * @since S60 V3.2 williamr@2: * @param aKeycode The key code for the key to be captured. Key codes for williamr@2: * special keys are defined in TKeyCode. williamr@2: * @param aModifier Mask Only the modifier keys in this mask are tested against williamr@2: * the states specified in aModifier. williamr@2: * @param aModifier The key is captured only when the modifier keys specified in williamr@2: * aModifierMask match these states, where 1=modifier set, williamr@2: * and 0=modifier not set. Modifier key states are defined williamr@2: * in TEventModifier. williamr@2: * @param aHandle identifying the capture key. Handles should be kept in order williamr@2: * to be passed to CancelCaptureKey() later. williamr@2: */ williamr@2: IMPORT_C void CaptureKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifier, TInt32& aHandle); williamr@2: williamr@2: /** williamr@2: * This tells the application if it is allowed to hide itself in the williamr@2: * background in response to a user (menu or softkey) exit command, williamr@2: * instead of actually exiting. williamr@2: * If the application appears to exit, but actually leaves itself in williamr@2: * memory, it may appear to start faster next time the user activates it. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @return ETrue if the application can hide itself in the background, williamr@2: * EFalse if it must exit properly by calling Exit(). williamr@2: */ williamr@2: IMPORT_C TBool ExitHidesInBackground() const; williamr@2: williamr@2: /** williamr@2: * Hide the running instance of this application from the user, which williamr@2: * makes it appear as if the application has exited. williamr@2: * This is done by placing the application in the background, behind williamr@2: * all other apps, and removing the application from the Fast Swap Window. williamr@2: * When the application comes to the foreground again, it will be williamr@2: * restored to the Fast Swap Window (in HandleForegroundEventL). If the williamr@2: * application is not supposed to be in the Fast Swap Window, it will have williamr@2: * to remove itself again. williamr@2: * @since S60 V5.0 williamr@2: */ williamr@2: IMPORT_C void HideInBackground(); williamr@2: williamr@2: /** williamr@2: * Disables next key sound (and repeated key sounds until pointer up event). williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aScanCode Scan code of disabled key. williamr@2: */ williamr@2: IMPORT_C void DisableNextKeySound( TInt aScanCode ); williamr@2: williamr@2: private: williamr@2: TBool ExitHidesInBackgroundL() const; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: #endif williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: