CAknNoteDialog Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikctl.lib eikcdlg.lib

Capability Information

Required Capabilities

None


#include <aknnotedialog.h>

Inherits CEikDialog.

Inherited by CAknNoteWrapper, CAknProgressDialog, CAknStaticNoteDialog, CEikAlert, and CEikInfoDialog.


Detailed Description

The note dialog.

Displays a note to the user for:

See also:
CAknNoteControl, CAknNoteAttributes, CAknText

Public Types

enum   TTimeout {
  EUndefinedTimeout = 0, ENoTimeout = 0, EShortTimeout = 1500000, ELongTimeout = 3000000,
  EShortestTimeout = 500000
}
  The timeout in microseconds for automatically deleting the dialog. More...
enum   TTone { ENoTone = 0, EConfirmationTone = EAvkonSIDConfirmationTone, EWarningTone = EAvkonSIDWarningTone, EErrorTone = EAvkonSIDErrorTone }
  The tone played before the dialog is shown. More...

Public Member Functions

IMPORT_C  CAknNoteDialog ()
  C++ default constructor.
IMPORT_C  CAknNoteDialog (const TTone &aTone, const TTimeout &aTimeout=ENoTimeout)
  C++ default constructor.
IMPORT_C  CAknNoteDialog (CEikDialog **aSelfPtr, const TTone &aTone=ENoTone, const TTimeout &aTimeout=ENoTimeout)
  C++ default constructor.
virtual IMPORT_C  ~CAknNoteDialog ()
  Destructor.
IMPORT_C void  SetTimeout (const TTimeout &aTimeout)
  Sets the dialog timeout.
IMPORT_C void  SetTone (const TTone &aTone)
  Sets the dialog tone .
IMPORT_C void  SetTextWrapping (TBool aEnabled)
  Enables or disables text wrapping.
IMPORT_C void  SetTextProcessing (TBool aEnabled)
  Enables or disables all text processing done by the dialog.
IMPORT_C void  SetImageL (CEikImage *aImage)
  Set the dialog image.
IMPORT_C void  SetIconL (CEikImage *aIcon)
  Sets the dialog icon.
IMPORT_C void  SetTextNumberL (TInt aNumber)
  Sets the number in the dialog text.
IMPORT_C void  SetTextPluralityL (const TBool isPlural)
  Sets the text plurality for the dialog.
IMPORT_C void  SetTextL (const TDesC &aLabel)
  Sets the dialog text.
IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  From CCoeControl.
IMPORT_C void  HandleResourceChange (TInt aType)
  From CCoeControl.
IMPORT_C void  LayoutAndDraw ()
  Do layout and draw the note dialog.
virtual IMPORT_C TInt  RunLD ()
  From @ CEikDialog.
IMPORT_C void  ExitSleepingDialog ()
  From CEikDialog.
IMPORT_C TInt  ExecuteDlgLD (const TTimeout aTimeout, const TTone aTone, TInt aResourceID)
  Set timeout, tone, resource ID and then initialize and launch the dialog.
IMPORT_C TInt  ExecuteDlgLD (const TTone aTone, TInt aResourceID)
  Set tone, resource ID and then initialize and launch the dialog.
IMPORT_C TInt  ExecuteDlgLD (TInt aResourceId, TInt aNoteControlId=0)
  Set note control ID, resource ID and then initialize and launch the dialog.
IMPORT_C TInt  RunDlgLD (const TTimeout aTimeout, const TTone aTone)
  Set timeout and tone and run the dialog.
IMPORT_C TInt  RunDlgLD (const TTone aTone)
  Set tone and run the dialog.
IMPORT_C TInt  RunDlgLD ()
  Run the dialog.
IMPORT_C TInt  RunDlgLD (TInt aNoteControlId)
  Set NoteControlID and run the dialog.
IMPORT_C void  SetCurrentLabelL (TInt aControlId, const TDesC &aLabel)
  Sets a new label for the specified dialog.
virtual IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

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.
IMPORT_C void  PlayTone ()
  Plays a tone.
IMPORT_C void  ReportUserActivity () const
  Indicates that there is user activity.
IMPORT_C CAknNoteAttributes *  ControlAttributes ()
  Gets the control attributes.
IMPORT_C void  TransferControlAttributes ()
  Transfers the control attributes from the dialog to the control.
IMPORT_C CAknKeySoundSystem SoundSystem () const
  Gets the used sound system.
IMPORT_C CAknNoteControl NoteControl ()
  Gets the Note control.
IMPORT_C void  SetNoMemoryAllocation ()
  Sets an indication that memory should not be allocated.

Static Protected Member Functions

static IMPORT_C TInt  StaticDeleteL (TAny *aThis)
  Deletes the note dialog.

Protected Attributes

CPeriodic *  iTimer
  Note timeout timer.
TInt  iTimeoutInMicroseconds
  Note timeout in microseconds.
CEikDialog **  iSelfPtr
  Used for notes that are not modal.
TTone  iTone
  The tone to be played.
CAknNoteAttributes *  iControlAttributes
  Note control attributes.

Member Enumeration Documentation

enum CAknNoteDialog::TTimeout
 

The timeout in microseconds for automatically deleting the dialog.

Enumerator:
EUndefinedTimeout  Deprecated (not used).

Deprecated:
ENoTimeout  No timeout.
EShortTimeout  1.5 seconds
ELongTimeout  3 seconds
EShortestTimeout  0.5 second
enum CAknNoteDialog::TTone
 

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

IMPORT_C CAknNoteDialog::CAknNoteDialog  ) 
 

C++ default constructor.

Initialises the tone to ENoTone and the timeout to ENoTimeout.

See also:
TTone, TTimeout.
IMPORT_C CAknNoteDialog::CAknNoteDialog const TTone aTone,
const TTimeout aTimeout = ENoTimeout
 

C++ default constructor.

Initialises the tone to aTone and the timeout to aTimeout.

Parameters:
aTone  The tone to be played.
aTimeout  The timeout (microseconds). Default is ENoTimeout.
See also:
TTone, TTimeout.
IMPORT_C CAknNoteDialog::CAknNoteDialog CEikDialog **  aSelfPtr,
const TTone aTone = ENoTone,
const TTimeout aTimeout = ENoTimeout
 

C++ default constructor.

Initialises the tone to aTone and the timeout to aTimeout. Accepts a pointer to CEikDialog*. This must be the address of the dialog pointer. When the dialog deletes itself after a timeout, the address pointed to by this pointer is set to NULL. The dialog must not be on the stack, it must be on the heap!

Parameters:
aSelfPtr  Pointer to the address of the dialog.
aTone  = ENoTone The tone.
aTimeout  = ENoTimeout The timeout (microseconds).
See also:
TTone, TTimeout.
virtual IMPORT_C CAknNoteDialog::~CAknNoteDialog  )  [virtual]
 

Destructor.

Deletes timer and control attributes. If the self pointer is not null, sets the pointer to point to NULL.


Member Function Documentation

IMPORT_C CAknNoteAttributes* CAknNoteDialog::ControlAttributes  )  [protected]
 

Gets the control attributes.

If the control has already been created this method return the attributes stored inside the control. If not then the local attributes are returned. The local attributes are transferred to the control in PreLayoutDynInitL().

Derived classes should use this method when trying to access the control attributes.

Returns:
Control attributes.
IMPORT_C TInt CAknNoteDialog::ExecuteDlgLD TInt  aResourceId,
TInt  aNoteControlId = 0
 

Set note control ID, resource ID and then initialize and launch the dialog.

This method is deprecated and should not be used.

Deprecated:
Parameters:
aResourceId  The ID of the wanted resource.
aNoteControlId  Not used.
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).
IMPORT_C TInt CAknNoteDialog::ExecuteDlgLD const TTone  aTone,
TInt  aResourceID
 

Set tone, resource ID and then initialize and launch the dialog.

This method is deprecated and should not be used.

Deprecated:
Parameters:
aTone  Alarm tone.
aResourceID  The ID of the wanted resource.
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).
IMPORT_C TInt CAknNoteDialog::ExecuteDlgLD const TTimeout  aTimeout,
const TTone  aTone,
TInt  aResourceID
 

Set timeout, tone, resource ID and then initialize and launch the dialog.

This method is deprecated and should not be used.

Deprecated:
Parameters:
aTimeout  Wanted timeout in microseconds.
aTone  Alarm tone.
aResourceID  The ID of the wanted resource.
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).
IMPORT_C void CAknNoteDialog::ExitSleepingDialog  ) 
 

From CEikDialog.

Exits a sleeping dialog without deleting it.

Reimplemented from CEikDialog.

virtual IMPORT_C void CAknNoteDialog::HandlePointerEventL const TPointerEvent &  aPointerEvent  )  [virtual]
 

From CCoeControl.

Processes the pointer event directed to the dialog.

Parameters:
aPointerEvent  The pointer event directed to the notedialog.

Reimplemented from CEikDialog.

Reimplemented in CAknNoteWrapper, CAknResourceNoteDialog, CAknConfirmationNote, CAknInformationNote, CAknErrorNote, CAknWarningNote, CAknProgressDialog, CAknStaticNoteDialog, CAknWaitDialog, CEikAlert, and CEikInfoDialog.

IMPORT_C void CAknNoteDialog::HandleResourceChange TInt  aType  )  [virtual]
 

From CCoeControl.

Handles a change to the control's resources of type aType which are shared across the environment, e.g. colors or fonts.

Parameters:
aType  Target resource type.

Reimplemented from CEikDialog.

IMPORT_C void CAknNoteDialog::LayoutAndDraw  ) 
 

Do layout and draw the note dialog.

Needed when changing control components (e.g. the text) dynamically. This is needed because the size of the dialog might change (e.g. because of bigger text displayed in more lines, etc.) Set methods call LayoutAndDraw() if there is a change that might affect the dialog layout (e.g. text becames bigger and hence requires an extra line).

Derived classes that implement this kind of methods should call LayoutAndDraw().

IMPORT_C CAknNoteControl* CAknNoteDialog::NoteControl  )  [protected]
 

Gets the Note control.

Returns the first control on the active page, which is of type CAknNoteControl. If no control is found (usually because the control has not been created yet) then this method returns NULL.

Derived classes must use this method to get access to the note control.

Returns:
Pointer to the note control or NULL.
IMPORT_C TKeyResponse CAknNoteDialog::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

From CCoeControl.

Handles key events.

Any event which is not a key press is forwarded to CEikDialog::OfferKeyEventL. ' Short key press dismiss the note by calling StaticDeleteL.

See also:
StaticDeleteL(), TKeyEvent, TEventCode.
Parameters:
aKeyEvent  Key event details.
aType  Type of event (key down, key press, key release, etc).
Returns:
Indicates whether or not the key event was used by this control. EKeyWasConsumed if the control takes action on the key event or EKeyWasNotConsumed otherwise.

Reimplemented from CEikDialog.

Reimplemented in CAknProgressDialog, and CAknStaticNoteDialog.

IMPORT_C void CAknNoteDialog::PlayTone  )  [protected]
 

Plays a tone.

The tone must be previously specified. The sound ID is set depending on the tone type. The tone is played using CAknKeySoundSystem::playSound(). Derived classes must call this method if they override RunLD() and they wish to play a tone.

Panic:
EAknPanicNullPointer
See also:
TTone, CAknKeySoundSystem, CAknNoteDialog::RunLD().
IMPORT_C void CAknNoteDialog::PostLayoutDynInitL  )  [protected, virtual]
 

From CEikDialog.

Performs dynamic operations after the layout.

Called by the Uikon framework after the dialog layout is executed, this method can be overrwritten to perform specific operations.

The following operations are performed:-

  • StartAnimationL() is called.
See also:
CAknNoteControl::StartAnimationL().

Reimplemented from CEikDialog.

Reimplemented in CAknStaticNoteDialog.

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

From CEikDialog.

Performs dynamic operations before the layout.

Called by the Uikon framework before the dialog layout is executed, this method can be overrwritten to perform specific operations.

The following operations are performed:-

  • The control attributes are transferred to the control. The local control attributes are copied into the real control attributes. The local attributes are then deleted.
  • If a timeout has been specified the timer is started. The callback is StaticDeleteL.
See also:
CAknNoteAttributes, TTimer, SetEditableL().

Reimplemented from CEikDialog.

Reimplemented in CAknProgressDialog.

IMPORT_C void CAknNoteDialog::ReportUserActivity  )  const [protected]
 

Indicates that there is user activity.

Resets timers which are monitoring user inactivity. This will disable functionality that checks for user inactivity by listening to these timers.

Derived classes must call this method if they override RunLD() and they wish to report user activity in order to dismiss applications such as the screen saver.

See also:
User::ResetInactivityTime().
IMPORT_C TInt CAknNoteDialog::RunDlgLD TInt  aNoteControlId  ) 
 

Set NoteControlID and run the dialog.

This method is deprecated and should not be used.

Deprecated:
Parameters:
aNoteControlId  Not used.
Returns:
The ID of the button used to dismiss the dialog.
IMPORT_C TInt CAknNoteDialog::RunDlgLD  ) 
 

Run the dialog.

This method is deprecated and should not be used.

Deprecated:
Returns:
The ID of the button used to dismiss the dialog.
IMPORT_C TInt CAknNoteDialog::RunDlgLD const TTone  aTone  ) 
 

Set tone and run the dialog.

This method is deprecated and should not be used.

Deprecated:
Parameters:
aTone  Wanted alarm tone.
Returns:
The ID of the button used to dismiss the dialog.
IMPORT_C TInt CAknNoteDialog::RunDlgLD const TTimeout  aTimeout,
const TTone  aTone
 

Set timeout and tone and run the dialog.

This method is deprecated and should not be used.

Deprecated:
Parameters:
aTimeout  Wanted timeout in microseconds.
aTone  Wanted alarm tone.
Returns:
The ID of the button used to dismiss the dialog.
virtual IMPORT_C TInt CAknNoteDialog::RunLD  )  [virtual]
 

From @ CEikDialog.

Executes a dialog.

Plays a tone (if one was defined) and simulates user activity. Forwards call to CEikDialog::RunLD().

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

Reimplemented from CEikDialog.

Reimplemented in CAknProgressDialog.

IMPORT_C void CAknNoteDialog::SetCurrentLabelL TInt  aControlId,
const TDesC &  aLabel
 

Sets a new label for the specified dialog.

This method is deprecated. SetTextL() method should be used instead.

Parameters:
aControlId  Not used.
aLabel  The new label.
IMPORT_C void CAknNoteDialog::SetIconL CEikImage aIcon  ) 
 

Sets the dialog icon.

Changes the number type icon in the note control.

Overrides the icon which was set in the resource file. The dialog takes ownership of the pointer The numbertype icon is the small icon which is bottom left in the note (thumbnail icon).

Parameters:
aIcon  Pointer to the icon.
IMPORT_C void CAknNoteDialog::SetImageL CEikImage aImage  ) 
 

Set the dialog image.

Change the image in the note control. Override the image which was set in the resource file. The dialog takes ownership of the pointer. The note image is the big image or icon which is top right.

Parameters:
aImage  Pointer to the new image.
IMPORT_C void CAknNoteDialog::SetNoMemoryAllocation  )  [protected]
 

Sets an indication that memory should not be allocated.

This method is reserved for CEikAlert usage.

IMPORT_C void CAknNoteDialog::SetSizeAndPosition const TSize &  aSize  )  [protected, virtual]
 

From CEikDialog.

Sets the size and the position for the layout.

The dialog height and width are retrieved from the control (if it exists already).If it does not exist, then default values are used. The client rect is obtained from the application UI. AknLayoutUtils::LayoutControl is then executed using the client rect and the note width and height.

See also:
AknLayoutUtils::LayoutControl().
Parameters:
aSize  Not used.

Reimplemented from CEikDialog.

IMPORT_C void CAknNoteDialog::SetTextL const TDesC &  aLabel  ) 
 

Sets the dialog text.

This method can set a formatted text, e.g. "You have 1 new message". It can however set an unformatted text as well, e.g. "You have \%d messages". The plurality of the dialog must be previously specified - if not singular plurality is used unless there was no singular text specified in the resource file.

See also:
SetTextNumberL(), SetTextPluralityL().
Parameters:
aLabel  The note text.
IMPORT_C void CAknNoteDialog::SetTextNumberL TInt  aNumber  ) 
 

Sets the number in the dialog text.

Sets a number in the note text. If the text specified in the resource file or via SetTextL() has a %d in it, e.g. "You have %d new messages", this number is inserted at the location specified by %d.

Parameters:
aNumber  The number to be inserted in the text.
IMPORT_C void CAknNoteDialog::SetTextPluralityL const TBool  isPlural  ) 
 

Sets the text plurality for the dialog.

Indicates whether to use plural or singular text. These texts must have been specified in the resource file.

See also:
SetTextNumberL().
Parameters:
isPlural  ETrue if plural text should be used, EFalse otherwise.
IMPORT_C void CAknNoteDialog::SetTextProcessing TBool  aEnabled  ) 
 

Enables or disables all text processing done by the dialog.

This includes text wrapping, text truncation and reordering of bidirectional text.

By default, it is enabled.

If text processing is disabled, lines are broken only at explicit line end characters and they are not truncated, but drawn as long as they fit. Also, the dialog does not handle reordering of the bidirectional text.

This method must be called before the text is set.

Parameters:
aEnabled  Enables or disables all text processing.
IMPORT_C void CAknNoteDialog::SetTextWrapping TBool  aEnabled  ) 
 

Enables or disables text wrapping.

Enables or disables text wrapping depending on the values of aEnabled (true enables text wrapping). When text wrapping is disabled a new line in the note dialog starts only after a newline character in the note text. If a line does not fit into the dialog width it is clipped (the last character is replaced with an ellipsis sign).

This method must be called before SetTextL as it only influences the wrapping of text that it is yet to be set via API.

Parameters:
aEnabled  ETrue for enabling text wrapping, EFalse for disabling it.
IMPORT_C void CAknNoteDialog::SetTimeout const TTimeout aTimeout  ) 
 

Sets the dialog timeout.

See also:
TTimeout.
Parameters:
aTimeout  The dialog timeout.
IMPORT_C void CAknNoteDialog::SetTone const TTone aTone  ) 
 

Sets the dialog tone .

See also:
TTone.
Parameters:
aTone  The dialog tone.
IMPORT_C CAknKeySoundSystem* CAknNoteDialog::SoundSystem  )  const [protected]
 

Gets the used sound system.

Calls iEikonEnv->AppUi()->KeySounds() and returns the pointer returned by the called method. If there is no application UI return NULL.

See also:
CAknKeySoundSystem, CAknAppUi.
Returns:
Pointer to the used CAknKeySoundSystem or NULL.
Panic:
EAknPanicNullPointer
static IMPORT_C TInt CAknNoteDialog::StaticDeleteL TAny *  aThis  )  [static, protected]
 

Deletes the note dialog.

Called when the timer completes, this method deletes the dialog. A reinterpret_cast to CAknNoteDialog* is performed on aThis. If the dialog is not a sleeping note then it is deleted. If it is a sleeping dialog then the timer is stopped, OkToExitL() is called with KErrCancel and ExitSleepingDialog is executed.

See also:
TTimer, OkToExitL(), ExitSleepingDialog().
Parameters:
aThis  Pointer to the dialog.
Returns:
Always returns EFalse.
IMPORT_C void CAknNoteDialog::TransferControlAttributes  )  [protected]
 

Transfers the control attributes from the dialog to the control.

Must be called by derived classes in PreLayoutDynInitL() if this method is not called then the set of API methods that were invoked before the control is created will not work.


Field Documentation

CAknNoteAttributes* CAknNoteDialog::iControlAttributes [protected]
 

Note control attributes.

CEikDialog** CAknNoteDialog::iSelfPtr [protected]
 

Used for notes that are not modal.

The calling application has no way of knowing when the note is deleted.

TInt CAknNoteDialog::iTimeoutInMicroseconds [protected]
 

Note timeout in microseconds.

CPeriodic* CAknNoteDialog::iTimer [protected]
 

Note timeout timer.

TTone CAknNoteDialog::iTone [protected]
 

The tone to be played.


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

Copyright © Nokia Corporation 2001-2008
Back to top