CAknPopupField Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <aknpopupfield.h>

Inherits CEikBorderedControl, and MEikListBoxObserver.

Inherited by CAknPopupFieldText.


Detailed Description

Represents a combo box type control, used to implement the Series 60 pop-up field.

Public Types

enum   EAknPopupFieldSelectionMode { EAknPopupFieldLabelMode, EAknPopupFieldSelectionListMode }
  Selection mode of the popup field. More...
enum   EAknFormMode {
  EAknFormModeView, EAknFormModeEdit, EAknFormModeViewWideWithGraphic, EAknFormModeViewWideWithoutGraphic,
  EAknFormModeEditWideWithGraphic, EAknFormModeEditWideWithoutGraphic
}
  Form mode for the popup field. More...

Public Member Functions

EAknPopupFieldSelectionMode  SelectionMode () const
EAknFormMode  FormMode () const
IMPORT_C  CAknPopupField ()
  C++ default constructor.
IMPORT_C  ~CAknPopupField ()
  Destructor.
IMPORT_C void  ConstructL ()
  Handles 2nd phase construction.
IMPORT_C void  SetAllowsUserDefinedEntry (TBool aAllows)
  Sets a flag that enables user defined entry.
IMPORT_C void  ActivateSelectionListL ()
  Causes a list of pre-defined values to appear.
IMPORT_C void  SetQueryValueL (MAknQueryValue *aValue)
  Used by the client to set the query value.
IMPORT_C void  SetFont (const CFont *aFont)
  Sets the font of the contained label.
IMPORT_C void  SetShowIndicatorsL (TBool aShowIndicators)
  Sets a flag that determines whether the indicators are shown.
IMPORT_C TInt  NumLines () const
  Number of lines used.
IMPORT_C void  SetPopupFieldObserver (MAknPopupFieldObserver *aObserver)
  Sets an observer of this class to receive events from popup field.
IMPORT_C void  SetEmptyListNoteL (TInt aResourceId, CAknNoteDialog::TTimeout aTimeout=CAknNoteDialog::EShortTimeout, CAknNoteDialog::TTone aTone=CAknNoteDialog::ENoTone)
  Sets the note to be displayed when the selection list has no items available.
IMPORT_C void  SetEmptyTextL (const TDesC &aEmptyText)
  Sets the empty list note text.
IMPORT_C void  SetOtherTextL (const TDesC &aOtherText)
  Sets the text to be added to the bottom of the array to enter user defined data.
IMPORT_C void  SetInvalidTextL (const TDesC &aInvalidText)
  Sets the text for view state when none of the elements in the list are available.
IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  From CCoeControl.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  From CCoeControl.
IMPORT_C TSize  MinimumSize ()
  From CCoeControl.
IMPORT_C void  HandleResourceChange (TInt aType)
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.
IMPORT_C void  SetMaxNumberOfLinesPermitted (TInt aMaxNoLines)
  /** Sets the maximium number of lines that can be displayed.
IMPORT_C void  SetFormFieldRect (TRect aFormFieldRect)
  Sets a form field rectangle so that a popup field can correctly position the label.

Protected Member Functions

IMPORT_C void  HandleControlEventL (CCoeControl *aControl, TCoeEvent aEvent)
  From MCoeControlObserver.
IMPORT_C void  ProcessCommandL (TInt aCommandId)
  From MEikCommandObserver.
IMPORT_C void  HandleListBoxEventL (CEikListBox *aListBox, TListBoxEvent aEventType)
  From MEikListBoxObserver.
IMPORT_C TInt  CountComponentControls () const
  From CCoeControl.
IMPORT_C CCoeControl *  ComponentControl (TInt aIndex) const
  From CCoeControl.
IMPORT_C void  SizeChanged ()
  From CCoeControl.
IMPORT_C void  FocusChanged (TDrawNow aDrawNow)
  From CCoeControl.
IMPORT_C void  Draw (const TRect &aRect) const
  From CEikBorderedControl.
void  CommonConstructL ()
  Construction tasks common to both a normal construction and a construction from a resource.
IMPORT_C TTypeUid::Ptr  MopSupplyObject (TTypeUid aId)
  From CCoeControl.

Protected Attributes

CEikLabel iLabel
  Label of the popup field.
CAknPopupFieldBitmapButton iButton
  Bitmap button for the popup field.
CAknFormGraphicStyleListBox iSelectionList
  List box for the popup field usage.
CAknListBoxLayoutDecorator iLayoutDecorator
  Contains a popup field selection array and a leading text that will be inserted before the text from the descriptor array entry.
CEikButtonGroupContainer iCba
  Button group container for the popup field.
CAsyncCallBack *  iAttemptExitAsync
  Active object for calling AttemptExitCallbackL asynchronously.
TInt  iFlags
  Flags for the popup field.
TInt  iWidth
  Maximum line width.
HBufC *  iOtherText
  Text to the bottom of the selection array.
HBufC *  iEmptyText
  The empty list note text.
HBufC *  iInvalidText
  The invalid text.
TInt  iEmptyNoteResourceId
  Resource id for the empty note.
MAknQueryValue iValue
  Query value for the popup field.
MAknPopupFieldObserver iObserver
  Observer for receiving events from the popup field.
EAknFormMode  iFormMode
  Enumeration representing form mode values.
CAknNoteDialog::TTimeout  iEmptyNoteTimeout
  Timeout for the empty tone.
CAknNoteDialog::TTone  iEmptyNoteTone
  Tone for the empty note.
TAknDesCArrayDecorator  iDecorator
  Selection array for the popup field.
EAknPopupFieldSelectionMode  iSelectionMode
  Enumeration representing selection mode values.
TInt  iMaxNoLines
  Maximum number of items in selection array.

Data Structures

class   CAknPopupFieldBitmapButton
  Specialises bitmap button to make the layout correct for popup field. More...

Member Enumeration Documentation

enum CAknPopupField::EAknFormMode
 

Form mode for the popup field.

Enumerator:
EAknFormModeView  View mode.
EAknFormModeEdit  Editable mode.
EAknFormModeViewWideWithGraphic  View mode with graphic.
EAknFormModeViewWideWithoutGraphic  View mode without graphic.
EAknFormModeEditWideWithGraphic  Edit mode with graphic.
EAknFormModeEditWideWithoutGraphic  Edit mode without graphic.
enum CAknPopupField::EAknPopupFieldSelectionMode
 

Selection mode of the popup field.

Enumerator:
EAknPopupFieldLabelMode  Label mode.

In Label mode popup field is minimized and popup field looks identical to a list item. When it receives the selection key press it is changed to EAknPopupFieldSelectionListMode and the pre-defined list is displayed.

EAknPopupFieldSelectionListMode  Selection list mode.

In this selection mode pre-defined popup selection list is displayed.


Constructor & Destructor Documentation

IMPORT_C CAknPopupField::CAknPopupField  ) 
 

C++ default constructor.

IMPORT_C CAknPopupField::~CAknPopupField  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CAknPopupField::ActivateSelectionListL  ) 
 

Causes a list of pre-defined values to appear.

Use this method to activate the pop-up field from a menu option command. Note that the desired control must be focused on before it can be activated.

void CAknPopupField::CommonConstructL  )  [protected]
 

Construction tasks common to both a normal construction and a construction from a resource.

Used from ConstructL() and ConstructFromResourceL().

IMPORT_C CCoeControl* CAknPopupField::ComponentControl TInt  aIndex  )  const [protected]
 

From CCoeControl.

Gets an indexed component of a compound control.

Parameters:
aIndex  Control index.
Returns:
The component control with an index of aIndex.
IMPORT_C void CAknPopupField::ConstructFromResourceL TResourceReader &  aReader  ) 
 

From CCoeControl.

Constructs the control from a resource file.

Parameters:
aReader  The resource reader pointing to the popup field resource.

Reimplemented in CAknPopupFieldText.

IMPORT_C void CAknPopupField::ConstructL  ) 
 

Handles 2nd phase construction.

IMPORT_C TInt CAknPopupField::CountComponentControls  )  const [protected]
 

From CCoeControl.

Gets the number of controls contained in a compound control.

Returns:
The number of component controls contained by this control.
IMPORT_C void CAknPopupField::Draw const TRect &  aRect  )  const [protected]
 

From CEikBorderedControl.

Called by the framework to draw the control.

Parameters:
aRect  Rectangle in which the Cone framework believes drawing is needed.

Reimplemented from CEikBorderedControl.

IMPORT_C void CAknPopupField::FocusChanged TDrawNow  aDrawNow  )  [protected]
 

From CCoeControl.

Responds to a change in focus.

Parameters:
aDrawNow  Contains the value that was passed to it by SetFocus().
EAknFormMode CAknPopupField::FormMode  )  const [inline]
 
IMPORT_C void CAknPopupField::HandleControlEventL CCoeControl *  aControl,
TCoeEvent  aEvent
[protected]
 

From MCoeControlObserver.

Handles an event from an observed control.

Parameters:
aControl  The control that sent the event.
aEvent  The event type.
IMPORT_C void CAknPopupField::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 observed.
IMPORT_C void CAknPopupField::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events of popup field list.

Parameters:
aPointerEvent  The pointer event to be handled.

Reimplemented from CEikBorderedControl.

Reimplemented in CAknPopupFieldText.

IMPORT_C void CAknPopupField::HandleResourceChange TInt  aType  ) 
 

From CCoeControl.

Handles a change to the control's resources.

Parameters:
aType  The type of the resource change.

Reimplemented from CEikBorderedControl.

IMPORT_C TSize CAknPopupField::MinimumSize  ) 
 

From CCoeControl.

Determines the minimum size of the control.

Returns:
The minimum size required by the control.
IMPORT_C TTypeUid::Ptr CAknPopupField::MopSupplyObject TTypeUid  aId  )  [protected]
 

From CCoeControl.

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

Parameters:
aId  An encapsulated object type ID.
Returns:
Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.
IMPORT_C TInt CAknPopupField::NumLines  )  const
 

Number of lines used.

Returns:
Number of entries on the selection list. If selection list is not active, 1 is returned. NOTE that the number is limited by KAknMaxEditorLines.
IMPORT_C TKeyResponse CAknPopupField::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

From CCoeControl.

Handles key events.

Parameters:
aKeyEvent  The key event.
aType  The type of key event.
Returns:
Indicates whether or not the key event was used by this control.
IMPORT_C void CAknPopupField::ProcessCommandL TInt  aCommandId  )  [protected]
 

From MEikCommandObserver.

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

Parameters:
aCommandId  Event Id from the soft-key.
EAknPopupFieldSelectionMode CAknPopupField::SelectionMode  )  const [inline]
 
IMPORT_C void CAknPopupField::SetAllowsUserDefinedEntry TBool  aAllows  ) 
 

Sets a flag that enables user defined entry.

Note that flag can also be set from resources, but this method allows behaviour to be changed at runtime.

Parameters:
aAllows  if ETrue sets a flag.
IMPORT_C void CAknPopupField::SetEmptyListNoteL TInt  aResourceId,
CAknNoteDialog::TTimeout  aTimeout = CAknNoteDialog::EShortTimeout,
CAknNoteDialog::TTone  aTone = CAknNoteDialog::ENoTone
 

Sets the note to be displayed when the selection list has no items available.

Parameters:
aResourceId  Resource id for the note.
aTimeout  = CAknNoteDialog::EShortTimeout Timeout for the note.
aTone  = CAknNoteDialog::ENoTone Tone for the note.
IMPORT_C void CAknPopupField::SetEmptyTextL const TDesC &  aEmptyText  ) 
 

Sets the empty list note text.

This note is displayed when the selection list has no items available.

Parameters:
aEmptyText  The empty list note text.
IMPORT_C void CAknPopupField::SetFont const CFont *  aFont  ) 
 

Sets the font of the contained label.

Parameters:
aFont  Font definition used to set the font of the contained label.
IMPORT_C void CAknPopupField::SetFormFieldRect TRect  aFormFieldRect  ) 
 

Sets a form field rectangle so that a popup field can correctly position the label.

Parameters:
aFormFieldRect  The form field rectangle.
IMPORT_C void CAknPopupField::SetInvalidTextL const TDesC &  aInvalidText  ) 
 

Sets the text for view state when none of the elements in the list are available.

Parameters:
aInvalidText  The invalid text.
IMPORT_C void CAknPopupField::SetMaxNumberOfLinesPermitted TInt  aMaxNoLines  ) 
 

/** Sets the maximium number of lines that can be displayed.

Parameters:
aMaxNoLines  The maximum number of lines.
IMPORT_C void CAknPopupField::SetOtherTextL const TDesC &  aOtherText  ) 
 

Sets the text to be added to the bottom of the array to enter user defined data.

Parameters:
aOtherText  Text to the bottom of the selection array.
IMPORT_C void CAknPopupField::SetPopupFieldObserver MAknPopupFieldObserver aObserver  ) 
 

Sets an observer of this class to receive events from popup field.

Parameters:
aObserver  Pointer to the class that implements the observer interface.
IMPORT_C void CAknPopupField::SetQueryValueL MAknQueryValue aValue  ) 
 

Used by the client to set the query value.

It is used to represent the user defined query value in this popup field control.

Parameters:
aValue  Pointer to query value, ownership is not passed.
IMPORT_C void CAknPopupField::SetShowIndicatorsL TBool  aShowIndicators  ) 
 

Sets a flag that determines whether the indicators are shown.

In practice the indicators have the appearance of radio buttons.

Parameters:
aShowIndicators  If ETrue, indicators are displayed.
IMPORT_C void CAknPopupField::SizeChanged  )  [protected]
 

From CCoeControl.

Responds to changes to the size and position of the contents of this control.


Field Documentation

CAsyncCallBack* CAknPopupField::iAttemptExitAsync [protected]
 

Active object for calling AttemptExitCallbackL asynchronously.

Own.

CAknPopupFieldBitmapButton* CAknPopupField::iButton [protected]
 

Bitmap button for the popup field.

Own.

CEikButtonGroupContainer* CAknPopupField::iCba [protected]
 

Button group container for the popup field.

Own.

TAknDesCArrayDecorator CAknPopupField::iDecorator [protected]
 

Selection array for the popup field.

TInt CAknPopupField::iEmptyNoteResourceId [protected]
 

Resource id for the empty note.

CAknNoteDialog::TTimeout CAknPopupField::iEmptyNoteTimeout [protected]
 

Timeout for the empty tone.

CAknNoteDialog::TTone CAknPopupField::iEmptyNoteTone [protected]
 

Tone for the empty note.

HBufC* CAknPopupField::iEmptyText [protected]
 

The empty list note text.

Own.

TInt CAknPopupField::iFlags [protected]
 

Flags for the popup field.

EAknFormMode CAknPopupField::iFormMode [protected]
 

Enumeration representing form mode values.

HBufC* CAknPopupField::iInvalidText [protected]
 

The invalid text.

Used in the view state when none of the elements in the list are available. Own.

CEikLabel* CAknPopupField::iLabel [protected]
 

Label of the popup field.

Own.

CAknListBoxLayoutDecorator* CAknPopupField::iLayoutDecorator [protected]
 

Contains a popup field selection array and a leading text that will be inserted before the text from the descriptor array entry.

Own.

TInt CAknPopupField::iMaxNoLines [protected]
 

Maximum number of items in selection array.

MAknPopupFieldObserver* CAknPopupField::iObserver [protected]
 

Observer for receiving events from the popup field.

Not own.

HBufC* CAknPopupField::iOtherText [protected]
 

Text to the bottom of the selection array.

Own.

CAknFormGraphicStyleListBox* CAknPopupField::iSelectionList [protected]
 

List box for the popup field usage.

Own.

EAknPopupFieldSelectionMode CAknPopupField::iSelectionMode [protected]
 

Enumeration representing selection mode values.

MAknQueryValue* CAknPopupField::iValue [protected]
 

Query value for the popup field.

Not own.

TInt CAknPopupField::iWidth [protected]
 

Maximum line width.


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

Copyright © Nokia Corporation 2001-2008
Back to top