MEikAutoMenuObserver Class Reference

#include <mw/eikmobs.h>

class MEikAutoMenuObserver : public MEikMenuObserver

Inherits from

Public Member Functions
virtual IMPORT_C TBoolCheckHotKeyNotDimmedL(TInt)
virtual IMPORT_C CCoeControl *CreateCustomCommandControlL(TInt)
virtual IMPORT_C voidDynInitMenuBarL(TInt, CEikMenuBar *)
virtual IMPORT_C voidDynInitMenuPaneL(TInt, CEikMenuPane *)
virtual IMPORT_C voidHandleAttemptDimmedSelectionL(TInt)
virtual IMPORT_C voidHandleSideBarMenuL(TInt, const TPoint &, TInt, const CEikHotKeyTable *)
pure virtual TKeyResponse OfferHotKeyL(const TKeyEvent &, TEventCode)
virtual IMPORT_C voidOfferKeyToAppL(const TKeyEvent &, TEventCode)
virtual IMPORT_C voidRestoreMenuL(CCoeControl *, TInt, TMenuType)
virtual IMPORT_C voidSetEmphasis(CCoeControl *, TBool)
Protected Member Functions
MEikAutoMenuObserver()
Inherited Enumerations
MEikMenuObserver:TMenuType
Inherited Functions
MEikCommandObserver::MEikCommandObserver()
MEikCommandObserver::ProcessCommandL(TInt)
MEikMenuObserver::MEikMenuObserver()

Detailed Description

Provides additional functionality to an auto menu title, in the form of an OfferHotKeyL() method, which is not required in the normal MEikMenuObserver.

Auto menu titles are used to ensure that some menu panes appear in every menu constructed for an application.

Constructor & Destructor Documentation

MEikAutoMenuObserver ( )

IMPORT_CMEikAutoMenuObserver()[protected]

Member Function Documentation

CheckHotKeyNotDimmedL ( TInt )

IMPORT_C TBoolCheckHotKeyNotDimmedL(TIntaCommandId)[virtual]

Determines whether a command should be passed to the application.

Applications can choose whether to respond to a hotkey event that corresponds to a dimmed item. This function is called when a recognised key press is offered to a menu bar or a menu pane to determine whether to send the corresponding command.

ParameterDescription
aCommandIdThe command corresponding to the selected hotkey.

Returns: ETrue if the command should be passed to the application. This is the default. EFalse if the command should not be passed to the application.

CreateCustomCommandControlL ( TInt )

IMPORT_C CCoeControl *CreateCustomCommandControlL(TIntaControlType)[virtual]
ParameterDescription
aControlTypeA custom control ID.

DynInitMenuBarL ( TInt, CEikMenuBar * )

IMPORT_C voidDynInitMenuBarL(TIntaResourceId,
CEikMenuBar *aMenuBar
)[virtual]

As DynInitMenuPaneL(), but for menu bars.

ParameterDescription
aMenuBarThe in-memory representation of the menu bar.

DynInitMenuPaneL ( TInt, CEikMenuPane * )

IMPORT_C voidDynInitMenuPaneL(TIntaResourceId,
CEikMenuPane *aMenuPane
)[virtual]

Dynamically initialises a menu pane.

The Uikon framework calls this function, if it is implemented in a menu's observer, immediately before the menu pane is activated.

Typically this function should inquire the value of application data, and initialise menu items accordingly. This includes dimming menu items, changing their text, setting the state of checked items and radio buttons and dynamically adding items to a menu.

ParameterDescription
aMenuPaneThe in-memory representation of the menu pane.

HandleAttemptDimmedSelectionL ( TInt )

IMPORT_C voidHandleAttemptDimmedSelectionL(TIntaCommandId)[virtual]

Responds to a user's attempt to select a dimmed item by displaying a message (CEikonEnv::InfoMsg()) to indicate the item is unavailable.

ParameterDescription
aCommandIdCommand ID for the menu item.

HandleSideBarMenuL ( TInt, const TPoint &, TInt, const CEikHotKeyTable * )

IMPORT_C voidHandleSideBarMenuL(TIntaResourceId,
const TPoint &aPos,
TIntaModifiers,
const CEikHotKeyTable *aTable
)[virtual]

This function is invoked by CEikMenuBar's input handling functions.

It may be overridden to handle displaying menus launched from the side bar.

ParameterDescription
aResourceIdResource ID identifying the menu to launch.
aPosPosition of the menu's reference point. For sidebar menus, this is the top-right corner.
aModifiersKey modifiers held when the menu was invoked.
aTableThe menu bar's hotkey items.

OfferHotKeyL ( const TKeyEvent &, TEventCode )

TKeyResponse OfferHotKeyL(const TKeyEvent &aKeyEvent,
TEventCodeaType
)[pure virtual]

Offers the specified hot key to the auto menu title.

Implement this function if you expect to handle any events from an auto menu.

ParameterDescription
aKeyEventThe key event.
aTypeThe type of key event.

Returns: The auto menu title's response.

OfferKeyToAppL ( const TKeyEvent &, TEventCode )

IMPORT_C voidOfferKeyToAppL(const TKeyEvent &aKeyEvent,
TEventCodeaType
)[virtual]

Called if a key which is not used by the menu is pressed while the observer's menu is displaying.

ParameterDescription
aKeyEventThe key event the menu is offering to the app.
aTypeEvent code type.

RestoreMenuL ( CCoeControl *, TInt, TMenuType )

IMPORT_C voidRestoreMenuL(CCoeControl *aMenuControl,
TIntaResourceId,
TMenuTypeaType
)[virtual]

Restores the menu window aMenuWindow.

ParameterDescription
aMenuControlThe menu window to be restored.
aResourceIdThe menu's ID.
aTypeThe type of menu being restored.

SetEmphasis ( CCoeControl *, TBool )

IMPORT_C voidSetEmphasis(CCoeControl *aMenuControl,
TBoolaEmphasis
)[virtual]

Sets the specified control's emphasis.

ParameterDescription
aMenuControlThe control for which emphasis is set.
aEmphasisIf ETrue the menu is emphasised. If EFalse the menu is not emphasised.