Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: eiklbi.h
Link against: eikcoctl.lib

Class CTextListItemDrawer

CTextListItemDrawer

Support

Supported from 6.0

Description

Item drawer which can handle text. Used by CListBoxView to draw individual list box items for a CEikTextListBox.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CListItemDrawerDraws individual list box items for a CListBoxView
CTextListItemDrawerItem drawer which can handle text

Defined in CTextListItemDrawer:
CTextListItemDrawer(), ConstructL(), DoDrawItemText(), DrawActualItem(), DrawItemText(), Font(), ItemWidthInPixels(), MatcherCursorAscent(), MatcherCursorRect(), MinimumCellSize(), ResetGc(), SetCellWidthInChars(), SetFont(), SetGc(), SetSearchStringL(), iFont, iModel, ~CTextListItemDrawer()

Inherited from CBase:
operator new()

Inherited from CListItemDrawer:
BackColor(), ClearFlags(), ClearRect(), DimmedBackColor(), DimmedTextColor(), DrawFrame(), DrawItem(), DrawItemMark(), ECurrent, EDrawMarkSelection, EDrawOnlyActiveSelection, EEmphasized, EMask, EPaintedSelection, ESelected, Flags(), Gc(), HighlightedBackColor(), HighlightedTextColor(), MarkColor(), MarkColumn(), MarkGutter(), Properties(), SetBackColor(), SetData(), SetDimmedBackColor(), SetDimmedTextColor(), SetDrawMark(), SetFlags(), SetHighlightedBackColor(), SetHighlightedTextColor(), SetItemCellSize(), SetMarkColumnWidth(), SetMarkGutter(), SetSymbolFont(), SetTextColor(), SetVerticalInterItemGap(), SetViewRect(), SetupGc(), TFlags, TListItemAttribute, TextColor(), VerticalInterItemGap(), iBackColor, iData, iDimmedBackColor, iDimmedTextColor, iDrawMark, iGc, iHighlightedBackColor, iHighlightedTextColor, iItemCellSize, iMarkColor, iMarkColumnWidth, iMarkGutter, iTextColor, iViewRect


Construction and destruction


CTextListItemDrawer()

CTextListItemDrawer();

Description

Default constructor.


CTextListItemDrawer()

CTextListItemDrawer (MTextListBoxModel* aTextListBoxModel, const CFont* aFont);

Description

Constructs a new text item drawer which draws the data of the specified model using the supplied font.

Parameters

MTextListBoxModel* aTextListBoxModel

The model whose items will be drawn.

const CFont* aFont

The font in which the items will be drawn.


ConstructL()

void ConstructL(const CFont* aFont);

Description

Completes construction.

Parameters

const CFont* aFont

The font in which the list box items will be drawn.


~CTextListItemDrawer()

~CTextListItemDrawer();

Description

Deallocates this item drawer.

[Top]


Drawing


DrawActualItem()

virtual void DrawActualItem(TInt aItemIndex, const TRect& aActualItemRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool, TBool aItemIsSelected) const;

Description

Draws the actual item contents for the specified item in the specified rectangle.

Parameters

TInt aItemIndex

Index of the item to draw.

const TRect& aActualItemRect

Area to draw into.

TBool aItemIsCurrent

ETrue if the item is current.

TBool aViewIsEmphasized

ETrue if the view is emphasised.

TBool

Ignored.

TBool aViewIsDimmed

ETrue if the view is dimmed.


DrawItemText()

protected: virtual void DrawItemText(TInt aItemIndex,const TRect& aItemTextRect,TBool aItemIsCurrent,TBool aViewIsEmphasized) const;

Description

Draw item text.

This function is invoked by DrawActualItem() to draw the item text.

Parameters

TInt aItemIndex

Index of the item to draw.

const TRect& aItemTextRect

Area to draw into.

TBool aItemIsCurrent

ETrue if the item is current.

TBool aViewIsEmphasized

ETrue if the view is emphasised.


DoDrawItemText()

protected: void DoDrawItemText (const TDesC& aDes, const TRect& aItemTextRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aItemIsSelected, TInt aItemIndex) const;

Description

Draws text.

This function is invoked by DrawItemText() to draw a string into a rectangular area of iGc.

Parameters

const TDesC& aDes

The string to draw.

const TRect& aItemTextRect

Area to draw into.

TBool aItemIsCurrent

ETrue if the item is current.

TBool aViewIsEmphasized

ETrue if the view is emphasised.

TBool aItemIsSelected

ETrue if the item is selected.

TInt aItemIndex

The item’s index.

[Top]


Sizes


SetCellWidthInChars()

void SetCellWidthInChars(TInt aNumOfCharsToDisplayInCell);

Description

Sets the number of characters in a cell. This value affects only MinimumCellSize().

Parameters

TInt aNumOfCharsToDisplayInCell

Number of characters to display in a cell.


ItemWidthInPixels()

TInt ItemWidthInPixels(TInt aItemIndex) const;

Description

Gets the width in pixels of the specified item.

Parameters

TInt aItemIndex

The index of the item for which the width is obtained.

Return value

TInt

The specified item’s width in pixels.


MinimumCellSize()

virtual TSize MinimumCellSize() const;

Description

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

Return value

TSize

The minimum size for a cell, in pixels.

See also:

[Top]


Graphics context


SetGc()

virtual void SetGc(CWindowGc* aGc);

Description

Sets the graphics context.

Parameters

CWindowGc* aGc

The graphics context to use.


ResetGc()

protected: virtual void ResetGc() const;

Description

Resets the graphics context.

This function invokes CListItemDrawer::ResetGc() and resets the pen colour to iTextColor.

[Top]


Matcher cursor


MatcherCursorRect()

virtual TRect MatcherCursorRect(const TDesC& aMatchableText,TInt aCharPos,TInt aItemCellYPos) const;

Description

Gets the position and size of the matcher cursor.

See also

CListItemDrawer::MatcherCursorRect()

Parameters

const TDesC& aMatchableText

String currently being matched.

TInt aCharPos

Position within the string.

TInt aItemCellYPos

Y position of the item cell in pixels.

Return value

TRect

The rectangle covered by the matcher cursor, in pixels.


MatcherCursorAscent()

TInt MatcherCursorAscent( TInt aCurrentItemIndex ) const;

Description

Gets the ascent of the matcher cursor in pixels.

Parameters

TInt aCurrentItemIndex

Index of the current item.

Return value

TInt

The ascent of the matcher cursor in pixels.

[Top]


Fonts


Font()

const CFont* Font(TInt aItemIndex) const;

Description

Gets the font for the specified item.

Parameters

TInt aItemIndex

The index of the item for which the font is obtained.

Return value

CFont*

The specified item’s font.


SetFont()

void SetFont(const CFont* aFont);

Description

Sets the font.

Parameters

const CFont* aFont

The new font.

[Top]


Search string


SetSearchStringL()

void SetSearchStringL(const TDesC* aSearchString);

Description

Sets the search string.

Parameters

const TDesC* aSearchString

The new search string.

[Top]


Protected data members


iFont

const CFont* iFont

Description

Font for drawing the data.


iModel

MTextListBoxModel* iModel

Description

Pointer to the text list model whose data should be drawn.