CAknNoteControl Class Reference

API published in: S60 1st Ed

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

Capability Information

Required Capabilities

None


#include <aknnotecontrol.h>

Inherits CAknControl.


Detailed Description

The control for a note dialog.

Manage layout of elements in a note dialog:- the text, the image and animation, the progress bar.

See also:
CAknNoteDialog, CAknNoteAttributes, CAknText

Public Member Functions

IMPORT_C  CAknNoteControl ()
  C++ default constructor.
virtual IMPORT_C  ~CAknNoteControl ()
  Destructor.
void  ConstructFromResourceL (TResourceReader &aRes)
  Constructs controls from a resource file.
IMPORT_C void  SetImageL (CEikImage *aImage)
  Set the note image.
IMPORT_C void  SetAnimationL (TInt aResource)
  Set the note animation.
IMPORT_C void  SetIconL (CEikImage *aIcon)
  Set the note icon.
IMPORT_C void  SetFinalProgressValue (TInt aValue)
  Set the progress bar final value in the note attributes.
IMPORT_C TInt  IncrementBarsAndDraw (TInt aIncrement)
  Increment the progress bar and draw.
IMPORT_C void  CreateProgressBarL ()
  Create the progress bar.
IMPORT_C CEikProgressInfo GetProgressInfo ()
  Return the progress bar.
IMPORT_C void  StartAnimationL ()
  Start the note animation.
IMPORT_C TInt  CancelAnimation ()
  Stop the note animation.
IMPORT_C void  ResetText ()
  Reset the note text.
IMPORT_C void  SetTextL (const TDesC &aText)
  Set whole text for the note control.
IMPORT_C void  SetTextL (const TDesC &aText, TInt aLineNum)
  Set text for a specific line.
IMPORT_C void  SetTextNumberL (const TInt aNumber)
  Set the number inside the note text.
IMPORT_C void  SetTextPluralityL (const TBool aIsPlural)
  Determine which text is to be used, either the text for singular notes, e.g.
IMPORT_C TInt  NumberOfLines () const
  Return the number of lines.
IMPORT_C void  Layout ()
  Do layout.
void  WindowLayout (TAknWindowLineLayout &aLayout) const
  This is used by a dialog to layout the control correctly.
IMPORT_C TInt  NoteHeight () const
  Return the note height.
IMPORT_C TInt  NoteWidth () const
  Return the note width.
TSize  MinimumSize ()
  Gets the minimun size requided by the control.
CAknNoteAttributes *  Attributes () const
  Accessor to note attributes stored in CAknNoteAttributes.
void  Reset ()
  Used by sleeping notes when going to background, in order to stop and delete animations.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
IMPORT_C void  SetDynamicTextL (const TDesC &aText)
IMPORT_C void  UpdateAndFormatLabelsL (const TDesC &aLabels)
IMPORT_C void  UpdateLabelsL (const TDesC &aLabel1, const TDesC &aLabel2=KNullDesC, const TDesC &aLabel3=KNullDesC)
IMPORT_C void  UpdateLabels (const TDesC &aLabel1, const TDesC &aLabel2=KNullDesC, const TDesC &aLabel3=KNullDesC)
IMPORT_C void  SetLabelReserveLengthL (TInt aLength1=0, TInt aLength2=0, TInt aLength3=0)
IMPORT_C void  SetBgRect (const TRect &aRect, const TPoint &aPos, TBool aOwnerNotDialog=EFalse)
  Sets up background rectangle context.
TInt  NoteLayout () const

Protected Member Functions

IMPORT_C TTypeUid::Ptr  MopSupplyObject (TTypeUid aId)
  From MObjectProvider.

Friends

class  CAknNoteAttributes

Data Structures

class   TIndex
  Manage indexes into LAF tables. More...

Constructor & Destructor Documentation

IMPORT_C CAknNoteControl::CAknNoteControl  ) 
 

C++ default constructor.

virtual IMPORT_C CAknNoteControl::~CAknNoteControl  )  [virtual]
 

Destructor.


Member Function Documentation

CAknNoteAttributes* CAknNoteControl::Attributes  )  const
 

Accessor to note attributes stored in CAknNoteAttributes.

Returns:
Pointer to CAknNoteAttributes.
IMPORT_C TInt CAknNoteControl::CancelAnimation  ) 
 

Stop the note animation.

Calls CAknBitmapAnimation::CancelAnimation() for animation object.

Returns:
KErrNone if cancellation successful, KErrGenreral if there was no animation object, otherwise another of the system-wide error codes.
See also:
CAknBitmapAnimation
void CAknNoteControl::ConstructFromResourceL TResourceReader &  aRes  ) 
 

Constructs controls from a resource file.

Parameters:
aRes  The resource reader with which to access AVKON_NOTE resource.
IMPORT_C void CAknNoteControl::CreateProgressBarL  ) 
 

Create the progress bar.

See also:
CEikProgressInfo
IMPORT_C CEikProgressInfo* CAknNoteControl::GetProgressInfo  ) 
 

Return the progress bar.

Returns:
Pointer to the progress bar.
See also:
CEikProgressInfo
IMPORT_C void CAknNoteControl::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 
IMPORT_C TInt CAknNoteControl::IncrementBarsAndDraw TInt  aIncrement  ) 
 

Increment the progress bar and draw.

Parameters:
aIncrement  The increment to add to the current progress value.
Returns:
1 if operation hasn't been completed else 0.
See also:
CEikProgressInfo
IMPORT_C void CAknNoteControl::Layout  ) 
 

Do layout.

Before doing layout parse the text (This might be redundant except when the control attributs are trasfered but is left here to avoid breaking the functionality of this exported method).

Layout is done only if it is needed, i.e. if the attributes indicates that something has changed in such a way that layout needs to be performed again, e.g. a line of text has been added.

This method assumes that the rect of the control has not been changed. On the contrary, SizeChanged does not assume that the rect is the same and hence always performs layout.

TSize CAknNoteControl::MinimumSize  ) 
 

Gets the minimun size requided by the control.

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

From MObjectProvider.

Gets an (MAknsControlContext) object whose type is encapsulated by the specified TTypeUid object. Calls SupplyMopObject(TTypeUid aId, CEikButtonGroupContainer* iCba, CEikMenuBar* iMenu).

Parameters:
aId  Encapsulates the UID that identifies the type of object required.
Returns:
Pointer to the MAknsControlContext object provided. Note that the pointer may be NULL.
IMPORT_C TInt CAknNoteControl::NoteHeight  )  const
 

Return the note height.

The note height is taken from the layout compiler and depends on number of lines and the note layout type.

Returns:
The note height in pixels.
TInt CAknNoteControl::NoteLayout  )  const
 
Returns:
note layout type see Avkon.hrh for Note dialog constants
IMPORT_C TInt CAknNoteControl::NoteWidth  )  const
 

Return the note width.

The note width is taken from the layout compiler. Contrary to the note height, the note width does not depend on the note layout type or on number of lines.

Returns:
The note width in pixels.
IMPORT_C TInt CAknNoteControl::NumberOfLines  )  const
 

Return the number of lines.

Returns:
The number of lines.
void CAknNoteControl::Reset  ) 
 

Used by sleeping notes when going to background, in order to stop and delete animations.

Calls CancelAnimation().

IMPORT_C void CAknNoteControl::ResetText  ) 
 

Reset the note text.

Perform layout only for the control. The dialog will not be resized.

See also:
CAknTextControl
IMPORT_C void CAknNoteControl::SetAnimationL TInt  aResource  ) 
 

Set the note animation.

Set the animation in the note attributes. Perform layout only for the control. The dialog will not be resized.

Parameters:
aResource  ID of BMPANIM_DATA resource.
IMPORT_C void CAknNoteControl::SetBgRect const TRect &  aRect,
const TPoint &  aPos,
TBool  aOwnerNotDialog = EFalse
 

Sets up background rectangle context.

Parameters:
aRect  Rectangle position to layout the outer and the inner rectangles of the frame.
aPos  Relative coordinates of parent position in screen.
aOwnerNotDialog  ETrue if the owner is non-dialog control.
IMPORT_C void CAknNoteControl::SetDynamicTextL const TDesC &  aText  ) 
 
Deprecated:
  • use SetTextL() method.
    Parameters:
    aText  aText string to set.
IMPORT_C void CAknNoteControl::SetFinalProgressValue TInt  aValue  ) 
 

Set the progress bar final value in the note attributes.

Parameters:
aValue  The final value for the progress information control. If it is zero, the value is set to one.
See also:
CEikProgressInfo
IMPORT_C void CAknNoteControl::SetIconL CEikImage aIcon  ) 
 

Set the note icon.

Set the icon in the note attributes. Perform layout only for the control. The dialog will not be resized.

Parameters:
aIcon  Pointer to icon to set.
IMPORT_C void CAknNoteControl::SetImageL CEikImage aImage  ) 
 

Set the note image.

Set the image in the note attributes. This reduces the size of the image if necessary (only fixed set of image sizes if supported). Perform layout only for the control. The dialog will not be resized.

Parameters:
aImage  Pointer to image to set.
IMPORT_C void CAknNoteControl::SetLabelReserveLengthL TInt  aLength1 = 0,
TInt  aLength2 = 0,
TInt  aLength3 = 0
 
Deprecated:
  • label length is taken care of already.
Don't use this method anymore. Empty implementation.
IMPORT_C void CAknNoteControl::SetTextL const TDesC &  aText,
TInt  aLineNum
 

Set text for a specific line.

Any previous text will be overwritten, except for the text that was set for other lines via this method.

This method prevents ParseTextL from having any effect, hence text control needs to know font and line width to allocate space.

This method is kept for backwards compatibility as the same results could be achieved by the other SetTextL with no wrapping enabled (flag in note attributes) and newline characters in the text to indicate a new line.

Perform layout only for the control. The dialog will not be resized.

Parameters:
aText  String to set.
aLineNum  Specifies the line of the text to be set.
IMPORT_C void CAknNoteControl::SetTextL const TDesC &  aText  ) 
 

Set whole text for the note control.

Perform layout only for the control. The dialog will not be resized.

Parameters:
aText  String to set.
IMPORT_C void CAknNoteControl::SetTextNumberL const TInt  aNumber  ) 
 

Set the number inside the note text.

The text must have been previously set via resource or via SetTextL and must have a %d or %N in it.

Note:- This method could be replaced by a SetTextL method with a variable number of arguments.

Perform layout only for the control. The dialog will not be resized.

Parameters:
aNumber  Integer to be set inside the text.
IMPORT_C void CAknNoteControl::SetTextPluralityL const TBool  aIsPlural  ) 
 

Determine which text is to be used, either the text for singular notes, e.g.

"You have 1 new message" or the text for plural notes, e.g. "You have %N new messages". These texts must have been set via resource.

Note:- This method could be replaced by a SetTextL method with a variable number of arguments.

Perform layout only for the control. The dialog will not be resized.

Parameters:
aIsPlural  ETrue if plural form of the text is needed, otherwise EFalse.
IMPORT_C void CAknNoteControl::StartAnimationL  ) 
 

Start the note animation.

See also:
CAknBitmapAnimation
IMPORT_C void CAknNoteControl::UpdateAndFormatLabelsL const TDesC &  aLabels  ) 
 
Deprecated:
IMPORT_C void CAknNoteControl::UpdateLabels const TDesC &  aLabel1,
const TDesC &  aLabel2 = KNullDesC,
const TDesC &  aLabel3 = KNullDesC
 
Deprecated:
IMPORT_C void CAknNoteControl::UpdateLabelsL const TDesC &  aLabel1,
const TDesC &  aLabel2 = KNullDesC,
const TDesC &  aLabel3 = KNullDesC
 
Deprecated:
void CAknNoteControl::WindowLayout TAknWindowLineLayout &  aLayout  )  const
 

This is used by a dialog to layout the control correctly.

Returns:
type of layout to be used.

Friends And Related Function Documentation

friend class CAknNoteAttributes [friend]
 

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

Copyright © Nokia Corporation 2001-2008
Back to top