CAknQueryDialog Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <aknquerydialog.h>

Inherits CAknDialog, and MAknQueryControlObserver.

Inherited by CAknDurationQueryDialog, CAknFixedPointQueryDialog, CAknFloatingPointQueryDialog, CAknIpAddressQueryDialog, CAknListQueryDialog, CAknMessageQueryDialog, CAknMultiLineDataQueryDialog, CAknNumberQueryDialog, CAknTextQueryDialog, and CAknTimeQueryDialog.


Detailed Description

General query dialog.

Use for confirmation queries


Public Types

enum   TTone { ENoTone = 0, EConfirmationTone = EAvkonSIDConfirmationTone, EWarningTone = EAvkonSIDWarningTone, EErrorTone = EAvkonSIDErrorTone }
  Enumeration for tones. More...

Public Member Functions

virtual IMPORT_C  ~CAknQueryDialog ()
IMPORT_C  CAknQueryDialog (const TTone &aTone)
  Construction.
virtual IMPORT_C CAknPopupHeadingPane QueryHeading () const
  Return pointer to query heading or NULL.
IMPORT_C CAknPopupHeadingPane Heading () const
  Deprecated method to return pointer to query heading or NULL (use QueryHeading()).
IMPORT_C void  SetPromptL (const TDesC &aPrompt)
  Set prompt text for query.
IMPORT_C void  MakeLeftSoftkeyVisible (TBool aVisible)
  Set visibility of the left softkey.
IMPORT_C void  SetEmergencyCallSupport (TBool aOnOff)
  Enable or disable emergency call support.
IMPORT_C void  RemoveEditorIndicator ()
  Removes the editor indicators for this dialog.
IMPORT_C void  SetPredictiveTextInputPermitted (TBool aPermitted)
  This method can be used to set predictive text entry permitted.
IMPORT_C TInt  RunLD ()
  Runs the querydialog and returns the ID of the button used to dismiss it.
IMPORT_C TInt  ExecuteLD (TInt aResourceId)
  Call PrepareLC and display dialog.
IMPORT_C TInt  ExecuteLD (TInt aResourceId, const TDesC &aPrompt)
  Call PrepareLC and display dialog.
IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  Handles pointer events.
IMPORT_C TBool  HandleQueryEditorSizeEventL (CAknQueryControl *aQueryControl, TQueryControlEvent aEventType)
  From MAknQueryControlObserver.
IMPORT_C TBool  HandleQueryEditorStateEventL (CAknQueryControl *aQueryControl, TQueryControlEvent aEventType, TQueryValidationStatus aStatus)
  From MAknQueryControlObserver.
virtual IMPORT_C TBool  NeedToDismissQueryL (const TKeyEvent &aKeyEvent)
  Called by OfferkeyEventL(), gives a change to dismiss the query even with keys different than Enter of Ok.
virtual IMPORT_C void  DismissQueryL ()
  Called by NeedToDismissQueryL(), gives a change to either accept or reject the query.
IMPORT_C  CAknQueryDialog ()
IMPORT_C  CAknQueryDialog (TDesC &aPrompt, const TTone &aTone=ENoTone)
IMPORT_C void  SetHeaderTextL (const TDesC &aHeader)
IMPORT_C void  SetHeaderImageL (CEikImage *aImage)
IMPORT_C TInt  RunDlgLD (TInt aResourceId)

Static Public Member Functions

static IMPORT_C CAknQueryDialog NewL (const TTone &aTone=ENoTone)
  Second phase construction required to align with multiline queries API In future might use MAknQueryData mixin in the base class, hence requiring second phase construction.
static IMPORT_C CAknQueryDialog NewL (TDes &aText, const TTone &aTone=ENoTone)
static IMPORT_C CAknQueryDialog NewL (TInt &aNumber, const TTone &aTone=ENoTone)
static IMPORT_C CAknQueryDialog NewL (TTime &aTime, const TTone &aTone=ENoTone)
static IMPORT_C CAknQueryDialog NewL (TTimeIntervalSeconds &aTime, const TTone &aTone=ENoTone)
static IMPORT_C CAknQueryDialog NewL (TReal &aNumber, const TTone &aTone=ENoTone)
static IMPORT_C CAknQueryDialog NewL (TInetAddr &aInetAddr, const TTone &aTone=ENoTone)
static IMPORT_C CAknQueryDialog NewL (TPosition &aValue, const TTone &aTone=ENoTone)
  Not yet totally implemented!
static IMPORT_C TInt  MaxTextLength (const CAknQueryControl *aControl, const TDes &aDataText, TInt aApiValue)
  Return the maximum possible length of the query text This is (in order of precedence, and assuming they are valid i.e.
static IMPORT_C TInt  MaxTextLength (const CAknQueryControl *aControl, const TDes *aDataText, TInt aApiValue)

Protected Member Functions

IMPORT_C void  SetSizeAndPosition (const TSize &aSize)
  From CEikdialog.
IMPORT_C void  PreLayoutDynInitL (void)
  From CEikdialog.
IMPORT_C void  PostLayoutDynInitL ()
  From CEikdialog.
virtual IMPORT_C TBool  OkToExitL (TInt aButtonId)
  From CEikdialog.
virtual IMPORT_C void  UpdateLeftSoftKeyL ()
  If the query text is ok (retrieved form query control) then display the left soft key, otherwise hide it.
virtual IMPORT_C void  DoSetPromptL ()
  Set the prompt inside the query control.
virtual IMPORT_C CAknQueryControl QueryControl () const
  Return pointer to query control or NULL.
void  PlayTone ()
  Plays tone.
void  ReportUserActivity () const
  Resets system's inactivity timer.
void  LayoutAndDraw ()
  Recreates layout and redraws the dialog.
TInt  GetLeftCBAShortKeyPress ()
  Returns left CBA short key press.
TInt  GetRightCBAShortKeyPress ()
  Returns right CBA short key press.
TBool  IsLeftSoftkeyVisible ()
  Returns whether the left softkey is visible.
IMPORT_C TPtrC  Prompt () const
  Prompt access for derived classes.
TTone Tone ()
const TTone Tone () const
TBitFlags16 &  Flags ()
const TBitFlags16 &  Flags () const
CAknKeySoundSystem SoundSystem () const
CCoeControl *  FindControlOnAnyPageWithControlType (TInt aControlType, TInt *aLineIndex=0, TInt *aPageIndex=0) const
  To be used to go through every control in the dialog, on every page, in Dialog-internal storage order, until a control with that type is found.

Protected Attributes

TTone  iTone
  Tone which is played when the query is executed These will be made private, use protected methods.
TDesC *  iPrompt
  Prompt text.
TAny *  iSpare_2
  Spare variable for further development.
TBitFlags16  iFlags
  Flags for emergency call support Need these at least to store the ECS state until the control exists.
TInt  iSpare_1
  Spare variable for further development.
CAknKeySoundSystem iSoundSystem
  Sound system.

Member Enumeration Documentation

enum CAknQueryDialog::TTone
 

Enumeration for tones.

The tone played before the dialog is shown. Application specific tones may be played by casting the application defined Sound ID (SID), to TTone

Enumerator:
ENoTone  No tone is played.
EConfirmationTone  A confirmation tone is played.
EWarningTone  A warning tone is played.
EErrorTone  An error tone is played.

Constructor & Destructor Documentation

virtual IMPORT_C CAknQueryDialog::~CAknQueryDialog  )  [virtual]
 
IMPORT_C CAknQueryDialog::CAknQueryDialog const TTone aTone  ) 
 

Construction.

Deprecated:
: will be made protected - use NewL
IMPORT_C CAknQueryDialog::CAknQueryDialog  ) 
 
Deprecated:
do not use
IMPORT_C CAknQueryDialog::CAknQueryDialog TDesC &  aPrompt,
const TTone aTone = ENoTone
 
Deprecated:
do not use

Member Function Documentation

virtual IMPORT_C void CAknQueryDialog::DismissQueryL  )  [virtual]
 

Called by NeedToDismissQueryL(), gives a change to either accept or reject the query.

Default implementation is to accept the query if the Left soft key is displayed and reject it otherwise. Left softkey is only displayed if the query has valid data into it.

virtual IMPORT_C void CAknQueryDialog::DoSetPromptL  )  [protected, virtual]
 

Set the prompt inside the query control.

If dialog is active redo layout and draw.

Reimplemented in CAknMultiLineDataQueryDialog, CAknIpAddressQueryDialog, CAknFixedPointQueryDialog, and CAknMultiLineIpQueryDialog.

IMPORT_C TInt CAknQueryDialog::ExecuteLD TInt  aResourceId,
const TDesC &  aPrompt
 

Call PrepareLC and display dialog.

Parameters:
aResourceId  resource for query
aPrompt  text for query prompt
IMPORT_C TInt CAknQueryDialog::ExecuteLD TInt  aResourceId  )  [virtual]
 

Call PrepareLC and display dialog.

Identical to version in CEikDialog but need to override this because of version with prompt, compiler will complain if this is not implemented in derived class as well

Parameters:
aResourceId  resource for query

Reimplemented from CAknDialog.

CCoeControl* CAknQueryDialog::FindControlOnAnyPageWithControlType TInt  aControlType,
TInt *  aLineIndex = 0,
TInt *  aPageIndex = 0
const [protected]
 

To be used to go through every control in the dialog, on every page, in Dialog-internal storage order, until a control with that type is found.

If such a control is not found, a null pointer will be returned.

Parameters:
aControlType  - Enum used to identify the control type on that CEikCaptionedControl Line
aLineIndex  - Optional argument, if used contains reference to an int which holds the initial line to start searching on, and on finding a control of that type, is assigned the next position to start searching.
aPageIndex  - Optional argument, if used contains reference to an int which holds the initial dialog page to start searching on, and on finding a control of that type, is assigned the page that the control was found on.
const TBitFlags16& CAknQueryDialog::Flags  )  const [inline, protected]
 
Returns:
query flags
TBitFlags16& CAknQueryDialog::Flags  )  [inline, protected]
 
Returns:
query flags
TInt CAknQueryDialog::GetLeftCBAShortKeyPress  )  [protected]
 

Returns left CBA short key press.

Returns:
Id of the left CBA
TInt CAknQueryDialog::GetRightCBAShortKeyPress  )  [protected]
 

Returns right CBA short key press.

Returns:
Id of the right CBA
IMPORT_C void CAknQueryDialog::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

Handles pointer events.

Reimplemented from CAknDialog.

Reimplemented in CAknListQueryDialog, CAknMessageQueryDialog, CAknTextQueryDialog, CAknNumberQueryDialog, CAknTimeQueryDialog, CAknDurationQueryDialog, CAknFloatingPointQueryDialog, and CAknMultiLineDataQueryDialog.

IMPORT_C TBool CAknQueryDialog::HandleQueryEditorSizeEventL CAknQueryControl aQueryControl,
TQueryControlEvent  aEventType
 

From MAknQueryControlObserver.

Gets called when editor sends size event.

Parameters:
aQueryControl  Pointer to query control which sent the event
aEventType  Type of the event

Reimplemented in CAknTextQueryDialog.

IMPORT_C TBool CAknQueryDialog::HandleQueryEditorStateEventL CAknQueryControl aQueryControl,
TQueryControlEvent  aEventType,
TQueryValidationStatus  aStatus
 

From MAknQueryControlObserver.

Gets called when editor sends state event

Parameters:
aQueryControl  Pointer to query control which sent the event
aEventType  Type of the event
aStatus  Editor validation status
IMPORT_C CAknPopupHeadingPane* CAknQueryDialog::Heading  )  const
 

Deprecated method to return pointer to query heading or NULL (use QueryHeading()).

Deprecated:
TBool CAknQueryDialog::IsLeftSoftkeyVisible  )  [protected]
 

Returns whether the left softkey is visible.

Returns:
ETrue is the left softkey is visible
void CAknQueryDialog::LayoutAndDraw  )  [protected]
 

Recreates layout and redraws the dialog.

IMPORT_C void CAknQueryDialog::MakeLeftSoftkeyVisible TBool  aVisible  ) 
 

Set visibility of the left softkey.

Softkey is hidden when data in the query is not acceptable.

Parameters:
aVisible  EFalse hides softkey label, ETrue shows it.
static IMPORT_C TInt CAknQueryDialog::MaxTextLength const CAknQueryControl aControl,
const TDes *  aDataText,
TInt  aApiValue
[static]
 
Deprecated:
  • use other version of MaxTextLength
static IMPORT_C TInt CAknQueryDialog::MaxTextLength const CAknQueryControl aControl,
const TDes &  aDataText,
TInt  aApiValue
[static]
 

Return the maximum possible length of the query text This is (in order of precedence, and assuming they are valid i.e.

less than or equal to the length of the descriptor passed to return the value) dependent on:

1) aApiValue

2) Resource set value held in aControl

3) The MaxLength of the descriptor

Returns:
maximum text length
virtual IMPORT_C TBool CAknQueryDialog::NeedToDismissQueryL const TKeyEvent &  aKeyEvent  )  [virtual]
 

Called by OfferkeyEventL(), gives a change to dismiss the query even with keys different than Enter of Ok.

Reimplemented in CAknMultiLineDataQueryDialog, CAknIpAddressQueryDialog, CAknFixedPointQueryDialog, and CAknMultiLineIpQueryDialog.

static IMPORT_C CAknQueryDialog* CAknQueryDialog::NewL TPosition aValue,
const TTone aTone = ENoTone
[static]
 

Not yet totally implemented!

Returns:
pointer to CAknLocationQueryDialog
static IMPORT_C CAknQueryDialog* CAknQueryDialog::NewL TInetAddr &  aInetAddr,
const TTone aTone = ENoTone
[static]
 
Returns:
pointer to CAknIpQueryDialog
static IMPORT_C CAknQueryDialog* CAknQueryDialog::NewL TReal &  aNumber,
const TTone aTone = ENoTone
[static]
 
Returns:
pointer to CAknFloatQueryDialog
static IMPORT_C CAknQueryDialog* CAknQueryDialog::NewL TTimeIntervalSeconds &  aTime,
const TTone aTone = ENoTone
[static]
 
Returns:
pointer to CAknDurationQueryDialog
static IMPORT_C CAknQueryDialog* CAknQueryDialog::NewL TTime &  aTime,
const TTone aTone = ENoTone
[static]
 
Returns:
pointer to CAknTimeQueryDialog
static IMPORT_C CAknQueryDialog* CAknQueryDialog::NewL TInt &  aNumber,
const TTone aTone = ENoTone
[static]
 
Returns:
pointer to CAknNumberQueryDialog
static IMPORT_C CAknQueryDialog* CAknQueryDialog::NewL TDes &  aText,
const TTone aTone = ENoTone
[static]
 
Returns:
pointer to CAknTextQueryDialog
static IMPORT_C CAknQueryDialog* CAknQueryDialog::NewL const TTone aTone = ENoTone  )  [static]
 

Second phase construction required to align with multiline queries API In future might use MAknQueryData mixin in the base class, hence requiring second phase construction.

Returns:
pointer to CAknQueryDialog
IMPORT_C TKeyResponse CAknQueryDialog::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

From CCoeControl.

Handle key events. When a key event occurs, until one of them returns EKeyWasConsumed to indicate that it processed the key event. CONE calls this function for each control on the control stack,

Parameters:
aKeyEvent  The key event.
aType  The type of the event: EEventKey, EEventKeyUp or EEventKeyDown.
Returns:
Indicates whether or not the key event was used by this control.

Reimplemented from CAknDialog.

Reimplemented in CAknListQueryDialog, and CAknMessageQueryDialog.

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

From CEikdialog.

This function is called by the EIKON framework if the user activates a button in the button panel. It is not called if the Cancel button is activated, unless the EEikDialogFlagNotifyEsc flag is set.

Parameters:
aButtonId  The ID of the button that was activated
Returns:
Should return ETrue if the dialog should exit, and EFalse if it should not.

Reimplemented from CAknDialog.

Reimplemented in CAknListQueryDialog, CAknTextQueryDialog, CAknNumberQueryDialog, CAknTimeQueryDialog, CAknDurationQueryDialog, CAknFloatingPointQueryDialog, CAknMultiLineDataQueryDialog, CAknIpAddressQueryDialog, CAknFixedPointQueryDialog, and CAknMultiLineIpQueryDialog.

void CAknQueryDialog::PlayTone  )  [protected]
 

Plays tone.

IMPORT_C void CAknQueryDialog::PostLayoutDynInitL  )  [protected, virtual]
 

From CEikdialog.

This function is called by the EIKON dialog framework just before the dialog is activated, after it has called PreLayoutDynInitL() and the dialog has been sized.

Reimplemented from CEikDialog.

Reimplemented in CAknListQueryDialog, CAknMessageQueryDialog, CAknIpAddressQueryDialog, and CAknFixedPointQueryDialog.

IMPORT_C void CAknQueryDialog::PreLayoutDynInitL void   )  [protected, virtual]
 

From CEikdialog.

This function is called by the EIKON dialog framework just before the dialog is activated, but before it is sized, and before PostLayoutDynInitL() is called.

Reimplemented from CEikDialog.

Reimplemented in CAknListQueryDialog, CAknMessageQueryDialog, CAknTextQueryDialog, CAknNumberQueryDialog, CAknTimeQueryDialog, CAknDurationQueryDialog, CAknFloatingPointQueryDialog, CAknMultiLineDataQueryDialog, CAknIpAddressQueryDialog, CAknFixedPointQueryDialog, and CAknMultiLineIpQueryDialog.

IMPORT_C TPtrC CAknQueryDialog::Prompt  )  const [protected]
 

Prompt access for derived classes.

virtual IMPORT_C CAknQueryControl* CAknQueryDialog::QueryControl  )  const [protected, virtual]
 

Return pointer to query control or NULL.

Reimplemented in CAknMultiLineDataQueryDialog, CAknIpAddressQueryDialog, CAknFixedPointQueryDialog, and CAknMultiLineIpQueryDialog.

virtual IMPORT_C CAknPopupHeadingPane* CAknQueryDialog::QueryHeading  )  const [virtual]
 

Return pointer to query heading or NULL.

Reimplemented in CAknListQueryDialog, and CAknMultiLineDataQueryDialog.

IMPORT_C void CAknQueryDialog::RemoveEditorIndicator  ) 
 

Removes the editor indicators for this dialog.

Used to ensure this dialog does not own any editor indicators. before opening another dialog which outlasts this one.

void CAknQueryDialog::ReportUserActivity  )  const [protected]
 

Resets system's inactivity timer.

IMPORT_C TInt CAknQueryDialog::RunDlgLD TInt  aResourceId  ) 
 
Deprecated:
  • use RunLD or ExecuteLD instead
IMPORT_C TInt CAknQueryDialog::RunLD  )  [virtual]
 

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

The dialog is destroyed on exit.

Reimplemented from CAknDialog.

IMPORT_C void CAknQueryDialog::SetEmergencyCallSupport TBool  aOnOff  ) 
 

Enable or disable emergency call support.

This method is only valid in numeric queries (secret or normal).

Default is Off for both.

Parameters:
aOnOff  Sets emergency call support active or inactive, if feature is available in current type of control
IMPORT_C void CAknQueryDialog::SetHeaderImageL CEikImage aImage  ) 
 
Deprecated:
IMPORT_C void CAknQueryDialog::SetHeaderTextL const TDesC &  aHeader  ) 
 
Deprecated:

Reimplemented in CAknMessageQueryDialog.

IMPORT_C void CAknQueryDialog::SetPredictiveTextInputPermitted TBool  aPermitted  ) 
 

This method can be used to set predictive text entry permitted.

The default Query behaviour is to supress predictive entry (over-riding editor resource flags that may indicate otherwise.

This may be called at any time prior to activation of the query.

Parameters:
aPermitted  ETrue - allow predictive text entry
IMPORT_C void CAknQueryDialog::SetPromptL const TDesC &  aPrompt  ) 
 

Set prompt text for query.

This this will override text given in constructor.

Parameters:
aPrompt  Text for prompt
IMPORT_C void CAknQueryDialog::SetSizeAndPosition const TSize &  aSize  )  [protected, virtual]
 

From CEikdialog.

EIKON provides an implementation of this function, which positions the dialog in the centre of the screen. However, it can be overridden by derived classes.

Parameters:
aSize  The size for the dialog.

Reimplemented from CEikDialog.

Reimplemented in CAknListQueryDialog, CAknMessageQueryDialog, CAknIpAddressQueryDialog, and CAknFixedPointQueryDialog.

CAknKeySoundSystem* CAknQueryDialog::SoundSystem  )  const [inline, protected]
 
Returns:
query sound system
const TTone& CAknQueryDialog::Tone  )  const [inline, protected]
 
Returns:
query tone
TTone& CAknQueryDialog::Tone  )  [inline, protected]
 
Returns:
query tone
virtual IMPORT_C void CAknQueryDialog::UpdateLeftSoftKeyL  )  [protected, virtual]
 

If the query text is ok (retrieved form query control) then display the left soft key, otherwise hide it.

Reimplemented in CAknMultiLineDataQueryDialog, CAknIpAddressQueryDialog, CAknFixedPointQueryDialog, and CAknMultiLineIpQueryDialog.


Field Documentation

TBitFlags16 CAknQueryDialog::iFlags [protected]
 

Flags for emergency call support Need these at least to store the ECS state until the control exists.

TDesC* CAknQueryDialog::iPrompt [protected]
 

Prompt text.

CAknKeySoundSystem* CAknQueryDialog::iSoundSystem [protected]
 

Sound system.

TInt CAknQueryDialog::iSpare_1 [protected]
 

Spare variable for further development.

TAny* CAknQueryDialog::iSpare_2 [protected]
 

Spare variable for further development.

TTone CAknQueryDialog::iTone [protected]
 

Tone which is played when the query is executed These will be made private, use protected methods.

Deprecated:

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

Copyright © Nokia Corporation 2001-2008
Back to top