MEikMenuObserver Class Reference

class MEikMenuObserver : public MEikCommandObserver

Menu observer interface.

Menu observers cooperate with menu bars and menu panes, initialising them before display and responding to menu events appropriately. CEikAppUi implements MEikMenuObserver, so these functions may be implemented on an application's App UI.

Inherits from

Public Member Functions
IMPORT_C TBoolCheckHotKeyNotDimmedL(TInt)
IMPORT_C CCoeControl *CreateCustomCommandControlL(TInt)
IMPORT_C voidDynInitMenuBarL(TInt, CEikMenuBar *)
IMPORT_C voidDynInitMenuPaneL(TInt, CEikMenuPane *)
IMPORT_C voidHandleAttemptDimmedSelectionL(TInt)
IMPORT_C voidHandleSideBarMenuL(TInt, const TPoint &, TInt, const CEikHotKeyTable *)
IMPORT_C voidOfferKeyToAppL(const TKeyEvent &, TEventCode)
IMPORT_C voidRestoreMenuL(CCoeControl *, TInt, TMenuType)
voidSetEmphasis(CCoeControl *, TBool)
Protected Member Functions
MEikMenuObserver()
Private Member Functions
IMPORT_C voidMEikCommandObserver_Reserved1()
IMPORT_C voidMEikCommandObserver_Reserved2()
IMPORT_C voidReserved_1_MenuObserver()
IMPORT_C voidReserved_2_MenuObserver()
Inherited Functions
MEikCommandObserver::MEikCommandObserver()
MEikCommandObserver::ProcessCommandL(TInt)
Public Member Enumerations
enumTMenuType { EMenuPane, EMenuBar }
Private Attributes
TInt iMEikMenuObserver_Spare1

Constructor & Destructor Documentation

MEikMenuObserver()

IMPORT_CMEikMenuObserver()[protected]

Constructor for MEikMenuObserver

Member Functions 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.

Parameters

TInt aCommandIdThe command corresponding to the selected hotkey.

CreateCustomCommandControlL(TInt)

IMPORT_C CCoeControl *CreateCustomCommandControlL(TIntaControlType)[virtual]

Parameters

TInt aControlTypeA custom control ID.

DynInitMenuBarL(TInt, CEikMenuBar *)

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

As DynInitMenuPaneL(), but for menu bars.

Parameters

TInt aResourceId
CEikMenuBar * 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.

Parameters

TInt aResourceId
CEikMenuPane * 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.

Parameters

TInt 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.

Parameters

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

MEikCommandObserver_Reserved1()

IMPORT_C voidMEikCommandObserver_Reserved1()[private, virtual]

Reserved for Future use

MEikCommandObserver_Reserved2()

IMPORT_C voidMEikCommandObserver_Reserved2()[private, virtual]

Reserved for Future use

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.

Parameters

const TKeyEvent & aKeyEventThe key event the menu is offering to the app.
TEventCode aTypeEvent code type.

Reserved_1_MenuObserver()

IMPORT_C voidReserved_1_MenuObserver()[private, virtual]

Reserved_2_MenuObserver()

IMPORT_C voidReserved_2_MenuObserver()[private, virtual]

RestoreMenuL(CCoeControl *, TInt, TMenuType)

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

Restores the menu window aMenuWindow.

Parameters

CCoeControl * aMenuControlThe menu window to be restored.
TInt aResourceIdThe menu's ID.
TMenuType aTypeThe type of menu being restored.

SetEmphasis(CCoeControl *, TBool)

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

Called by the Uikon framework to handle the emphasising or de-emphasising of a menu window.

CEikMenuBar objects call this on their observer to emphasise themselves when they are displayed, and de-emphasise themselves when they stop displaying.

Parameters

CCoeControl * aMenuControlThe menu control.
TBool aEmphasisETrue to emphasize the menu, EFalse otherwise.

Member Enumerations Documentation

Enum TMenuType

Menu types

Enumerators

EMenuPane

Menu pane.

EMenuBar

Menu bar.

Member Data Documentation

TInt iMEikMenuObserver_Spare1

TInt iMEikMenuObserver_Spare1[private]