CAknItemActionMenu Class Reference

class CAknItemActionMenu : public CBase

Item action menu.

Classes implementing MAknCollection interface can launch item specific action menu using this class. Item specific commands are fetched from the current menu bar and handled like any other options menu commands.

Collections that wish to use item action menu should register themselves using static call RegisterCollectionL. This call returns pointer to item action menu instance (ownership does not transfer to caller). Pointer to item action menu can be used to launch the menu. When there is no need for item action menu usage in collection anymore, collection should be removed with method RemoveCollection.

Simplified example:
 // Initialization (NOTE: ownership does not transfer!) 
 iItemActionMenu = CAknItemActionMenu::RegisterCollectionL( *this );
 
 // Show menu
 if ( iItemActionMenu->InitMenuL() )
     {
     iItemActionMenu->ShowMenuL( position );
     }
 
 // Remove collection
 iItemActionMenu->RemoveCollection( *this );

eikcoctl S60 v5.2

Inherits from

Public Member Functions
~CAknItemActionMenu()
voidAddCollectionStateL(MAknCollection &)
IMPORT_C voidCollectionChanged(MAknCollection &)
TInt CollectionCount()
TBool CollectionHighlightVisible()
TBool CollectionSoftkeyVisible(TBool)
IMPORT_C TBoolInitMenuL()
CAknItemActionMenuData &MenuData()
CAknItemActionMenu *NewL(MAknCollection &, MObjectProvider *)
CAknItemActionMenu *NewLC(MAknCollection &, MObjectProvider *)
MObjectProvider *Owner()
IMPORT_C CAknItemActionMenu *RegisterCollectionL(MAknCollection &)
voidRegisterCollectionObserverL(MAknCollectionObserver &)
IMPORT_C voidRemoveCollection(MAknCollection &)
voidRemoveCollectionObserver(MAknCollectionObserver &)
voidSetMenuBar(MEikMenuObserver *, CEikMenuBar *)
IMPORT_C voidShowMenuL(const TPoint &, TUint)
Private Member Functions
CAknItemActionMenu(MObjectProvider *)
voidConstructL(MAknCollection &)
TInt LaunchSubMenuQueryL(const TDesC &)
voidNotifyChangeToActiveObserver(TBool)
voidProcessCommandL(TInt)
voidSetEmphasis(CCoeControl *, TBool)
voidUnregisterMenu()
Inherited Functions
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()
Private Attributes
CEikMenuBar *iMenuBar
MEikMenuObserver *iMenuBarObserver
CAknItemActionMenuData *iMenuData
CEikMenuPane *iMenuPane
RPointerArray< MAknCollectionObserver >iObservers
MObjectProvider *iOwner
CAknStylusPopUpMenu *iPopupMenu
TBool iProcessingCommand
RPointerArray< MAknCollection >iStates

Constructor & Destructor Documentation

CAknItemActionMenu(MObjectProvider *)

CAknItemActionMenu(MObjectProvider *aOwner)[private]

C++ constructor.

Parameters

MObjectProvider * aOwnerMenu's owner.

~CAknItemActionMenu()

~CAknItemActionMenu()[virtual]

Destructor.

Member Functions Documentation

AddCollectionStateL(MAknCollection &)

voidAddCollectionStateL(MAknCollection &aCollection)

Adds collection to this item action menu.

Parameters

MAknCollection & aCollectionNew collection.

CollectionChanged(MAknCollection &)

IMPORT_C voidCollectionChanged(MAknCollection &aCollection)

Notifies that collection has been changed.

Parameters

MAknCollection & aCollectionChanged collection.

CollectionCount()

TInt CollectionCount()const

Provides item action menu collection count.

CollectionHighlightVisible()

TBool CollectionHighlightVisible()const

Provides collection highlight state.

CollectionSoftkeyVisible(TBool)

TBool CollectionSoftkeyVisible(TBoolaVisibleCollection = ETrue)const

Provides collection softkey state.

Parameters

TBool aVisibleCollection = ETrue

ConstructL(MAknCollection &)

voidConstructL(MAknCollection &aCollection)[private]

Symbian second-phase constructor.

Parameters

MAknCollection & aCollectionCollection.

InitMenuL()

IMPORT_C TBoolInitMenuL()

Initializes this item action menu. Menu should be initialized before it can be shown with ShowMenuL.

ETrue if item action menu has content. EFalse otherwise.

LaunchSubMenuQueryL(const TDesC &)

TInt LaunchSubMenuQueryL(const TDesC &aHeading)[private]

Fills query dialog with menu data and launches it.

Selected menu data index.

Parameters

const TDesC & aHeadingDialog heading.

MenuData()

CAknItemActionMenuData &MenuData()

Provides reference to this item action menu data.

Reference to item action menu data.

NewL(MAknCollection &, MObjectProvider *)

CAknItemActionMenu *NewL(MAknCollection &aCollection,
MObjectProvider *aOwner
)[static]

Two-phased constructor.

Parameters

MAknCollection & aCollection
MObjectProvider * aOwner

NewLC(MAknCollection &, MObjectProvider *)

CAknItemActionMenu *NewLC(MAknCollection &aCollection,
MObjectProvider *aOwner
)[static]

Two-phased constructor.

Parameters

MAknCollection & aCollection
MObjectProvider * aOwner

NotifyChangeToActiveObserver(TBool)

voidNotifyChangeToActiveObserver(TBoolaCollectionVisible = ETrue)[private]

Notifies collection change to active observer.

Parameters

TBool aCollectionVisible = ETrueETrue if collection that changed is visible.

Owner()

MObjectProvider *Owner()const

Returns pointer to item action menu's owner.

Menu's owner

ProcessCommandL(TInt)

voidProcessCommandL(TIntaCommandId)[private]

Processes user commands.

Parameters

TInt aCommandIdID of the command to respond to.

RegisterCollectionL(MAknCollection &)

IMPORT_C CAknItemActionMenu *RegisterCollectionL(MAknCollection &aCollection)[static]

Adds collection to the item action menu of this view / dialog / appUi.

Pointer to the item action menu instance. Ownership does not transfer to caller.

Parameters

MAknCollection & aCollectionCollection implementing MAknCollection interface.

RegisterCollectionObserverL(MAknCollectionObserver &)

voidRegisterCollectionObserverL(MAknCollectionObserver &aObserver)

Registers collection observer.

Parameters

MAknCollectionObserver & aObserver

RemoveCollection(MAknCollection &)

IMPORT_C voidRemoveCollection(MAknCollection &aCollection)

Removes collection of this item action menu.

Parameters

MAknCollection & aCollectionCollection to be removed.

RemoveCollectionObserver(MAknCollectionObserver &)

voidRemoveCollectionObserver(MAknCollectionObserver &aObserver)

Removes collection observer.

Parameters

MAknCollectionObserver & aObserver

SetEmphasis(CCoeControl *, TBool)

voidSetEmphasis(CCoeControl *aMenuControl,
TBoolaEmphasis
)[private]

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

Parameters

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

SetMenuBar(MEikMenuObserver *, CEikMenuBar *)

voidSetMenuBar(MEikMenuObserver *aMenuObserver,
CEikMenuBar *aMenuBar
)

Sets menu bar to item action menu.

Parameters

MEikMenuObserver * aMenuObserver
CEikMenuBar * aMenuBar

ShowMenuL(const TPoint &, TUint)

IMPORT_C voidShowMenuL(const TPoint &aPosition,
TUintaFlags = 0
)

Shows this item action menu.

Parameters

const TPoint & aPositionMenu position relative to screen.
TUint aFlags = 0Flags - not used.

UnregisterMenu()

voidUnregisterMenu()[private]

Unregisters item action menu

Member Data Documentation

CEikMenuBar * iMenuBar

CEikMenuBar *iMenuBar[private]

Menu bar. Not own.

MEikMenuObserver * iMenuBarObserver

MEikMenuObserver *iMenuBarObserver[private]

Menu bar observer. Not own.

CAknItemActionMenuData * iMenuData

CAknItemActionMenuData *iMenuData[private]

Menu data. Own.

CEikMenuPane * iMenuPane

CEikMenuPane *iMenuPane[private]

Menu pane. Own.

RPointerArray< MAknCollectionObserver > iObservers

RPointerArray< MAknCollectionObserver >iObservers[private]

Collection observers.

MObjectProvider * iOwner

MObjectProvider *iOwner[private]

Pointer to menu's owner. Not own

CAknStylusPopUpMenu * iPopupMenu

CAknStylusPopUpMenu *iPopupMenu[private]

Menu control. Own.

TBool iProcessingCommand

TBool iProcessingCommand[private]

Boolean ensuring that item action menu is not unregistered during command processing.

RPointerArray< MAknCollection > iStates

RPointerArray< MAknCollection >iStates[private]

Collections.