#include <mw/eikmobs.h>
class MEikMenuObserver : public MEikCommandObserver |
Public Member Enumerations | |
---|---|
enum | TMenuType { EMenuPane, EMenuBar } |
Public Member Functions | |
---|---|
virtual IMPORT_C TBool | CheckHotKeyNotDimmedL(TInt) |
virtual IMPORT_C CCoeControl * | CreateCustomCommandControlL(TInt) |
virtual IMPORT_C void | DynInitMenuBarL(TInt, CEikMenuBar *) |
virtual IMPORT_C void | DynInitMenuPaneL(TInt, CEikMenuPane *) |
virtual IMPORT_C void | HandleAttemptDimmedSelectionL(TInt) |
virtual IMPORT_C void | HandleSideBarMenuL(TInt, const TPoint &, TInt, const CEikHotKeyTable *) |
virtual IMPORT_C void | OfferKeyToAppL(const TKeyEvent &, TEventCode) |
virtual IMPORT_C void | RestoreMenuL(CCoeControl *, TInt, TMenuType) |
pure virtual void | SetEmphasis(CCoeControl *, TBool) |
Protected Member Functions | |
---|---|
MEikMenuObserver() |
Inherited Functions | |
---|---|
MEikCommandObserver::MEikCommandObserver() | |
MEikCommandObserver::ProcessCommandL(TInt) |
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.
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 | |
---|---|
aCommandId | The command corresponding to the selected hotkey. |
IMPORT_C CCoeControl * | CreateCustomCommandControlL | ( | TInt | aControlType | ) | [virtual] |
Reimplemented from MEikCommandObserver::CreateCustomCommandControlL(TInt)
This functions simpy wraps MEikCommandObserver::CreateCustomCommandControlL(TInt aControlType)
See also: MEikCommandObserver::CreateCustomCommandControlL(TInt aControlType)
Parameters | |
---|---|
aControlType | A custom control ID. |
IMPORT_C void | DynInitMenuBarL | ( | TInt | aResourceId, |
CEikMenuBar * | aMenuBar | |||
) | [virtual] |
As DynInitMenuPaneL(), but for menu bars.
Parameters | |
---|---|
aMenuBar | The in-memory representation of the menu bar. |
IMPORT_C void | DynInitMenuPaneL | ( | TInt | aResourceId, |
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 | |
---|---|
aMenuPane | The in-memory representation of the menu pane. |
IMPORT_C void | HandleAttemptDimmedSelectionL | ( | TInt | aCommandId | ) | [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 | |
---|---|
aCommandId | Command ID for the menu item. |
IMPORT_C void | HandleSideBarMenuL | ( | TInt | aResourceId, |
const TPoint & | aPos, | |||
TInt | aModifiers, | |||
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 | |
---|---|
aResourceId | Resource ID identifying the menu to launch. |
aPos | Position of the menu's reference point. For sidebar menus, this is the top-right corner. |
aModifiers | Key modifiers held when the menu was invoked. |
aTable | The menu bar's hotkey items. |
IMPORT_C void | OfferKeyToAppL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
Called if a key which is not used by the menu is pressed while the observer's menu is displaying.
Parameters | |
---|---|
aKeyEvent | The key event the menu is offering to the app. |
aType | Event code type. |
IMPORT_C void | RestoreMenuL | ( | CCoeControl * | aMenuControl, |
TInt | aResourceId, | |||
TMenuType | aType | |||
) | [virtual] |
Restores the menu window aMenuWindow.
Parameters | |
---|---|
aMenuControl | The menu window to be restored. |
aResourceId | The menu's ID. |
aType | The type of menu being restored. |
void | SetEmphasis | ( | CCoeControl * | aMenuControl, |
TBool | aEmphasis | |||
) | [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 | |
---|---|
aMenuControl | The menu control. |
aEmphasis | ETrue to emphasize the menu, EFalse otherwise. |