CListItemDrawer Class Reference

API published in: S60 1st Ed

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

Capability Information

Required Capabilities

None


#include <
eiklbi.h>

Inherited by CTextListItemDrawer.


Detailed Description

The CListItemDrawer class is the base class for the list box item drawers which handle drawing of the contents of list box items.

The items may optionally be markable.


Public Types

enum  TFlags { EDrawMarkSelection = 0x0001, EPaintedSelection = 0x0002, EDrawOnlyActiveSelection = 0x0004, EDisableHighlight = 0x0008 }
 Provides list box attributes for handling multiple selections. More...
enum  TListItemAttribute { ECurrent = 0x0001, EEmphasized = 0x0002, ESelected = 0x0004, EMask = 0x0007 }
 Provides attributes for list items. More...

Public Member Functions

IMPORT_C ~CListItemDrawer ()
 Destructor.
virtual IMPORT_C void DrawItem (TInt aItemIndex, TPoint aItemRectPos, TBool aItemIsSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed) const
 Draws the entire item.
virtual IMPORT_C void ClearRect (const TRect &aRect) const
 Clears the specified rectangle of this object's graphics context.
virtual IMPORT_C TInt ItemWidthInPixels (TInt aItemIndex) const
 Gets the width of the specified item.
virtual IMPORT_C TSize MinimumCellSize () const
 Gets the minimum cell size.
virtual IMPORT_C void SetGc (CWindowGc *aGc)
 Sets the graphics context which this object uses for drawing.
IMPORT_C CWindowGc * Gc () const
 Gets graphics context which is used for drawing.
virtual IMPORT_C void SetMarkColumnWidth (TInt aWidthInPixels)
 Sets the width of the column containing the mark.
virtual IMPORT_C void SetMarkGutter (TInt aGapInPixels)
 Sets the width of the gap between the column containing the lists item marks and the text column.
IMPORT_C TInt MarkColumn () const
 Gets mark column width.
IMPORT_C TInt MarkGutter () const
 Gets the width of the gap between the column containig the lists item marks and the text column.
virtual IMPORT_C void SetItemCellSize (const TSize &aSizeInPixels)
 Sets the item cell size.
IMPORT_C TSize ItemCellSize () const
 Gets current item cell size.
virtual IMPORT_C void SetViewRect (const TRect &aRect)
 Sets the viewing rectangle for this item drawer.
IMPORT_C void SetDrawMark (TBool aDrawMark)
 Sets whether item tick marks are drawn.
virtual IMPORT_C TRect MatcherCursorRect (const TDesC &aMatchableText, TInt aCharPos, TInt aItemCellYPos, TInt aCurrentItemIndex) const
 Gets a rectangle describing where the matcher cursor should be drawn.
virtual IMPORT_C TInt MatcherCursorAscent (TInt aCurrentItemIndex) const
 Gets the ascent of the matcher cursor.
virtual IMPORT_C void DrawItemMark (TBool aItemIsSelected, TBool aViewIsDimmed, const TPoint &aMarkPos) const
 Not Used in S60.
IMPORT_C void SetSymbolFont (const CFont *aFont)
 Sets symbol font for the item drawer.
IMPORT_C void SetVerticalInterItemGap (TInt aGapInPixels)
 Sets the vertical gap between items in the list.
IMPORT_C void SetData (CListBoxData *aData)
 Sets the font storage data for the item drawer and transfer ownership of that data.
IMPORT_C CFont * Font (TInt aItemIndex) const
 Gets the font for the specified item.
virtual IMPORT_C TListItemProperties Properties (TInt aItemIndex) const
 Gets the colour and style properties of the specified item.
IMPORT_C void DrawFrame (CWindowGc &aGc, const TRect &aRect, TInt aFlags) const
 Draws the frame.
void SetTextColor (TRgb aColor)
 Sets the colour used to draw non-highlighted text.
void SetBackColor (TRgb aColor)
 Sets the colour used to draw the background for non-highlighted items.
void SetHighlightedTextColor (TRgb aColor)
 Sets the colour used to draw highlighted text.
void SetHighlightedBackColor (TRgb aColor)
 Sets the colour used to draw the background for highlighted items.
void SetDimmedTextColor (TRgb aColor)
 Sets the colour used to draw dimmed text.
void SetDimmedBackColor (TRgb aColor)
 Sets the colour used to draw the background for dimmed items.
TRgb TextColor () const
 Gets the colour used to draw non-highlighted text.
TRgb BackColor () const
 Gets the colour used to draw the background for non-highlighted items.
TRgb HighlightedTextColor () const
 Gets the colour used to draw highlighted text.
TRgb HighlightedBackColor () const
 Gets the colour used to draw the background for highlighted items.
TRgb DimmedTextColor () const
 Gets the colour used to draw dimmed text.
TRgb DimmedBackColor () const
 Gets the colour used to draw the background for dimmed items.
TInt Flags () const
 Gets the item drawer flags.
IMPORT_C void SetFlags (TInt aFlags)
 Sets the item drawer flags.
IMPORT_C void ClearFlags (TInt aFlags)
 Sets the item drawer flags.
IMPORT_C MAknsControlContextSkinBackgroundControlContext () const
 Access to skin contexts.
IMPORT_C void SetSkinEnabledL (TBool aEnabled)
 Ability to enable skins in listboxes.

Protected Member Functions

IMPORT_C CListItemDrawer ()
 C++ default constructor.
virtual void DrawActualItem (TInt aItemIndex, const TRect &aActualItemRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed, TBool aItemIsSelected) const =0
 Draws item text.
virtual IMPORT_C void ResetGc () const
 Resets the pen style, brush style, brush colour etc.
TRgb MarkColor () const
 Gets the colour used to draw tick marks.
IMPORT_C TInt VerticalInterItemGap () const
 Gets the vertical gap between items in pixels.
IMPORT_C void SetupGc (TInt aItemIndex) const
 Sets up the graphics context for the specified item.

Protected Attributes

TSize iItemCellSize
 Item's cell size.
TInt iMarkGutter
 Mark gutter.
TInt iMarkColumnWidth
 Mark column width.
TRect iViewRect
 View area.
TBool iDrawMark
 Draw mark.
CWindowGc * iGc
 Graphics context controller.
TRgb iTextColor
 Color of text.
TRgb iBackColor
 Background color.
TRgb iHighlightedTextColor
 Color of highlighted text.
TRgb iHighlightedBackColor
 Highlighted background color.
TRgb iDimmedTextColor
 Color of dimmed text.
TRgb iDimmedBackColor
 Color of dimmed background.
TRgb iMarkColor
 Mark color.
CListBoxDataiData
 Data model.

Member Enumeration Documentation

enum CListItemDrawer::TFlags
 

Provides list box attributes for handling multiple selections.

These flags can be set using the CListItemDrawer::SetFlags function.

Enumerator:
EDrawMarkSelection  If set, specifies the inclusion of a gap into which a tick mark can be drawn if the item is selected.

This is used in the following CListItemDrawer class functions: DrawItem(), DrawItemMark(), SetDrawMark()

EPaintedSelection  If set, draws a highlight over a selected list item.

This is used in the CTextListItemDrawer::DoDrawItemText() function.

EDrawOnlyActiveSelection  This flag is not supported.
EDisableHighlight  If set highlight is disabled.
enum CListItemDrawer::TListItemAttribute
 

Provides attributes for list items.

Enumerator:
ECurrent  Highlight for current text.
EEmphasized  Highlight for text when the listbox view is emphasized.

This is used in the following CListBoxView class functions: DrawItem(), DrawMatcherCursor(), SetEmphasized().

ESelected  Highlight for text that is selected.

This is used in the following functions: CColumnListBoxItemDrawer::DrawItemText(), CHierarchicalListItemDrawer::DrawActualItem(), CDirContentsListItemDrawer::DrawActualItem().

EMask  Sum of all the above attributes.

This last attribute is used to control that one can use only valid attributes above. So do not use it at all.


Constructor & Destructor Documentation

IMPORT_C CListItemDrawer::~CListItemDrawer  ) 
 

Destructor.

IMPORT_C CListItemDrawer::CListItemDrawer  )  [protected]
 

C++ default constructor.


Member Function Documentation

TRgb CListItemDrawer::BackColor  )  const [inline]
 

Gets the colour used to draw the background for non-highlighted items.

Returns:
Background colour.
IMPORT_C void CListItemDrawer::ClearFlags TInt  aFlags  ) 
 

Sets the item drawer flags.

Parameters:
aFlags The new item drawer flags.
virtual IMPORT_C void CListItemDrawer::ClearRect const TRect &  aRect  )  const [virtual]
 

Clears the specified rectangle of this object's graphics context.

Parameters:
aRect Rectangle to clear.
TRgb CListItemDrawer::DimmedBackColor  )  const [inline]
 

Gets the colour used to draw the background for dimmed items.

Returns:
The background colour for dimmed items.
TRgb CListItemDrawer::DimmedTextColor  )  const [inline]
 

Gets the colour used to draw dimmed text.

Returns:
The dimmed text colour.
virtual void CListItemDrawer::DrawActualItem TInt  aItemIndex,
const TRect &  aActualItemRect,
TBool  aItemIsCurrent,
TBool  aViewIsEmphasized,
TBool  aViewIsDimmed,
TBool  aItemIsSelected
const [protected, pure virtual]
 

Draws item text.

This function is called by CListItemDrawer::DrawItem() with appropriate arguments. Its purpose is to draw the actual item

  • everything other than the item mark - into the graphics context.
Parameters:
aItemIndex Which item to draw.
aActualItemRect Where the item should be drawn.
aItemIsCurrent Whether the item is current.
aViewIsEmphasized Whether the list box view is emphasised.
aViewIsDimmed Whether the list box view is dimmed.
aItemIsSelected Whether the list box item is selected.

Implemented in CTextListItemDrawer.

IMPORT_C void CListItemDrawer::DrawFrame CWindowGc &  aGc,
const TRect &  aRect,
TInt  aFlags
const
 

Draws the frame.

Uses the colours set with the fonts and colour functions described above.

Deprecated:
Parameters:
aGc The graphics context used to draw the frame.
aRect The frame's rectangle.
aFlags The item drawer flags.
virtual IMPORT_C void CListItemDrawer::DrawItem TInt  aItemIndex,
TPoint  aItemRectPos,
TBool  aItemIsSelected,
TBool  aItemIsCurrent,
TBool  aViewIsEmphasized,
TBool  aViewIsDimmed
const [virtual]
 

Draws the entire item.

This function is called by the list box view. As implemented in CListItemDrawer, this function draws the item text using DrawActualItem(), and an item mark using DrawItemMark().

Parameters:
aItemIndex Index of the item to draw.
aItemRectPos Position of the rectangle to draw.
aItemIsSelected Whether the item is selected.
aItemIsCurrent Whether the item is current.
aViewIsEmphasized Whether the list box view has the emphasised flag set (see CListBoxView::SetEmphasized()).
aViewIsDimmed Whether the list box view has its dimmed flag set (see CListBoxView::SetDimmed()).

Reimplemented in CSingleHeadingStyleItemDrawer, CDoubleLargeStyleItemDrawer, and CWordWrappedFormattedCellItemDrawer.

virtual IMPORT_C void CListItemDrawer::DrawItemMark TBool  aItemIsSelected,
TBool  aViewIsDimmed,
const TPoint &  aMarkPos
const [virtual]
 

Not Used in S60.

Reimplemented in CColumnListBoxItemDrawer, and CFormattedCellListBoxItemDrawer.

TInt CListItemDrawer::Flags  )  const [inline]
 

Gets the item drawer flags.

Returns:
The item drawer flags.
IMPORT_C CFont* CListItemDrawer::Font TInt  aItemIndex  )  const
 

Gets the font for the specified item.

The function returns NULL if no font storage data has been set.

Parameters:
aItemIndex The index of the item for which the font is returned.
Returns:
The item's font.

Reimplemented in CTextListItemDrawer.

IMPORT_C CWindowGc* CListItemDrawer::Gc  )  const
 

Gets graphics context which is used for drawing.

Returns:
Pointer to the graphics context used for drawing.
TRgb CListItemDrawer::HighlightedBackColor  )  const [inline]
 

Gets the colour used to draw the background for highlighted items.

Returns:
The highlighted background colour.
TRgb CListItemDrawer::HighlightedTextColor  )  const [inline]
 

Gets the colour used to draw highlighted text.

Returns:
The highlighted text colour.
IMPORT_C TSize CListItemDrawer::ItemCellSize  )  const
 

Gets current item cell size.

Returns:
Item cell size
virtual IMPORT_C TInt CListItemDrawer::ItemWidthInPixels TInt  aItemIndex  )  const [virtual]
 

Gets the width of the specified item.

Parameters:
aItemIndex The index of the item whose width is to be returned.
Returns:
The width of the item. This is 0 in CListItemDrawer

Reimplemented in CColumnListBoxItemDrawer, CFormattedCellListBoxItemDrawer, and CTextListItemDrawer.

TRgb CListItemDrawer::MarkColor  )  const [inline, protected]
 

Gets the colour used to draw tick marks.

A tick mark usually indicates that an item is selected.

Returns:
The tick mark colour.
IMPORT_C TInt CListItemDrawer::MarkColumn  )  const
 

Gets mark column width.

Returns:
Mark column width.
IMPORT_C TInt CListItemDrawer::MarkGutter  )  const
 

Gets the width of the gap between the column containig the lists item marks and the text column.

Returns:
Size of the inter-column gutter.
virtual IMPORT_C TInt CListItemDrawer::MatcherCursorAscent TInt  aCurrentItemIndex  )  const [virtual]
 

Gets the ascent of the matcher cursor.

This is obtained for the item at index aCurrentItemIndex. The function returns 0 by default.

Deprecated:
Parameters:
aCurrentItemIndex Item index of the target item.
Returns:
The height of the matcher cursor.

Reimplemented in CTextListItemDrawer.

virtual IMPORT_C TRect CListItemDrawer::MatcherCursorRect const TDesC &  aMatchableText,
TInt  aCharPos,
TInt  aItemCellYPos,
TInt  aCurrentItemIndex
const [virtual]
 

Gets a rectangle describing where the matcher cursor should be drawn.

The default behavious is to return uninitialised TRect.

Deprecated:
Parameters:
aMatchableText The text of the currently matched string.
aCharPos The position in the string of the character just matched in the current incremental match.
aItemCellYPos Y position of the item cell.
aCurrentItemIndex Item index for the current item.
Returns:
Where the cursor should be drawn.

Reimplemented in CTextListItemDrawer.

virtual IMPORT_C TSize CListItemDrawer::MinimumCellSize  )  const [virtual]
 

Gets the minimum cell size.

Returns:
The minimum size for a cell. This is TSize(0, 0) in CListItemDrawer.

Reimplemented in CColumnListBoxItemDrawer, CFormattedCellListBoxItemDrawer, and CTextListItemDrawer.

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

Gets the colour and style properties of the specified item.

Parameters:
aItemIndex The index of the item for which properties are obtained (Not Used).
Returns:
The item's properties.

Reimplemented in CColumnListBoxItemDrawer, and CFormattedCellListBoxItemDrawer.

virtual IMPORT_C void CListItemDrawer::ResetGc  )  const [protected, virtual]
 

Resets the pen style, brush style, brush colour etc.

to suitable starting values for this class.

This function is called after every drawing operation.

Reimplemented in CTextListItemDrawer.

void CListItemDrawer::SetBackColor TRgb  aColor  )  [inline]
 

Sets the colour used to draw the background for non-highlighted items.

Parameters:
aColor The background colour.
IMPORT_C void CListItemDrawer::SetData CListBoxData aData  ) 
 

Sets the font storage data for the item drawer and transfer ownership of that data.

Parameters:
aData Font storage data .
void CListItemDrawer::SetDimmedBackColor TRgb  aColor  )  [inline]
 

Sets the colour used to draw the background for dimmed items.

Parameters:
aColor The background colour for dimmed items.
void CListItemDrawer::SetDimmedTextColor TRgb  aColor  )  [inline]
 

Sets the colour used to draw dimmed text.

Parameters:
aColor The dimmed text colour.
IMPORT_C void CListItemDrawer::SetDrawMark TBool  aDrawMark  ) 
 

Sets whether item tick marks are drawn.

If the draw mark flag iDrawMark is set, DrawItem() leaves space for the marks column to the left of the text column, and DrawItemMark() draws the item marks.

Parameters:
aDrawMark New value for iDrawMark.
IMPORT_C void CListItemDrawer::SetFlags TInt  aFlags  ) 
 

Sets the item drawer flags.

Parameters:
aFlags The new item drawer flags.
virtual IMPORT_C void CListItemDrawer::SetGc CWindowGc *  aGc  )  [virtual]
 

Sets the graphics context which this object uses for drawing.

Parameters:
aGc Pointer to the context to use.

Reimplemented in CTextListItemDrawer.

void CListItemDrawer::SetHighlightedBackColor TRgb  aColor  )  [inline]
 

Sets the colour used to draw the background for highlighted items.

Parameters:
aColor The highlighted background colour.
void CListItemDrawer::SetHighlightedTextColor TRgb  aColor  )  [inline]
 

Sets the colour used to draw highlighted text.

Parameters:
aColor The highlighted text colour.
virtual IMPORT_C void CListItemDrawer::SetItemCellSize const TSize &  aSizeInPixels  )  [virtual]
 

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 in CColumnListBoxItemDrawer, and CFormattedCellListBoxItemDrawer.

virtual IMPORT_C void CListItemDrawer::SetMarkColumnWidth TInt  aWidthInPixels  )  [virtual]
 

Sets the width of the column containing the mark.

Parameters:
aWidthInPixels New width for the mark column.
virtual IMPORT_C void CListItemDrawer::SetMarkGutter TInt  aGapInPixels  )  [virtual]
 

Sets the width of the gap between the column containing the lists item marks and the text column.

Parameters:
aGapInPixels New gap size.
IMPORT_C void CListItemDrawer::SetSkinEnabledL TBool  aEnabled  ) 
 

Ability to enable skins in listboxes.

Parameters:
aEnabled parameter for enabling/disabling skin. ETrue enables skin, EFalse disables skin
IMPORT_C void CListItemDrawer::SetSymbolFont const CFont *  aFont  ) 
 

Sets symbol font for the item drawer.

The symbol font is used to draw the standard tick item marks.

Parameters:
aFont The font to be used.
void CListItemDrawer::SetTextColor TRgb  aColor  )  [inline]
 

Sets the colour used to draw non-highlighted text.

Parameters:
aColor The text colour.
IMPORT_C void CListItemDrawer::SetupGc TInt  aItemIndex  )  const [protected]
 

Sets up the graphics context for the specified item.

Parameters:
aItemIndex The item for which the graphics context will be set up.
IMPORT_C void CListItemDrawer::SetVerticalInterItemGap TInt  aGapInPixels  ) 
 

Sets the vertical gap between items in the list.

Parameters:
aGapInPixels New value for the vertical gap between items in pixels.
virtual IMPORT_C void CListItemDrawer::SetViewRect const TRect &  aRect  )  [virtual]
 

Sets the viewing rectangle for this item drawer.

This value is not used by the CListItemViewer, but may be used by its derived classes.

Parameters:
aRect New value for iViewRect.
IMPORT_C MAknsControlContext* CListItemDrawer::SkinBackgroundControlContext  )  const
 

Access to skin contexts.

Returns:
Pointer to skin background control context.
TRgb CListItemDrawer::TextColor  )  const [inline]
 

Gets the colour used to draw non-highlighted text.

Returns:
The text colour.
IMPORT_C TInt CListItemDrawer::VerticalInterItemGap  )  const [protected]
 

Gets the vertical gap between items in pixels.

Returns:
The vertical gap between items in pixels.

Field Documentation

TRgb CListItemDrawer::iBackColor [protected]
 

Background color.

CListBoxData* CListItemDrawer::iData [protected]
 

Data model.

TRgb CListItemDrawer::iDimmedBackColor [protected]
 

Color of dimmed background.

TRgb CListItemDrawer::iDimmedTextColor [protected]
 

Color of dimmed text.

TBool CListItemDrawer::iDrawMark [protected]
 

Draw mark.

CWindowGc* CListItemDrawer::iGc [protected]
 

Graphics context controller.

TRgb CListItemDrawer::iHighlightedBackColor [protected]
 

Highlighted background color.

TRgb CListItemDrawer::iHighlightedTextColor [protected]
 

Color of highlighted text.

TSize CListItemDrawer::iItemCellSize [protected]
 

Item's cell size.

TRgb CListItemDrawer::iMarkColor [protected]
 

Mark color.

TInt CListItemDrawer::iMarkColumnWidth [protected]
 

Mark column width.

TInt CListItemDrawer::iMarkGutter [protected]
 

Mark gutter.

TRgb CListItemDrawer::iTextColor [protected]
 

Color of text.

TRect CListItemDrawer::iViewRect [protected]
 

View area.


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

Copyright © Nokia Corporation 2001-2008
Back to top