CFormattedCellListBoxItemDrawer Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikctl.lib eikcoctl.lib

Capability Information

Required Capabilities

None


#include <eikfrlb.h>

Inherits CTextListItemDrawer.

Inherited by CDoubleLargeStyleItemDrawer, CSettingsListBoxItemDrawer, and CWordWrappedFormattedCellItemDrawer.


Detailed Description

CFormattedCellListBoxItemDrawer draws a single list item and manages list item properties.

Public Member Functions

IMPORT_C  CFormattedCellListBoxItemDrawer (MTextListBoxModel *aTextListBoxModel, const CFont *aFont, CFormattedCellListBoxData *aFormattedCellData)
  C++ default constructor.
IMPORT_C  ~CFormattedCellListBoxItemDrawer ()
  Destructor.
IMPORT_C CFormattedCellListBoxData FormattedCellData () const
  Gets the list layout drawer.
IMPORT_C CFormattedCellListBoxData ColumnData () const
  Gets the list layout drawer.
virtual IMPORT_C void  DrawEmptyItem (TInt aItemIndex, TPoint aItemRectPos, TBool aViewIsDimmed) const
  Draws an empty item to the list box.
IMPORT_C void  SetTopItemIndex (TInt aTop)
  This function sets top item index.
IMPORT_C void  ClearAllPropertiesL ()
  Clears all properties.
IMPORT_C void  SetPropertiesL (TInt aItemIndex, TListItemProperties properties)
  The SetProperties is convenience method for normal cases.
virtual IMPORT_C TListItemProperties  Properties (TInt aItemIndex) const
  Function for getting properties of a certain list box item.
TSize  LafItemSize ()
  Gets list box item cell size.
IMPORT_C void  DrawItemText (TInt aItemIndex, const TRect &aItemTextRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aItemIsSelected) const
  From CTextListItemDrawer.
IMPORT_C void  DrawItemMark (TBool aItemIsSelected, TBool aViewIsDimmed, const TPoint &aMarkPos) const
  From CTextListItemDrawer.
IMPORT_C TSize  MinimumCellSize () const
  From CListItemDrawer.
IMPORT_C TInt  ItemWidthInPixels (TInt aItemIndex) const
  From CListItemDrawer.
IMPORT_C void  SetItemCellSize (const TSize &aSizeInPixels)
  From CListItemDrawer.

Protected Member Functions

void  DrawCurrentItemRect (const TRect &aRect) const
  Draws current item rectangle.
void  WordWrapListItem (TPtr &aTarget, const TDesC &aItemString, TInt aFirstIndex, TInt aSecondIndex, TInt aItemIndex) const
  WordWrapListItem is used with CAknDouble* style listboxes.
void  DrawBackgroundAndSeparatorLines (const TRect &aItemTextRect) const

Protected Attributes

TInt  iTopItemIndex
  Top item index.
CArrayFix< SListProperties > *  iPropertyArray
  Array for list box item's properties.

Data Structures

struct   SListProperties
  List item index and color and style properties. More...

Constructor & Destructor Documentation

IMPORT_C CFormattedCellListBoxItemDrawer::CFormattedCellListBoxItemDrawer MTextListBoxModel aTextListBoxModel,
const CFont *  aFont,
CFormattedCellListBoxData aFormattedCellData
 

C++ default constructor.

Parameters:
aTextListBoxModel  The list box model class.
aFont  Font to be used in listbox.
aFormattedCellData  Pointer to the list layout drawer class.
IMPORT_C CFormattedCellListBoxItemDrawer::~CFormattedCellListBoxItemDrawer  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CFormattedCellListBoxItemDrawer::ClearAllPropertiesL  ) 
 

Clears all properties.

IMPORT_C CFormattedCellListBoxData* CFormattedCellListBoxItemDrawer::ColumnData  )  const
 

Gets the list layout drawer.

Returns:
Pointer to the list layout drawer object.
void CFormattedCellListBoxItemDrawer::DrawBackgroundAndSeparatorLines const TRect &  aItemTextRect  )  const [protected]
 
void CFormattedCellListBoxItemDrawer::DrawCurrentItemRect const TRect &  aRect  )  const [protected]
 

Draws current item rectangle.

Parameters:
aRect  Current item rectangle.
virtual IMPORT_C void CFormattedCellListBoxItemDrawer::DrawEmptyItem TInt  aItemIndex,
TPoint  aItemRectPos,
TBool  aViewIsDimmed
const [virtual]
 

Draws an empty item to the list box.

Parameters:
aItemIndex  Not used.
aItemRectPos  Position for the list box item rectangle.
aViewIsDimmed  Not used.
IMPORT_C void CFormattedCellListBoxItemDrawer::DrawItemMark TBool  aItemIsSelected,
TBool  aViewIsDimmed,
const TPoint &  aMarkPos
const [virtual]
 

From CTextListItemDrawer.

Draws an item tick mark.

A tick mark is used in multiple selection lists to indicate the item is selected.

This function is invoked by the framework to draw an item mark if iDrawMark is set. The mark should be drawn into this list item drawer's graphics context; by default, DrawItemMark() draws a tick using the standard symbol font.

This function does not need to be re-implemented for derived classes which do not draw item marks.

Parameters:
aItemIsSelected  Whether the item to draw for is selected.
aViewIsDimmed  Whether the item is dimmed.
aMarkPos  Position of the mark.

Reimplemented from CListItemDrawer.

IMPORT_C void CFormattedCellListBoxItemDrawer::DrawItemText TInt  aItemIndex,
const TRect &  aItemTextRect,
TBool  aItemIsCurrent,
TBool  aViewIsEmphasized,
TBool  aItemIsSelected
const [virtual]
 

From CTextListItemDrawer.

Draw an item in a list box.

Parameters:
aItemIndex  The index into the model's item array of the item to draw.
aItemTextRect  The item’s text rectangle.
aItemIsCurrent  ETrue if the item is current. EFalse otherwise.
aViewIsEmphasized  ETrue if the view is emphasized. EFalse otherwise.
aItemIsSelected  ETrue if the item is selected. EFalse otherwise.

Reimplemented from CTextListItemDrawer.

Reimplemented in CWordWrappedFormattedCellItemDrawer, and CSettingsListBoxItemDrawer.

IMPORT_C CFormattedCellListBoxData* CFormattedCellListBoxItemDrawer::FormattedCellData  )  const
 

Gets the list layout drawer.

Returns:
Pointer to the list layout drawer object.
IMPORT_C TInt CFormattedCellListBoxItemDrawer::ItemWidthInPixels TInt  aItemIndex  )  const [virtual]
 

From CListItemDrawer.

Gets the width in pixels of the specified item.

Parameters:
aItemIndex  The index of the item for which the width is obtained.
Returns:
The specified item's width in pixels.

Reimplemented from CTextListItemDrawer.

TSize CFormattedCellListBoxItemDrawer::LafItemSize  )  [inline]
 

Gets list box item cell size.

Returns:
The list box item cell size.
IMPORT_C TSize CFormattedCellListBoxItemDrawer::MinimumCellSize  )  const [virtual]
 

From CListItemDrawer.

Gets the minimum size of a cell based on the font and the number of characters in the cell.

Returns:
The minimum size for a cell in pixels.

Reimplemented from CTextListItemDrawer.

virtual IMPORT_C TListItemProperties CFormattedCellListBoxItemDrawer::Properties TInt  aItemIndex  )  const [virtual]
 

Function for getting properties of a certain list box item.

Parameters:
aItemIndex  The listbox item index.
Returns:
Colour and style properties of wanted list box item.

Reimplemented from CListItemDrawer.

IMPORT_C void CFormattedCellListBoxItemDrawer::SetItemCellSize const TSize &  aSizeInPixels  )  [virtual]
 

From CListItemDrawer.

Sets the item cell size.

The cell size is the on-screen size of the entire item, including its text and its item mark.

Parameters:
aSizeInPixels  New size for the item cell.

Reimplemented from CListItemDrawer.

IMPORT_C void CFormattedCellListBoxItemDrawer::SetPropertiesL TInt  aItemIndex,
TListItemProperties  properties
 

The SetProperties is convenience method for normal cases.

NOTE that it does NOT work correctly if you can insert/delete items from the list -- You need to update all properties if any changes to the item text array happen! Often it is convenient to override the Properties() method. Further, use this only for small lists.

It has been implemented as sorted list of (index,Property) pairs.

If you're using find, aItemIndex for this method is the same as you give in MdcaPoint() points the default Properties() does conversion between indexes.

Parameters:
aItemIndex  List box item index.
properties  Colour and style properties for the list box item.
IMPORT_C void CFormattedCellListBoxItemDrawer::SetTopItemIndex TInt  aTop  ) 
 

This function sets top item index.

Parameters:
aTop  Item index value.
void CFormattedCellListBoxItemDrawer::WordWrapListItem TPtr &  aTarget,
const TDesC &  aItemString,
TInt  aFirstIndex,
TInt  aSecondIndex,
TInt  aItemIndex
const [protected]
 

WordWrapListItem is used with CAknDouble* style listboxes.

If listbox does not have 2nd line defined, WordWrapListItem wraps 1st line to 2nd line, if text does not fit to 1st line. If listbox does have 2nd line defined, this method truncates both lines.


Field Documentation

CArrayFix<SListProperties>* CFormattedCellListBoxItemDrawer::iPropertyArray [protected]
 

Array for list box item's properties.

Own.

TInt CFormattedCellListBoxItemDrawer::iTopItemIndex [protected]
 

Top item index.


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

Copyright © Nokia Corporation 2001-2008
Back to top