CAknStylusPopUpMenu Class Reference

Link against: eikcoctl.lib


#include <aknstyluspopupmenu.h>

Detailed Description

Stylus specific popup menu.

A floating popup menu which is meant for stylus usage only. The menu appears near to the tapping position. When an item is tapped the menu calls its observer's (iMenuObserver) ProcessCommandL. Typically the observer is application's AppUi. It is then the observer's responsibility to handle the command appropriately. The observer is informed with KErrCancel if the menu is closed without making a selection.

Dll eikcoctl.lib
Since:
S60 v5.0

Public Types

enum   TPositionType { EPositionTypeRightTop = 0, EPositionTypeLeftTop, EPositionTypeRightBottom, EPositionTypeLeftBottom }

Public Member Functions

  ~CAknStylusPopUpMenu ()
  Destructor.
IMPORT_C void  AddMenuItemL (const TDesC &aItem, const TInt aCommandId)
  Adds a menu item.
IMPORT_C void  RemoveMenuItem (const TInt aCommandId)
  Removes a menu item.
IMPORT_C void  SetItemDimmed (const TInt aCommandId, const TBool aDimmed)
  Hides / shows a menu item.
IMPORT_C void  ShowMenu ()
  Shows the stylus popup menu.
IMPORT_C void  SetPosition (const TPoint &aPoint)
  Sets the position of the stylus popup menu.
IMPORT_C void  SetPosition (const TPoint &aPoint, TPositionType aPosType)
  Sets the position of the stylus popup menu.
void  UpdatePosition ()
  Tells the popup menu to recalculate its position.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  Constructs the menu from resource.
IMPORT_C void  HandleControlEventL (CCoeControl *aControl, TCoeEvent aEventType)
  Method to handle events that occur when user selects a menu item.
void  ResetTimer ()
  Resets timer that hides popup.

Static Public Member Functions

static IMPORT_C CAknStylusPopUpMenu NewL (MEikMenuObserver *aObserver, const TPoint &aPoint, CAknPreviewPopUpController *aPopup)
  Two-phased constructor.
static IMPORT_C CAknStylusPopUpMenu NewL (MEikMenuObserver *aObserver, const TPoint &aPoint)
  Two-phased constructor.
static IMPORT_C CAknStylusPopUpMenu NewLC (MEikMenuObserver *aObserver, const TPoint &aPoint, CAknPreviewPopUpController *aPopup)
  Two-phased constructor.

Member Enumeration Documentation

enum CAknStylusPopUpMenu::TPositionType
 
Enumerator:
EPositionTypeRightTop 
EPositionTypeLeftTop 
EPositionTypeRightBottom 
EPositionTypeLeftBottom 

Constructor & Destructor Documentation

CAknStylusPopUpMenu::~CAknStylusPopUpMenu  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CAknStylusPopUpMenu::AddMenuItemL const TDesC &  aItem,
const TInt  aCommandId
 

Adds a menu item.

If the menu contains maximum amount of items, the function will do nothing. Inserted item will be placed last.

Parameters:
aItem  The menu item to be added.
aCommandId  Item's command id.
IMPORT_C void CAknStylusPopUpMenu::ConstructFromResourceL TResourceReader &  aReader  ) 
 

Constructs the menu from resource.

Parameters:
aReader  Resource reader.
IMPORT_C void CAknStylusPopUpMenu::HandleControlEventL CCoeControl *  aControl,
TCoeEvent  aEventType
 

Method to handle events that occur when user selects a menu item.

Parameters:
aControl  The control that sent the event.
aEventType  The event type.
static IMPORT_C CAknStylusPopUpMenu* CAknStylusPopUpMenu::NewL MEikMenuObserver *  aObserver,
const TPoint &  aPoint
[static]
 

Two-phased constructor.

Parameters:
aObserver  Menu observer (not owned) that handles stylus popup events.
aPoint  The position where stylus was tapped
static IMPORT_C CAknStylusPopUpMenu* CAknStylusPopUpMenu::NewL MEikMenuObserver *  aObserver,
const TPoint &  aPoint,
CAknPreviewPopUpController aPopup
[static]
 

Two-phased constructor.

Parameters:
aObserver  Menu observer (not owned) that handles stylus popup events.
aPoint  The position where stylus was tapped
aPopup  Preview popup from which stylus popup menu was launched, can be NULL.
static IMPORT_C CAknStylusPopUpMenu* CAknStylusPopUpMenu::NewLC MEikMenuObserver *  aObserver,
const TPoint &  aPoint,
CAknPreviewPopUpController aPopup
[static]
 

Two-phased constructor.

Parameters:
aObserver  Menu observer (not owned) that handles stylus popup events.
aPoint  The position where stylus was tapped
aPopup  Preview popup from which stylus popup menu was launched, can be NULL.
IMPORT_C void CAknStylusPopUpMenu::RemoveMenuItem const TInt  aCommandId  ) 
 

Removes a menu item.

Parameters:
aCommandId  Command id of the item to be removed.
void CAknStylusPopUpMenu::ResetTimer  ) 
 

Resets timer that hides popup.

IMPORT_C void CAknStylusPopUpMenu::SetItemDimmed const TInt  aCommandId,
const TBool  aDimmed
 

Hides / shows a menu item.

Parameters:
aCommandId  Command id of the item to be hidden / shown.
aDimmed  ETrue to hide item and EFalse to show item
IMPORT_C void CAknStylusPopUpMenu::SetPosition const TPoint &  aPoint,
TPositionType  aPosType
 

Sets the position of the stylus popup menu.

Position will be adjusted if the menu doesn't fit on the screen properly.

Parameters:
aPoint  Position of the stylus popup menu.
aPosType  Position type e.g. left-top corner or right-top corner
IMPORT_C void CAknStylusPopUpMenu::SetPosition const TPoint &  aPoint  ) 
 

Sets the position of the stylus popup menu.

Position will be adjusted if the menu doesn't fit on the screen properly.

Parameters:
aPoint  Position of the left-top corner of the stylus popup menu.
IMPORT_C void CAknStylusPopUpMenu::ShowMenu  ) 
 

Shows the stylus popup menu.

If it's already visible, nothing happens.

void CAknStylusPopUpMenu::UpdatePosition  ) 
 

Tells the popup menu to recalculate its position.

This can be used e.g. after layout transition.


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

Copyright © Nokia Corporation 2001-2007
Back to top