CEikMenuBar Class Reference

#include <mw/eikmenub.h>

Link against: ConnectionUiUtilities.lib

class CEikMenuBar : public CEikBorderedControl

Inherits from

Public Member Enumerations
enumanonymous { ETypeId }
enumTMenuType { EMenuOptions, EMenuContext, EMenuEdit, EMenuOptionsNoTaskSwapper }
Public Member Functions
CEikMenuBar()
~CEikMenuBar()
IMPORT_C voidChangeMenuBarL(TInt, TInt, TInt)
virtual IMPORT_C voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidConstructL(MEikMenuObserver *, TInt, TInt)
virtual IMPORT_C voidDraw(const TRect &)
IMPORT_C voidDrawItem(TInt)
virtual IMPORT_C voidFindCommandIdInResourceL(TInt, TInt &, TInt &)
virtual IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &)
IMPORT_C CEikMenuBar::TMenuTypeGetMenuType()
virtual IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
virtual IMPORT_C voidHandleResourceChange(TInt)
CEikHotKeyTable *HotKeyTable()
IMPORT_C TBoolIsDisplayed()
CAknItemActionMenu *ItemActionMenu()
IMPORT_C TBoolItemSpecificCommandsEnabled()
IMPORT_C CEikMenuPane *MenuPane()
IMPORT_C voidMoveHighlightToL(TInt, TInt)
virtual IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &, TEventCode)
CEikMenuPane *PopulateItemActionMenuL(CAknItemActionMenu &)
IMPORT_C voidReduceRect(TRect &)
IMPORT_C voidRemoveEditMenuObserver(MEikMenuObserver *)
IMPORT_C TIntSelectedItem()
IMPORT_C TIntSelectedTitle()
IMPORT_C voidSetContextMenuTitleResourceId(TInt)
IMPORT_C voidSetEditMenuObserver(MEikMenuObserver *)
IMPORT_C CEikHotKeyTable *SetHotKeyTable(CEikHotKeyTable *)
voidSetItemActionMenu(CAknItemActionMenu *)
IMPORT_C SCursorSetMenuCursor(const SCursor &)
IMPORT_C voidSetMenuTitleArray(CTitleArray *)
IMPORT_C voidSetMenuTitleResourceId(TInt)
IMPORT_C voidSetMenuType(TMenuType)
IMPORT_C voidSetTitleArrayOwnedExternally(TBool)
IMPORT_C voidStopDisplayingMenuBar()
IMPORT_C CTitleArray *TitleArray()
IMPORT_C voidTryDisplayContextMenuBarL()
IMPORT_C voidTryDisplayMenuBarL()
IMPORT_C voidTryDisplayMenuBarWithoutFepMenusL()
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
CEikBorderedControl::iBorder
Inherited Enumerations
CCoeControl:TZoomType
Inherited Functions
CAknControl::CAknControl()
CAknControl::~CAknControl()
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CCoeControl::AccumulatedZoom()const
CCoeControl::ActivateGc()const
CCoeControl::ActivateL()
CCoeControl::BackedUpWindow()const
CCoeControl::Background()const
CCoeControl::CCoeControl()
CCoeControl::CCoeControl(CCoeEnv *)
CCoeControl::CCoeControl(const CCoeControl &)
CCoeControl::CCoeControlArray
CCoeControl::CapturesPointer()const
CCoeControl::ClaimPointerGrab(TBool)
CCoeControl::ClaimPointerGrab(TInt,TBool)
CCoeControl::CloseWindow()
CCoeControl::ComponentArrayExists()const
CCoeControl::ComponentControl(TInt)const
CCoeControl::Components()
CCoeControl::Components()const
CCoeControl::ControlContext()const
CCoeControl::ControlEnv()const
CCoeControl::CopyControlContextFrom(const CCoeControl *)
CCoeControl::CountComponentControls()const
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &)
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &,TDisplayMode)
CCoeControl::CreateWindowL()
CCoeControl::CreateWindowL(RWindowGroup *)
CCoeControl::CreateWindowL(RWindowTreeNode &)
CCoeControl::CreateWindowL(const CCoeControl *)
CCoeControl::CustomGc()const
CCoeControl::DeactivateGc()const
CCoeControl::DrawBackground(const TRect &)const
CCoeControl::DrawDeferred()const
CCoeControl::DrawForeground(const TRect &)const
CCoeControl::DrawNow()const
CCoeControl::DrawNow(const TRect &)const
CCoeControl::DrawableWindow()const
CCoeControl::EnableDragEvents()
CCoeControl::EnableReportControlStateChange(TBool)
CCoeControl::EnableWindowTransparency()
CCoeControl::FindBackground()const
CCoeControl::FindFontProvider()const
CCoeControl::FocusChanged(TDrawNow)
CCoeControl::GetColor(TInt,TRgb &)const
CCoeControl::GetGc()const
CCoeControl::GetHelpContext(TCoeHelpContext &)const
CCoeControl::GrabbingComponent()const
CCoeControl::GrabbingComponent(TInt)const
CCoeControl::HandleComponentControlsResourceChange(TInt)
CCoeControl::HandleControlArrayEventL(CCoeControlArray::TEvent,const CCoeControlArray *,CCoeControl *,TInt)
CCoeControl::HandlePointerBufferReadyL()
CCoeControl::HandleRedrawEvent(const TRect &)const
CCoeControl::HitTest()const
CCoeControl::IgnoreEventsUntilNextPointerUp()
CCoeControl::Index(const CCoeControl *)const
CCoeControl::InitComponentArrayL()
CCoeControl::IsActivated()const
CCoeControl::IsBackedUp()const
CCoeControl::IsBeingDestroyed()const
CCoeControl::IsBlank()const
CCoeControl::IsDimmed()const
CCoeControl::IsFocused()const
CCoeControl::IsNonFocusing()const
CCoeControl::IsReadyToDraw()const
CCoeControl::IsVisible()const
CCoeControl::LayoutManager()const
CCoeControl::MakeVisible(TBool)
CCoeControl::MaximumWidth()const
CCoeControl::MinimumSize()
CCoeControl::NotifyFontChange(const CCoeFontProvider *)
CCoeControl::Observer()const
CCoeControl::OverrideColorL(TInt,TRgb)
CCoeControl::OwnsWindow()const
CCoeControl::Parent()
CCoeControl::Parent()const
CCoeControl::Position()const
CCoeControl::PositionChanged()
CCoeControl::PositionRelativeToScreen()const
CCoeControl::PrepareForFocusGainL()
CCoeControl::PrepareForFocusLossL()
CCoeControl::ProcessPointerBufferReadyL()
CCoeControl::ProcessPointerEventL(const TPointerEvent &)
CCoeControl::Rect()const
CCoeControl::RecursivelyMergeInputCapabilities(TCoeInputCapabilities &)const
CCoeControl::RecursivelyMergedInputCapabilities()const
CCoeControl::RefetchPixelMappingL()
CCoeControl::RemoveFromParent()
CCoeControl::ReportEventL(MCoeControlObserver::TCoeEvent)
CCoeControl::RequestRelayout(const CCoeControl *)
CCoeControl::ResetGc()const
CCoeControl::ScreenFont(const TCoeFont &)const
CCoeControl::SetAllowStrayPointers()
CCoeControl::SetBackground(const MCoeControlBackground *)
CCoeControl::SetBlank()
CCoeControl::SetCanDrawOutsideRect()
CCoeControl::SetComponentsToInheritVisibility(TBool)
CCoeControl::SetContainerWindowL(RBackedUpWindow &)
CCoeControl::SetContainerWindowL(RWindow &)
CCoeControl::SetContainerWindowL(const CCoeControl &)
CCoeControl::SetControlContext(MCoeControlContext *)
CCoeControl::SetCornerAndSize(TGulAlignment,const TSize &)
CCoeControl::SetCustomGc(CWindowGc *)
CCoeControl::SetDimmed(TBool)
CCoeControl::SetExtent(const TPoint &,const TSize &)
CCoeControl::SetExtentToWholeScreen()
CCoeControl::SetFocus(TBool,TDrawNow)
CCoeControl::SetFocusing(TBool)
CCoeControl::SetFontProviderL(const CCoeFontProvider &)
CCoeControl::SetGc(CWindowGc *)const
CCoeControl::SetGloballyCapturing(TBool)
CCoeControl::SetHitTest(const MCoeControlHitTest *)
CCoeControl::SetLayoutManagerL(MCoeLayoutManager *)
CCoeControl::SetMaximumWidth(TInt)
CCoeControl::SetMopParent(MObjectProvider *)
CCoeControl::SetNeighbor(CCoeControl *)
CCoeControl::SetNonFocusing()
CCoeControl::SetObserver(MCoeControlObserver *)
CCoeControl::SetParent(CCoeControl *)
CCoeControl::SetPointerCapture(TBool)
CCoeControl::SetPosition(const TPoint &)
CCoeControl::SetRect(const TRect &)
CCoeControl::SetSize(const TSize &)
CCoeControl::SetSizeWithoutNotification(const TSize &)
CCoeControl::SetTextBaselineSpacing(TInt)
CCoeControl::SetUniqueHandle(TInt)
CCoeControl::SetZoomFactorL(TInt,TZoomType)
CCoeControl::Size()const
CCoeControl::SizeChanged()
CCoeControl::SystemGc()const
CCoeControl::TextBaselineOffset(const TSize &)const
CCoeControl::TextDrawer(TInt)const
CCoeControl::UniqueHandle()const
CCoeControl::Window()const
CCoeControl::WriteInternalStateNowL(RWriteStream &)const
CCoeControl::ZoomWithType()const
CCoeControl::operator=(const CCoeControl &)
CCoeControl::~CCoeControl()
CEikBorderedControl::Border()const
CEikBorderedControl::CEikBorderedControl()
CEikBorderedControl::CEikBorderedControl(const TGulBorder &)
CEikBorderedControl::HasBorder()const
CEikBorderedControl::SetAdjacent(TInt)
CEikBorderedControl::SetBorder(TGulBorder::TBorderType)
CEikBorderedControl::SetBorder(TInt)
CEikBorderedControl::WriteInternalStateL(RWriteStream &)const

Detailed Description

Menu bars are constructed from MENU_BAR resources and issue application commands which should be handled by overriding CEikAppUi::HandleCommandL().

Member Enumeration Documentation

Enum anonymous

Declares an object type for a class, in order to allow the object provider mechanism to locate and provide objects from the class.

EnumeratorValueDescription
ETypeId0x101F4106

Enum TMenuType

EnumeratorValueDescription
EMenuOptions0

Options menu launched from the Options softkey. This is the default value.

EMenuContext1

Context sensitive menu that is launched from selection key when the application supports it.

EMenuEdit2

Edit menu containing editing specific items.

EMenuOptionsNoTaskSwapper3

Options menu launched from the Options softkey. Task swapper item is not shown.

Constructor & Destructor Documentation

CEikMenuBar ( )

IMPORT_CCEikMenuBar()

C++ default constructor.

~CEikMenuBar ( )

IMPORT_C~CEikMenuBar()

Destructor.

Member Function Documentation

ChangeMenuBarL ( TInt, TInt, TInt )

IMPORT_C voidChangeMenuBarL(TIntaHotKeyResourceId = 0,
TIntaMenuTitleResourceId = 0,
TIntaDisplayNow = ETrue
)

Not implemented

ParameterDescription
aHotKeyResourceIdNot used.
aMenuTitleResourceIdNot used.
aDisplayNowNot used.

ConstructFromResourceL ( TResourceReader & )

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[virtual]

Second phase constructor for a menu bar which builds the menu bar from the given resource file.

ParameterDescription
aReaderThe resource reader.

ConstructL ( MEikMenuObserver *, TInt, TInt )

IMPORT_C voidConstructL(MEikMenuObserver *aMenuObserver,
TIntaHotKeyResourceId = 0,
TIntaMenuTitleResourceId = 0
)

Second phase constructor for a menu bar.

ParameterDescription
aMenuObserverThe menu's observer.
aHotKeyResourceIdThe ID of the resource, of type HOTKEY from which the hotkey table is created. This is optional. By default it's nil.
aMenuTitleResourceIdThe ID of the resource, of type MENU_BAR from which the menu title array is created. This is optional. By default it's nil.

Draw ( const TRect & )

IMPORT_C voidDraw(const TRect &aRect)const [virtual]

From CCoeControl

Not implemented.

DrawItem ( TInt )

IMPORT_C voidDrawItem(TIntaItem)const

Not implemented.

ParameterDescription
aItemNot used.

FindCommandIdInResourceL ( TInt, TInt &, TInt & )

IMPORT_C voidFindCommandIdInResourceL(TIntaCommandId,
TInt &aPaneindex,
TInt &aItemindex
)[virtual]

Searches for the menu item that corresponds to the specified command.

ParameterDescription
aCommandIdThe ID to search for.
aPaneindexMenu pane index.
aItemindexMenu item index.

GetColorUseListL ( CArrayFix< TCoeColorUse > & )

IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList)const [virtual]

From CCoeControl.

Gets the list of logical colours used to draw the control.

The list includes an explanation of how each colour is used. By default, this function has an empty implementation.

Since
5.1 SDK.
ParameterDescription
aColorUseListThe colour list.

GetMenuType ( )

IMPORT_C CEikMenuBar::TMenuTypeGetMenuType()const

Gets type of the menu.

Since
S60 5.2

Returns: the type defined in CEikMenuBar::TMenuType of menu.

HandlePointerEventL ( const TPointerEvent & )

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl

Handles pointer events. This function gets called whenever a pointer event occurs in the control, i.e. when the pointer is within the control's extent, or when the control has grabbed the pointer. The control should implement this function to handle pointer events.

Note: events of type EButton1Down are processed before HandlePointerEventL() is called, in order to transfer keyboard focus to the control in which the EButton1Down event occurred.

If overriding HandlePointerEventL(), the implementation must include a base call to CCoeControl's HandlePointerEventL().

ParameterDescription
aPointerEventThe pointer event.

HandleResourceChange ( TInt )

IMPORT_C voidHandleResourceChange(TIntaType)[virtual]

From CCoeControl.

Handles a change to the control's resources.

The types of resources handled are those which are shared across the environment, e.g. colours or fonts.

Since
5.1 SDK.
ParameterDescription
aTypeA message UID value. The most common is KEikMessageColorSchemeChange which controls get when the colour scheme is changed. Other examples include: KEikMessageFadeAllWindows, KEikMessageUnfadeWindows, KEikMessageZoomChange, KEikMessageVirtualCursorStateChange, KEikMessageCapsLock, KEikMessagePrepareForSave.

HotKeyTable ( )

CEikHotKeyTable *HotKeyTable()const [inline]

Gets a pointer to the menu s hot key table.

IsDisplayed ( )

IMPORT_C TBoolIsDisplayed()

Allows the client to determine if the menubar instance is displayed.

Returns: Etrue if displayed and EFalse if not.

ItemActionMenu ( )

CAknItemActionMenu *ItemActionMenu()const

Provides pointer to item action menu.

ItemSpecificCommandsEnabled ( )

IMPORT_C TBoolItemSpecificCommandsEnabled()const

Returns ETrue when item specific commands are enabled in menu bar (main pane collection has a highlight) and EFalse when they are disabled (main pane collection does not have a highlight).

Since
S60 5.2

Returns: ETrue when item specific commands are enabled.

MenuPane ( )

IMPORT_C CEikMenuPane *MenuPane()

Gets a menu pane resource.

Returns: The pointer to CEikMenuPane object containing a menu pane resource.

MoveHighlightToL ( TInt, TInt )

IMPORT_C voidMoveHighlightToL(TIntaNewSelectedTitle,
TIntaNewSelectedItem = 0
)

Not implemented.

ParameterDescription
aNewSelectedTitleNot used
aNewSelectedItemNot used.

OfferKeyEventL ( const TKeyEvent &, TEventCode )

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

From CCoeControl

Handles key events offered to the menu by the control environment and provides an appropriate implementation of CCoeControl::OfferKeyEventL().

ParameterDescription
aKeyEventThe key event.
aTypeThe type of key event: EEventKey, EEventKeyUp or EEventKeyDown.

Returns: Indicates whether or not the key event was used by this control.

PopulateItemActionMenuL ( CAknItemActionMenu & )

CEikMenuPane *PopulateItemActionMenuL(CAknItemActionMenu &aItemActionMenu)

Populates item action menu.

ReduceRect ( TRect & )

IMPORT_C voidReduceRect(TRect &aRect)const

If the menu bar is visible, removes the menu bar height from the top of aRect and returns the new rectangle in a new value of aRect.

ParameterDescription
aRectA rectangle that on return is reduced in height by the height of the menu bar.

RemoveEditMenuObserver ( MEikMenuObserver * )

IMPORT_C voidRemoveEditMenuObserver(MEikMenuObserver *aEditMenuObserver)

Sets the menu observer interface to NULL.

ParameterDescription
aEditMenuObserverMenu observer interface that will be set to NULL.

SelectedItem ( )

IMPORT_C TIntSelectedItem()

Gets the index of the menu item selected by the cursor.

Returns: The index of the selected menu item.

SelectedTitle ( )

IMPORT_C TIntSelectedTitle()

Gets the index of the menu pane selected by the cursor.

Returns: The index of the selected menu pane.

SetContextMenuTitleResourceId ( TInt )

IMPORT_C voidSetContextMenuTitleResourceId(TIntaMenuTitleResourceId)

SetEditMenuObserver ( MEikMenuObserver * )

IMPORT_C voidSetEditMenuObserver(MEikMenuObserver *aEditMenuObserver)

Sets menu observer interface.

ParameterDescription
aEditMenuObserverMenu observer interface.

SetHotKeyTable ( CEikHotKeyTable * )

IMPORT_C CEikHotKeyTable *SetHotKeyTable(CEikHotKeyTable *aHotKeyTable)

Not implemented!

ParameterDescription
aHotKeyTableNot used.

Returns: NULL.

SetItemActionMenu ( CAknItemActionMenu * )

voidSetItemActionMenu(CAknItemActionMenu *aItemActionMenu)

Sets item action menu instance to menu bar.

SetMenuCursor ( const SCursor & )

IMPORT_C SCursorSetMenuCursor(const SCursor &aCursor)

Sets the cursor to the specifed menu pane and menu item.

ParameterDescription
aCursorThe menu pane and menu item to which the cursor is set.

Returns: A SCursor structure holding the menu item within the menu pane.

SetMenuTitleArray ( CTitleArray * )

IMPORT_C voidSetMenuTitleArray(CTitleArray *aTitleArray)

Not implemented.

ParameterDescription
aTitleArrayNot used.

SetMenuTitleResourceId ( TInt )

IMPORT_C voidSetMenuTitleResourceId(TIntaMenuTitleResourceId)

Sets the menu s resource ID.

ParameterDescription
aMenuTitleResourceIdThe ID of the resource to use.

SetMenuType ( TMenuType )

IMPORT_C voidSetMenuType(TMenuTypeaMenuType)
Sets type of the menu. Menu can be for example Options menu launched from Options softkey or context sensitive menu launched from the selection key. By default the launched menu is options menu.
Since
S60 3.1
ParameterDescription
aMenuTypeOne of values of CEikMenuBar::TMenuType enumeration.

SetTitleArrayOwnedExternally ( TBool )

IMPORT_C voidSetTitleArrayOwnedExternally(TBoolaOwnedExternally)

Not implemented.

ParameterDescription
aOwnedExternallyNot used.

StopDisplayingMenuBar ( )

IMPORT_C voidStopDisplayingMenuBar()

Stops displaying the menu bar.

This function causes the menu bar to disappear from the screen until it is invoked again by the user. In most circumstances this is done by the Uikon framework, so an application program will not normally need to use this function.

TitleArray ( )

IMPORT_C CTitleArray *TitleArray()

Gets array of information about the menu bar titles.

Returns: Pointer to CTitleArray object containing array of information about menu bar titles.

TryDisplayContextMenuBarL ( )

IMPORT_C voidTryDisplayContextMenuBarL()

TryDisplayMenuBarL ( )

IMPORT_C voidTryDisplayMenuBarL()

Displays the menu bar.

If the menu is not already displayed, this function displays the menu bar and allows the user to make a selection. In most circumstances this is done by the Uikon framework, so an application program will not normally need to use this function.

TryDisplayMenuBarWithoutFepMenusL ( )

IMPORT_C voidTryDisplayMenuBarWithoutFepMenusL()

If the menu is not already displayed, this function displays the menu bar without fep menu and allows the user to make a selection. In most circumstances this is done by the Uikon framework, so an application program will not normally need to use this function.