CTextListItemDrawer Class Reference

class CTextListItemDrawer : public CListItemDrawer

Item drawer which can handle text.

Used by CListBoxView to draw individual list box items for a CEikTextListBox

Inherits from

Public Member Functions
CTextListItemDrawer()
CTextListItemDrawer(MTextListBoxModel *, const CFont *)
~CTextListItemDrawer()
IMPORT_C voidConstructL(const CFont *)
IMPORT_C voidDrawActualItem(TInt, const TRect &, TBool, TBool, TBool, TBool)
IMPORT_C const CFont *Font(TInt)
TInt ItemMarkPosition()
TPtrC ItemMarkReplacement()
TBool ItemMarkReverse()
IMPORT_C TIntItemWidthInPixels(TInt)
IMPORT_C TIntMatcherCursorAscent(TInt)
IMPORT_C TRectMatcherCursorRect(const TDesC &, TInt, TInt, TInt)
IMPORT_C TSizeMinimumCellSize()
IMPORT_C voidSetCellWidthInChars(TInt)
IMPORT_C voidSetFont(const CFont *)
IMPORT_C voidSetGc(CWindowGc *)
voidSetItemMarkPosition(TInt)
voidSetItemMarkReplacement(const TDesC &)
voidSetItemMarkReverse(TBool)
IMPORT_C voidSetSearchStringL(const TDesC *)
Protected Member Functions
IMPORT_C voidDoDrawItemText(const TDesC &, const TRect &, TBool, TBool, TBool, TInt)
IMPORT_C voidDrawItemText(TInt, const TRect &, TBool, TBool, TBool)
IMPORT_C voidResetGc()
Private Member Functions
IMPORT_C TAny *Reserved_1()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CListItemDrawer::BackColor()const
CListItemDrawer::CListItemDrawer()
CListItemDrawer::ClearFlags(TInt)
CListItemDrawer::ClearRect(const TRect &)const
CListItemDrawer::DimmedBackColor()const
CListItemDrawer::DimmedTextColor()const
CListItemDrawer::DrawFrame(CWindowGc &,const TRect &,TInt)const
CListItemDrawer::DrawItem(TInt,TPoint,TBool,TBool,TBool,TBool)const
CListItemDrawer::DrawItemMark(TBool,TBool,const TPoint &)const
CListItemDrawer::Flags()const
CListItemDrawer::Gc()const
CListItemDrawer::HighlightedBackColor()const
CListItemDrawer::HighlightedTextColor()const
CListItemDrawer::ItemCellSize()const
CListItemDrawer::MarkColor()const
CListItemDrawer::MarkColumn()const
CListItemDrawer::MarkGutter()const
CListItemDrawer::Properties(TInt)const
CListItemDrawer::SetBackColor(TRgb)
CListItemDrawer::SetData(CListBoxData *)
CListItemDrawer::SetDimmedBackColor(TRgb)
CListItemDrawer::SetDimmedTextColor(TRgb)
CListItemDrawer::SetDrawMark(TBool)
CListItemDrawer::SetFlags(TInt)
CListItemDrawer::SetHighlightedBackColor(TRgb)
CListItemDrawer::SetHighlightedTextColor(TRgb)
CListItemDrawer::SetItemCellSize(const TSize &)
CListItemDrawer::SetMarkColumnWidth(TInt)
CListItemDrawer::SetMarkGutter(TInt)
CListItemDrawer::SetSkinEnabledL(TBool)
CListItemDrawer::SetSymbolFont(const CFont *)
CListItemDrawer::SetTextColor(TRgb)
CListItemDrawer::SetVerticalInterItemGap(TInt)
CListItemDrawer::SetViewRect(const TRect &)
CListItemDrawer::SetupGc(TInt)const
CListItemDrawer::SkinBackgroundControlContext()const
CListItemDrawer::TextColor()const
CListItemDrawer::VerticalInterItemGap()const
CListItemDrawer::~CListItemDrawer()
Inherited Enumerations
CListItemDrawer:TFlags
CListItemDrawer:TListItemAttribute
Protected Attributes
const CFont *iFont
MTextListBoxModel *iModel
Private Attributes
TInt iItemMarkPos
TPtrC iItemMarkReplacement
TBool iItemMarkReverse
TInt iNumOfCharsInCell
Inherited Attributes
CListItemDrawer::iBackColor
CListItemDrawer::iData
CListItemDrawer::iDimmedBackColor
CListItemDrawer::iDimmedTextColor
CListItemDrawer::iDrawMark
CListItemDrawer::iGc
CListItemDrawer::iHighlightedBackColor
CListItemDrawer::iHighlightedTextColor
CListItemDrawer::iItemCellSize
CListItemDrawer::iMarkColor
CListItemDrawer::iMarkColumnWidth
CListItemDrawer::iMarkGutter
CListItemDrawer::iTextColor
CListItemDrawer::iViewRect

Constructor & Destructor Documentation

CTextListItemDrawer()

IMPORT_CCTextListItemDrawer()

C++ default constructor.

CTextListItemDrawer(MTextListBoxModel *, const CFont *)

IMPORT_CCTextListItemDrawer(MTextListBoxModel *aTextListBoxModel,
const CFont *aFont
)

C++ default constructor.

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

Parameters

MTextListBoxModel * aTextListBoxModelThe model whose items will be drawn.
const CFont * aFontThe font in which the items will be drawn.

~CTextListItemDrawer()

IMPORT_C~CTextListItemDrawer()

Destructor.

Member Functions Documentation

ConstructL(const CFont *)

IMPORT_C voidConstructL(const CFont *aFont)

Handles 2nd phase construction.

Parameters

const CFont * aFontThe font in which the list box items will be drawn.

DoDrawItemText(const TDesC &, const TRect &, TBool, TBool, TBool, TInt)

IMPORT_C voidDoDrawItemText(const TDesC &aDes,
const TRect &aItemTextRect,
TBoolaItemIsCurrent,
TBoolaViewIsEmphasized,
TBoolaItemIsSelected,
TIntaItemIndex
)const [protected, virtual]

Draws text.

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

Parameters

const TDesC & aDesThe string to draw.
const TRect & aItemTextRectArea to draw into.
TBool aItemIsCurrentETrue if the item is current.
TBool aViewIsEmphasizedETrue if the view is emphasised.
TBool aItemIsSelectedETrue if the item is selected.
TInt aItemIndexThe item s index.

DrawActualItem(TInt, const TRect &, TBool, TBool, TBool, TBool)

IMPORT_C voidDrawActualItem(TIntaItemIndex,
const TRect &aActualItemRect,
TBoolaItemIsCurrent,
TBoolaViewIsEmphasized,
TBoolaViewIsDimmed,
TBoolaItemIsSelected
)const [virtual]

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

Draws the actual item contents for the item at index aItemIndex in the rectangle aActualItemRect.

Parameters

TInt aItemIndexIndex of the item to draw.
const TRect & aActualItemRectArea to draw into.
TBool aItemIsCurrentETrue if the item is current.
TBool aViewIsEmphasizedETrue if the view is emphasised.
TBool aViewIsDimmedIgnored
TBool aItemIsSelectedETrue if the item is selected.

DrawItemText(TInt, const TRect &, TBool, TBool, TBool)

IMPORT_C voidDrawItemText(TIntaItemIndex,
const TRect &aItemTextRect,
TBoolaItemIsCurrent,
TBoolaViewIsEmphasized,
TBoolaItemIsSelected
)const [protected, virtual]

Draw item text.

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

Parameters

TInt aItemIndexIndex of the item to draw.
const TRect & aItemTextRectArea to draw into.
TBool aItemIsCurrentETrue if the item is current.
TBool aViewIsEmphasizedETrue if the view is emphasised.
TBool aItemIsSelectedETrue if the item is selected.

Font(TInt)

IMPORT_C const CFont *Font(TIntaIndex)const [inline]

Gets font for the specified item.

Parameters

TInt aIndexThe index of the target item.

ItemMarkPosition()

TInt ItemMarkPosition()const [inline]

Gets item mark position.

ItemMarkReplacement()

TPtrC ItemMarkReplacement()const [inline]

Gets item mark replacement.

ItemMarkReverse()

TBool ItemMarkReverse()const [inline]

Check if the item has been marked reversed is active.

ItemWidthInPixels(TInt)

IMPORT_C TIntItemWidthInPixels(TIntaItemIndex)const [virtual]

Gets the width in pixels of the specified item.

Parameters

TInt aItemIndexThe index of the item for which the width is obtained.

MatcherCursorAscent(TInt)

IMPORT_C TIntMatcherCursorAscent(TIntaCurrentItemIndex)const [virtual]

No Implementation.

Derived classes that deal with text and want to support incremental matching in listboxes need to redefine this function. Should be used to get the ascent of the matcher cursor in pixels.

Parameters

TInt aCurrentItemIndexIndex of the current item. Not Used.

MatcherCursorRect(const TDesC &, TInt, TInt, TInt)

IMPORT_C TRectMatcherCursorRect(const TDesC &aMatchableText,
TIntaCharPos,
TIntaItemCellYPos,
TIntaCurrentItemIndex
)const [virtual]

Gets the position and size of the matcher cursor.

Parameters

const TDesC & aMatchableTextString currently being matched. Not Used.
TInt aCharPosPosition within the string. Not Used.
TInt aItemCellYPosY position of the item cell in pixels. Not Used.
TInt aCurrentItemIndexItem index for the current item. Not Used.

MinimumCellSize()

IMPORT_C TSizeMinimumCellSize()const [virtual]

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

Reserved_1()

IMPORT_C TAny *Reserved_1()[private, virtual]

ResetGc()

IMPORT_C voidResetGc()const [protected, virtual]

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

SetCellWidthInChars(TInt)

IMPORT_C voidSetCellWidthInChars(TIntaNumOfCharsToDisplayInCell)

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

Parameters

TInt aNumOfCharsToDisplayInCellNumber of characters to display in a cell.

SetFont(const CFont *)

IMPORT_C voidSetFont(const CFont *aFont)

Sets the font.

Parameters

const CFont * aFontThe new font.

SetGc(CWindowGc *)

IMPORT_C voidSetGc(CWindowGc *aGc)[virtual]

Sets the graphics context.

Parameters

CWindowGc * aGcThe graphics context to use.

SetItemMarkPosition(TInt)

voidSetItemMarkPosition(TIntaPos)[inline]

Sets item mark position.

Parameters

TInt aPosThe new position.

SetItemMarkReplacement(const TDesC &)

voidSetItemMarkReplacement(const TDesC &aReplacement)[inline]

Sets the item mark replacement.

Parameters

const TDesC & aReplacementThe new replacement descriptor.

SetItemMarkReverse(TBool)

voidSetItemMarkReverse(TBoolaReverse)[inline]

Sets item mark reverse to be active or not.

Parameters

TBool aReverseThe new setting. ETrue if item is marked reversed.

SetSearchStringL(const TDesC *)

IMPORT_C voidSetSearchStringL(const TDesC *aSearchString)

Sets the search string.

Parameters

const TDesC * aSearchStringThe new search string.

Member Data Documentation

const CFont * iFont

const CFont *iFont[protected]

Font used by the drawer.

TInt iItemMarkPos

TInt iItemMarkPos[private]

TPtrC iItemMarkReplacement

TPtrC iItemMarkReplacement[private]

TBool iItemMarkReverse

TBool iItemMarkReverse[private]

MTextListBoxModel * iModel

MTextListBoxModel *iModel[protected]

List box model for the drawer.

TInt iNumOfCharsInCell

TInt iNumOfCharsInCell[private]