CEikMenuBar Class Reference

API published in: S60 1st Ed

Link against: eikcoctl.lib eikcore.lib

Capability Information

Required Capabilities

None


#include <eikmenub.h>

Inherits CEikBorderedControl, and MAknIntermediateState.


Detailed Description

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

Public Types

enum   TMenuType { EMenuOptions = 0, EMenuContext = 1, EMenuEdit = 2, EMenuOptionsNoTaskSwapper = 3 }

Public Member Functions

  DECLARE_TYPE_ID (0x101F4106) struct SCursor
  Specifies the menu item within the menu pane.
IMPORT_C  ~CEikMenuBar ()
  Destructor.
IMPORT_C  CEikMenuBar ()
  C++ default constructor.
IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.
IMPORT_C void  Draw (const TRect &aRect) const
  From CCoeControl.
IMPORT_C void  ConstructL (MEikMenuObserver *aMenuObserver, TInt aHotKeyResourceId=0, TInt aMenuTitleResourceId=0)
  Second phase constructor for a menu bar.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  Second phase constructor for a menu bar which builds the menu bar from the given resource file.
IMPORT_C void  ChangeMenuBarL (TInt aHotKeyResourceId=0, TInt aMenuTitleResourceId=0, TInt aDisplayNow=ETrue)
  Not implemented.
IMPORT_C CEikHotKeyTable SetHotKeyTable (CEikHotKeyTable *aHotKeyTable)
  Not implemented!
IMPORT_C void  SetMenuTitleResourceId (TInt aMenuTitleResourceId)
  Sets the menu’s resource ID.
IMPORT_C void  SetContextMenuTitleResourceId (TInt aMenuTitleResourceId)
IMPORT_C void  SetMenuTitleArray (CTitleArray *aTitleArray)
  Not implemented.
IMPORT_C void  SetTitleArrayOwnedExternally (TBool aOwnedExternally)
  Not implemented.
IMPORT_C SCursor  SetMenuCursor (const SCursor &aCursor)
  Sets the cursor to the specifed menu pane and menu item.
IMPORT_C void  StopDisplayingMenuBar ()
  Stops displaying the menu bar.
IMPORT_C void  TryDisplayMenuBarL ()
  Displays the menu bar.
IMPORT_C void  TryDisplayContextMenuBarL ()
IMPORT_C void  TryDisplayMenuBarWithoutFepMenusL ()
  If the menu is not already displayed, this function displays the menu bar without fep menu and allows the user to make a selection.
IMPORT_C void  MoveHighlightToL (TInt aNewSelectedTitle, TInt aNewSelectedItem=0)
  Not implemented.
IMPORT_C void  DrawItem (TInt aItem) const
  Not implemented.
CEikHotKeyTable HotKeyTable () const
  Gets a pointer to the menu’s hot key table.
IMPORT_C TInt  SelectedTitle ()
  Gets the index of the menu pane selected by the cursor.
IMPORT_C TInt  SelectedItem ()
  Gets the index of the menu item selected by the cursor.
virtual IMPORT_C void  FindCommandIdInResourceL (TInt aCommandId, TInt &aPaneindex, TInt &aItemindex)
  Searches for the menu item that corresponds to the specified command.
IMPORT_C CEikMenuPane MenuPane ()
  Gets a menu pane resource.
IMPORT_C void  ReduceRect (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.
IMPORT_C CTitleArray TitleArray ()
  Gets array of information about the menu bar titles.
IMPORT_C void  SetEditMenuObserver (MEikMenuObserver *aEditMenuObserver)
  Sets menu observer interface.
IMPORT_C void  RemoveEditMenuObserver (MEikMenuObserver *aEditMenuObserver)
  Sets the menu observer interface to NULL.
IMPORT_C TBool  IsDisplayed ()
  Allows the client to determine if the menubar instance is displayed.
IMPORT_C void  SetMenuType (TMenuType aMenuType)
  Sets type of the menu.
virtual IMPORT_C void  GetColorUseListL (CArrayFix< TCoeColorUse > &aColorUseList) const
  From CCoeControl.
virtual IMPORT_C void  HandleResourceChange (TInt aType)
  From CCoeControl.

Friends

class  CEikMenuPaneTitle
class  CEikMenuBarExtension

Data Structures

class   CTitleArray
  This class enables construction, and destruction of an array of information about menu bar titles. More...
struct   SPosition

Member Enumeration Documentation

enum CEikMenuBar::TMenuType
 
Enumerator:
EMenuOptions  Options menu launched from the Options softkey.

This is the default value.

EMenuContext  Context sensitive menu that is launched from selection key when the application supports it.
EMenuEdit  Edit menu containing editing specific items.
EMenuOptionsNoTaskSwapper  Options menu launched from the Options softkey.

Task swapper item is not shown.


Constructor & Destructor Documentation

IMPORT_C CEikMenuBar::~CEikMenuBar  ) 
 

Destructor.

IMPORT_C CEikMenuBar::CEikMenuBar  ) 
 

C++ default constructor.


Member Function Documentation

IMPORT_C void CEikMenuBar::ChangeMenuBarL TInt  aHotKeyResourceId = 0,
TInt  aMenuTitleResourceId = 0,
TInt  aDisplayNow = ETrue
 

Not implemented.

Parameters:
aHotKeyResourceId  Not used.
aMenuTitleResourceId  Not used.
aDisplayNow  Not used.
IMPORT_C void CEikMenuBar::ConstructFromResourceL TResourceReader &  aReader  ) 
 

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

Parameters:
aReader  The resource reader.
IMPORT_C void CEikMenuBar::ConstructL MEikMenuObserver *  aMenuObserver,
TInt  aHotKeyResourceId = 0,
TInt  aMenuTitleResourceId = 0
 

Second phase constructor for a menu bar.

Parameters:
aMenuObserver  The menu's observer.
aHotKeyResourceId  The ID of the resource, of type HOTKEY from which the hotkey table is created. This is optional. By default it's nil.
aMenuTitleResourceId  The ID of the resource, of type MENU_BAR from which the menu title array is created. This is optional. By default it's nil.
CEikMenuBar::DECLARE_TYPE_ID 0x101F4106   )  [inline]
 

Specifies the menu item within the menu pane.

Index of a title in the menu bar.

Index of an item in a menu pane.

IMPORT_C void CEikMenuBar::Draw const TRect &  aRect  )  const
 

From CCoeControl.

Not implemented.

Parameters:
Not  used.

Reimplemented from CEikBorderedControl.

IMPORT_C void CEikMenuBar::DrawItem TInt  aItem  )  const
 

Not implemented.

Parameters:
aItem  Not used.
virtual IMPORT_C void CEikMenuBar::FindCommandIdInResourceL TInt  aCommandId,
TInt &  aPaneindex,
TInt &  aItemindex
[virtual]
 

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

Parameters:
aCommandId  The ID to search for.
aPaneindex  Menu pane index.
aItemindex  Menu item index.
virtual IMPORT_C void CEikMenuBar::GetColorUseListL 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.

Parameters:
aColorUseList  The colour list.

Reimplemented from CEikBorderedControl.

IMPORT_C void CEikMenuBar::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

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().

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CEikBorderedControl.

virtual IMPORT_C void CEikMenuBar::HandleResourceChange TInt  aType  )  [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.

Parameters:
aType  A 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.

Reimplemented from CEikBorderedControl.

CEikHotKeyTable* CEikMenuBar::HotKeyTable  )  const [inline]
 

Gets a pointer to the menu’s hot key table.

IMPORT_C TBool CEikMenuBar::IsDisplayed  ) 
 

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

Returns:
Etrue if displayed and EFalse if not.
IMPORT_C CEikMenuPane* CEikMenuBar::MenuPane  ) 
 

Gets a menu pane resource.

Returns:
The pointer to CEikMenuPane object containing a menu pane resource.
IMPORT_C void CEikMenuBar::MoveHighlightToL TInt  aNewSelectedTitle,
TInt  aNewSelectedItem = 0
 

Not implemented.

Parameters:
aNewSelectedTitle  Not used
aNewSelectedItem  Not used.
IMPORT_C TKeyResponse CEikMenuBar::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

From CCoeControl.

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

Parameters:
aKeyEvent  The key event.
aType  The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.
Returns:
Indicates whether or not the key event was used by this control.
IMPORT_C void CEikMenuBar::ReduceRect 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.

Parameters:
[in,out]  aRect  A rectangle that on return is reduced in height by the height of the menu bar.
IMPORT_C void CEikMenuBar::RemoveEditMenuObserver MEikMenuObserver *  aEditMenuObserver  ) 
 

Sets the menu observer interface to NULL.

Parameters:
aEditMenuObserver  Menu observer interface that will be set to NULL.
IMPORT_C TInt CEikMenuBar::SelectedItem  ) 
 

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

Returns:
The index of the selected menu item.
IMPORT_C TInt CEikMenuBar::SelectedTitle  ) 
 

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

Returns:
The index of the selected menu pane.
IMPORT_C void CEikMenuBar::SetContextMenuTitleResourceId TInt  aMenuTitleResourceId  ) 
 
Parameters:
aMenuTitleResourceId 
IMPORT_C void CEikMenuBar::SetEditMenuObserver MEikMenuObserver *  aEditMenuObserver  ) 
 

Sets menu observer interface.

Parameters:
aEditMenuObserver  Menu observer interface.
IMPORT_C CEikHotKeyTable* CEikMenuBar::SetHotKeyTable CEikHotKeyTable aHotKeyTable  ) 
 

Not implemented!

Parameters:
aHotKeyTable  Not used.
Returns:
NULL.
IMPORT_C SCursor CEikMenuBar::SetMenuCursor const SCursor &  aCursor  ) 
 

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

Parameters:
aCursor  The menu pane and menu item to which the cursor is set.
Returns:
A SCursor structure holding the menu item within the menu pane.
IMPORT_C void CEikMenuBar::SetMenuTitleArray CTitleArray aTitleArray  ) 
 

Not implemented.

Parameters:
aTitleArray  Not used.
IMPORT_C void CEikMenuBar::SetMenuTitleResourceId TInt  aMenuTitleResourceId  ) 
 

Sets the menu’s resource ID.

Parameters:
aMenuTitleResourceId  The ID of the resource to use.
IMPORT_C void CEikMenuBar::SetMenuType TMenuType  aMenuType  ) 
 

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.

Parameters:
aMenuType  One of values of CEikMenuBar::TMenuType enumeration.
IMPORT_C void CEikMenuBar::SetTitleArrayOwnedExternally TBool  aOwnedExternally  ) 
 

Not implemented.

Parameters:
aOwnedExternally  Not used.
IMPORT_C void CEikMenuBar::StopDisplayingMenuBar  ) 
 

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.

IMPORT_C CTitleArray* CEikMenuBar::TitleArray  ) 
 

Gets array of information about the menu bar titles.

Returns:
Pointer to CTitleArray object containing array of information about menu bar titles.
IMPORT_C void CEikMenuBar::TryDisplayContextMenuBarL  ) 
 
IMPORT_C void CEikMenuBar::TryDisplayMenuBarL  ) 
 

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.

IMPORT_C void CEikMenuBar::TryDisplayMenuBarWithoutFepMenusL  ) 
 

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.


Friends And Related Function Documentation

friend class CEikMenuBarExtension [friend]
 
friend class CEikMenuPaneTitle [friend]
 

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top