CAknPopupList Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <aknpopup.h>

Inherits CEikBorderedControl, MEikListBoxObserver, MAknIntermediateState, and MAknFadedComponent.

Inherited by CAknGMSPopupGrid.


Detailed Description

Used to popup a list or grid.

Takes an existing listbox control and puts it into a popup frame together with an optional title.

CAknPopupList is not a dialog!

There are two standard usages of CAknPopupList:

  CAknPopupList *plist = CAknPopupList::NewL(...);
  CleanupStack::PushL(plist);
  ...
  TInt popupOk = plist->ExecuteLD(...);
  // No leaving functions allowed between ExecuteLD and
  // CleanupStack::Pop().
  CleanupStack::Pop(); // plist
  if (popupOk) { ... } else { ... } 

And then another way:

  iPList = CAknPopupList::NewL(...);
  ...
  TInt popupOk = iPlist->ExecuteLD(...);
  // No leaving functions allowed between ExecuteLD and iPlist=NULL;
  iPlist = NULL;
  if (popupOk) {... } else {... }
  // note, destructor deletes the iPlist instance.

Both these work corretly and leave-safe way. Notice this usage is pretty different of how dialogs work. With dialogs you _always_ want to do CleanupStack::Pop() before calling ExecuteLD().


Public Member Functions

IMPORT_C TBool  ExecuteLD ()
  Executes the pop-up selection list.
IMPORT_C void  SetTitleL (const TDesC &aTitle)
  Sets the title for the selection list.
IMPORT_C void  CancelPopup ()
  Cancels the current popup.
IMPORT_C CEikButtonGroupContainer ButtonGroupContainer ()
  Gets a button group container.
IMPORT_C CAknPopupHeadingPane Heading ()
  Gets the popup header.
IMPORT_C CAknPopupHeadingPane Heading () const
  Gets the popup header.
IMPORT_C CEikListBox ListBox ()
  Gets the list box.
IMPORT_C void  SetMaximumHeight (TInt aItems)
  Sets the maximum height for the popup frame.
IMPORT_C TBool  EnableFind (TBool aEnable=ETrue)
  Enables the findbox of the popup list.
IMPORT_C CAknSearchField FindBox () const
  Gets the search field control.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Static Public Member Functions

static IMPORT_C CAknPopupList NewL (CEikListBox *aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType=AknPopupLayouts::EMenuWindow)
  Two-phased constructor.

Protected Member Functions

IMPORT_C void  ProcessCommandL (TInt aCommandId)
  From MEikCommandObserver.
IMPORT_C void  HandleListBoxEventL (CEikListBox *aListBox, TListBoxEvent aEventType)
  From MEikListBoxObserver.
IMPORT_C void  HandleControlEventL (CCoeControl *aControl, TCoeEvent aEventType)
  From MCoeControlObserver.
IMPORT_C  CAknPopupList ()
  C++ default constructor.
IMPORT_C  ~CAknPopupList ()
  Destructor.
IMPORT_C void  ConstructL (CEikListBox *aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType)
  Handles 2nd phase construction.
virtual IMPORT_C void  AttemptExitL (TBool aAccept)
  Called when the user accepts or cancels the listbox.
virtual IMPORT_C void  SetupWindowLayout (AknPopupLayouts::TAknPopupLayouts aType)
  Setup the whole window layout; window position, grid and heading position, shadow for the window.
IMPORT_C CEikListBox ListBox () const
  Returns the listbox being used.
IMPORT_C const TAknPopupWindowLayoutDef Layout () const
  Gets the layout definitions for the popup list.
IMPORT_C TAknPopupWindowLayoutDef Layout ()
  Gets the layout definitions for the popup list.
IMPORT_C TTypeUid::Ptr  MopSupplyObject (TTypeUid aId)
  From MopSupplyObject.
IMPORT_C void  HandleResourceChange (TInt aType)
  From CCoeControl.
IMPORT_C void  FadeBehindPopup (TBool aFade)

Protected Attributes

CEikListBox iListBox
CEikButtonGroupContainer iPopoutCba
  A button group container - a wrapper around the different button arrays.
CAknPopupHeadingPane iTitle
  Header control for queries.
TBool *  iReturn
  The address to hold the return value from the popup.
TBool  iMarkable
TInt  iCurrentResource
AknPopupLayouts::TAknPopupLayouts  iWindowType
  Popup layout type.
TAknPopupWindowLayoutDef  iLayout
  collects all LAF specification lines that are needed for popup window.
TBool  iAppBroughtForwards
TAknPopupFader  iPopupFader
CIdle *  iIdle
CActiveSchedulerWait  iWait

Constructor & Destructor Documentation

IMPORT_C CAknPopupList::CAknPopupList  )  [protected]
 

C++ default constructor.

IMPORT_C CAknPopupList::~CAknPopupList  )  [protected]
 

Destructor.


Member Function Documentation

virtual IMPORT_C void CAknPopupList::AttemptExitL TBool  aAccept  )  [protected, virtual]
 

Called when the user accepts or cancels the listbox.

Parameters:
aAccept  ETrue if the user has accepted, EFalse if the user has cancelled the listbox.
IMPORT_C CEikButtonGroupContainer* CAknPopupList::ButtonGroupContainer  ) 
 

Gets a button group container.

Returns:
The button group.
IMPORT_C void CAknPopupList::CancelPopup  ) 
 

Cancels the current popup.

The popup ExecuteLD will return with EFalse.

IMPORT_C void CAknPopupList::ConstructL CEikListBox aListBox,
TInt  aCbaResource,
AknPopupLayouts::TAknPopupLayouts  aType
[protected]
 

Handles 2nd phase construction.

Parameters:
aListBox  Pre-existing listbox-derived class.
aCbaResource  Softkey pane to display while pop-up is active.
aType  The layout used.
IMPORT_C TBool CAknPopupList::EnableFind TBool  aEnable = ETrue  ) 
 

Enables the findbox of the popup list.

Parameters:
aEnable  Enables (default) or disables the findbox.
Returns:
ETrue if enabling/disabling was successfull.
IMPORT_C TBool CAknPopupList::ExecuteLD  ) 
 

Executes the pop-up selection list.

Function returns when the user have accepted or cancelled the pop-up.

Returns:
ETrue if the popup was accepted. EFalse if the popup was cancelled.
IMPORT_C void CAknPopupList::FadeBehindPopup TBool  aFade  )  [protected]
 
IMPORT_C CAknSearchField* CAknPopupList::FindBox  )  const
 

Gets the search field control.

Returns:
Search field control.
IMPORT_C void CAknPopupList::HandleControlEventL CCoeControl *  aControl,
TCoeEvent  aEventType
[protected]
 

From MCoeControlObserver.

Handles an event from an observed control.

Parameters:
aControl  Control being observed.
aEventType  Event observed.
IMPORT_C void CAknPopupList::HandleListBoxEventL CEikListBox aListBox,
TListBoxEvent  aEventType
[protected]
 

From MEikListBoxObserver.

Processes key events from the listbox. Responds to EEventEnterKeyPressed to accept the pop-up.

Parameters:
aListBox  Listbox being observed.
aEventType  Event being observed.
IMPORT_C void CAknPopupList::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events of popups.

Parameters:
aPointerEvent  Pointer event to be handled.

Reimplemented from CEikBorderedControl.

Reimplemented in CAknGMSPopupGrid.

IMPORT_C void CAknPopupList::HandleResourceChange TInt  aType  )  [protected]
 

From CCoeControl.

Handles a change to the control's resources.

Parameters:
aType  A message UID value.

Reimplemented from CEikBorderedControl.

IMPORT_C CAknPopupHeadingPane* CAknPopupList::Heading  )  const
 

Gets the popup header.

Returns:
Header properties of the pop-up menu.
IMPORT_C CAknPopupHeadingPane* CAknPopupList::Heading  ) 
 

Gets the popup header.

Returns:
Header properties of the pop-up menu.
IMPORT_C TAknPopupWindowLayoutDef& CAknPopupList::Layout  )  [protected]
 

Gets the layout definitions for the popup list.

Returns:
Collects all LAF specification lines that are needed for popup windows.
IMPORT_C const TAknPopupWindowLayoutDef& CAknPopupList::Layout  )  const [protected]
 

Gets the layout definitions for the popup list.

Returns:
Collects all LAF specification lines that are needed for popup windows.
IMPORT_C CEikListBox* CAknPopupList::ListBox  )  const [protected]
 

Returns the listbox being used.

Returns:
Listbox contained in the pop-up.
IMPORT_C CEikListBox* CAknPopupList::ListBox  ) 
 

Gets the list box.

Returns:
The list box.
IMPORT_C TTypeUid::Ptr CAknPopupList::MopSupplyObject TTypeUid  aId  )  [protected]
 

From MopSupplyObject.

Retrieves an object of the same type as that encapsulated in aId.

Parameters:
aId  Encapsulated object type ID.
Returns:
Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.
static IMPORT_C CAknPopupList* CAknPopupList::NewL CEikListBox aListBox,
TInt  aCbaResource,
AknPopupLayouts::TAknPopupLayouts  aType = AknPopupLayouts::EMenuWindow
[static]
 

Two-phased constructor.

Creates the pop-up list.

Parameters:
aListBox  Pre-existing listbox-derived class.
aCbaResource  Softkey pane to display while pop-up is active.
aType  The layout used.
Returns:
A pointer to a pop-up list object.

Reimplemented in CAknGMSPopupGrid.

IMPORT_C void CAknPopupList::ProcessCommandL TInt  aCommandId  )  [protected]
 

From MEikCommandObserver.

Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack to accept or cancel the pop-up.

Parameters:
aCommandId  Event Id from the soft-key.
IMPORT_C void CAknPopupList::SetMaximumHeight TInt  aItems  ) 
 

Sets the maximum height for the popup frame.

Parameters:
aItems  The maximum height.
IMPORT_C void CAknPopupList::SetTitleL const TDesC &  aTitle  ) 
 

Sets the title for the selection list.

Parameters:
aTitle  Title to be displayed.
virtual IMPORT_C void CAknPopupList::SetupWindowLayout AknPopupLayouts::TAknPopupLayouts  aType  )  [protected, virtual]
 

Setup the whole window layout; window position, grid and heading position, shadow for the window.

Parameters:
aType  A choice of layout.

Reimplemented in CAknGMSPopupGrid.


Field Documentation

TBool CAknPopupList::iAppBroughtForwards [protected]
 
TInt CAknPopupList::iCurrentResource [protected]
 
CIdle* CAknPopupList::iIdle [protected]
 
TAknPopupWindowLayoutDef CAknPopupList::iLayout [protected]
 

collects all LAF specification lines that are needed for popup window.

CEikListBox* CAknPopupList::iListBox [protected]
 
TBool CAknPopupList::iMarkable [protected]
 
CEikButtonGroupContainer* CAknPopupList::iPopoutCba [protected]
 

A button group container - a wrapper around the different button arrays.

TAknPopupFader CAknPopupList::iPopupFader [protected]
 
TBool* CAknPopupList::iReturn [protected]
 

The address to hold the return value from the popup.

CAknPopupHeadingPane* CAknPopupList::iTitle [protected]
 

Header control for queries.

Defines properties of the header of the pop-up menu.

CActiveSchedulerWait CAknPopupList::iWait [protected]
 
AknPopupLayouts::TAknPopupLayouts CAknPopupList::iWindowType [protected]
 

Popup layout type.


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

Copyright © Nokia Corporation 2001-2008
Back to top