CAknDialog Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <akndialog.h>

Inherits CEikDialog.

Inherited by CAknColourSelectionGrid, CAknForm, CAknQueryDialog, and CAknSelectionListDialog.


Detailed Description

Base class for different types of AknDialogs.

Instances of the CAikDialog class may be created, and it is possible to add controls directly to them. However it is more normal to create a subclass, and to handle the controls appearing on the dialog dynamically.


Public Member Functions

IMPORT_C  CAknDialog ()
  C++ default constructor.
IMPORT_C void  ConstructL (TInt aMenuTitleResourceId)
  Handles Symbian 2nd phase construction.
IMPORT_C  ~CAknDialog ()
  Destructor.
IMPORT_C TInt  ExecuteLD (TInt aResourceId)
  From CEikDialog.
IMPORT_C void  PrepareLC (TInt aResourceId)
  From CEikDialog.
IMPORT_C TInt  RunLD ()
  From CEikDialog.
virtual IMPORT_C void  SetEmphasis (CCoeControl *aMenuControl, TBool aEmphasis)
  From MEikMenuObserver.
virtual IMPORT_C void  DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
  Not implemented.
virtual IMPORT_C void  ProcessCommandL (TInt aCommandId)
  From MEikMenuObserver.
IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  From CCoeControl.
IMPORT_C void  FocusChanged (TDrawNow aDrawNow)
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Protected Member Functions

virtual IMPORT_C TBool  OkToExitL (TInt aButtonId)
  From CEikDialog.
IMPORT_C void  DisplayMenuL ()
  From CEikDialog.
IMPORT_C void  HideMenu ()
  From CEikDialog.
IMPORT_C TBool  MenuShowing () const
  From CEikDialog.
virtual IMPORT_C void  SizeChanged ()
  From CEikDialog.
virtual IMPORT_C void  Draw (const TRect &aRect) const
  From CEikDialog.
IMPORT_C TTypeUid::Ptr  MopSupplyObject (TTypeUid aId)
  From MObjectProvider.
void  CreateMenuBarL (TInt aMenuTitleResourceId)
  Creates or replaces dialog's menu bar.

Protected Attributes

CEikMenuBar iMenuBar
  Dialog's menu bar.

Constructor & Destructor Documentation

IMPORT_C CAknDialog::CAknDialog  ) 
 

C++ default constructor.

IMPORT_C CAknDialog::~CAknDialog  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CAknDialog::ConstructL TInt  aMenuTitleResourceId  ) 
 

Handles Symbian 2nd phase construction.

A menu resource MUST be specified - this function will Panic otherwise. If a menu is not required use CEikDialog!

Parameters:
aMenuTitleResourceId  Title of the menu.

Reimplemented in CAknForm, CAknSelectionListDialog, and CAknMarkableListDialog.

void CAknDialog::CreateMenuBarL TInt  aMenuTitleResourceId  )  [protected]
 

Creates or replaces dialog's menu bar.

Parameters:
aMenuTitleResourceId  Title of the menu bar.
IMPORT_C void CAknDialog::DisplayMenuL  )  [protected]
 

From CEikDialog.

Displays menu bar.

virtual IMPORT_C void CAknDialog::Draw const TRect &  aRect  )  const [protected, virtual]
 

From CEikDialog.

Draws the control.

Parameters:
aRect  Area to be drawn.

Reimplemented from CEikDialog.

Reimplemented in CAknSelectionListDialog.

virtual IMPORT_C void CAknDialog::DynInitMenuPaneL TInt  aResourceId,
CEikMenuPane aMenuPane
[virtual]
 

Not implemented.

Parameters:
aResourceId  Not used.
aMenuPane  Not used.

Reimplemented in CAknForm, and CAknMarkableListDialog.

IMPORT_C TInt CAknDialog::ExecuteLD TInt  aResourceId  )  [virtual]
 

From CEikDialog.

Loads, displays, and destroys the dialog.

This function loads the specified dialog from a resource and displays it. The method then destroys the dialog when it exits, therefore there is no need for the application program to destroy the dialog.

Parameters:
aResourceId  The resource ID of the dialog to load.
Returns:
Zero, unless it is a waiting dialog. For a waiting dialog, the return value is the ID of the button that closed the dialog, or zero if it was the cancel button (EEikBidCancel).

Reimplemented from CEikDialog.

Reimplemented in CAknQueryDialog.

IMPORT_C void CAknDialog::FocusChanged TDrawNow  aDrawNow  ) 
 

From CCoeControl.

Responds to a change in focus.

This is called whenever the control gains or loses focus, as a result of a call to SetFocus(). A typical use of FocusChanged() is to change the appearance of the control, for example by drawing a focus rectangle around it.

Parameters:
aDrawNow  Contains the value that was passed to it by SetFocus().

Reimplemented from CEikDialog.

IMPORT_C void CAknDialog::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.

Parameters:
aPointerEvent  The pointer event

Reimplemented from CEikDialog.

Reimplemented in CAknForm, CAknListQueryDialog, CAknMessageQueryDialog, CAknQueryDialog, CAknTextQueryDialog, CAknNumberQueryDialog, CAknTimeQueryDialog, CAknDurationQueryDialog, CAknFloatingPointQueryDialog, CAknMultiLineDataQueryDialog, CAknSelectionListDialog, and CAknMarkableListDialog.

IMPORT_C void CAknDialog::HideMenu  )  [protected]
 

From CEikDialog.

Hides menu bar.

IMPORT_C TBool CAknDialog::MenuShowing  )  const [protected]
 

From CEikDialog.

Checks if menu is displayed.

Returns:
ETrue if menu is displayed, EFalse otherwise.
IMPORT_C TTypeUid::Ptr CAknDialog::MopSupplyObject TTypeUid  aId  )  [protected]
 

From MObjectProvider.

Gets Mop supply object of the given type.

Parameters:
aId  Identifier for the supply object.
Returns:
Pointer to the supply object type ID.

Reimplemented from CEikDialog.

IMPORT_C TKeyResponse CAknDialog::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

From CCoeControl.

Handles key events.

If a control wishes to process key events, it should implement this function. The implementation must ensure that the function returns EKeyWasNotConsumed if it does not do anything in response to a key event, otherwise, other controls or dialogs may be prevented from receiving the key event. If it is able to process the event it should return EKeyWasConsumed.

When a key event occurs, the control framework calls this function for each control on the control stack, until one of them can process the key event (and returns EKeyWasConsumed).

Each keyboard key press results in three separate events: EEventKeyDown, EEventKey, and EEventKeyUp, in that order.

To receive key events, which can be processed by this function, the application should call CCoeAppUi::AddToStackL() to add the control to the stack. This only applies, however, to controls which are not components of a compound control. Compound controls should pass key events to their components as necessary: the components themselves do not go on the stack.

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.

Reimplemented from CEikDialog.

Reimplemented in CAknListQueryDialog, CAknMessageQueryDialog, CAknQueryDialog, CAknSelectionListDialog, and CAknMarkableListDialog.

virtual IMPORT_C TBool CAknDialog::OkToExitL TInt  aButtonId  )  [protected, virtual]
 

From CEikDialog.

Handles a dialog button press for the specified button.

This function is invoked when the user presses a button in the button panel. It is not called if the Cancel button is activated unless the EEikDialogFlagNotifyEsc flag has been set.

If there is an Options key then pops up menu, otherwise exits.

The function should be overridden by the derived class, and is usually used to validate the values of the dialog's controls. The function should return ETrue if it is OK to exit, and EFalse to keep the dialog active. It should always return ETrue if the button with ID EEikBidOK was activated.

Parameters:
aButtonId  The ID of the button that was activated.
Returns:
ETrue to validate and exit the dialog, EFalse to keep the dialog active. If ETrue, the dialog will be destroyed automatically by ExecuteLD(). The default implementation returns ETrue no matter which button is pressed.

Reimplemented from CEikDialog.

Reimplemented in CAknForm, CAknListQueryDialog, CAknQueryDialog, CAknTextQueryDialog, CAknNumberQueryDialog, CAknTimeQueryDialog, CAknDurationQueryDialog, CAknFloatingPointQueryDialog, CAknMultiLineDataQueryDialog, CAknIpAddressQueryDialog, CAknFixedPointQueryDialog, CAknMultiLineIpQueryDialog, CAknSelectionListDialog, and CAknMarkableListDialog.

IMPORT_C void CAknDialog::PrepareLC TInt  aResourceId  )  [virtual]
 

From CEikDialog.

Prepares the dialog, by constructing it from the specified resource.

Parameters:
aResourceId  The resource ID of the dialog.

Reimplemented from CEikDialog.

virtual IMPORT_C void CAknDialog::ProcessCommandL TInt  aCommandId  )  [virtual]
 

From MEikMenuObserver.

Hides the menu.

Parameters:
aCommandId  Not used.

Reimplemented in CAknForm, CAknMessageQueryDialog, CAknSelectionListDialog, and CAknMarkableListDialog.

IMPORT_C TInt CAknDialog::RunLD  )  [virtual]
 

From CEikDialog.

Runs the dialog and returns the ID of the button used to dismiss it.

The dialog is destroyed on exit.

This function is called by the dialog framework (ExecuteLD()) to perform dynamic construction (layout) and to display/destroy the dialog. Static construction of the dialog must already be complete before this function is called, e.g. using PrepareLC().

The function returns immediately unless EEikDialogFlagWait has been specified in the DIALOG resource. If EEikDialogFlagWait is specified, it returns when the dialog exits.

Returns:
The ID of the button used to dismiss the dialog.

Reimplemented from CEikDialog.

Reimplemented in CAknQueryDialog.

virtual IMPORT_C void CAknDialog::SetEmphasis CCoeControl *  aMenuControl,
TBool  aEmphasis
[virtual]
 

From MEikMenuObserver.

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

CEikMenuBar objects call this on their observer to emphasise themselves when they are displayed, and de-emphasise themselves when they stop displaying.

Parameters:
aMenuControl  The menu control.
aEmphasis  ETrue to emphasize the menu, EFalse otherwise.
virtual IMPORT_C void CAknDialog::SizeChanged  )  [protected, virtual]
 

From CEikDialog.

Lays out the dialog's components when the size of the dialog is changed.

Reimplemented from CEikDialog.


Field Documentation

CEikMenuBar* CAknDialog::iMenuBar [protected]
 

Dialog's menu bar.

Not owned.


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

Copyright © Nokia Corporation 2001-2008
Back to top