CTextListItemDrawer Class Reference

#include <mw/eiklbi.h>

Link against: ConnectionUiUtilities.lib

class CTextListItemDrawer : public CListItemDrawer

Inherits from

Protected Attributes
const CFont *iFont
MTextListBoxModel *iModel
Public Member Functions
CTextListItemDrawer()
CTextListItemDrawer(MTextListBoxModel *, const CFont *)
~CTextListItemDrawer()
IMPORT_C voidConstructL(const CFont *)
virtual IMPORT_C voidDrawActualItem(TInt, const TRect &, TBool, TBool, TBool, TBool)
IMPORT_C const CFont *Font(TInt)
TInt ItemMarkPosition()
TPtrC ItemMarkReplacement()
TBool ItemMarkReverse()
virtual IMPORT_C TIntItemWidthInPixels(TInt)
virtual IMPORT_C TIntMatcherCursorAscent(TInt)
virtual IMPORT_C TRectMatcherCursorRect(const TDesC &, TInt, TInt, TInt)
virtual IMPORT_C TSizeMinimumCellSize()
IMPORT_C voidSetCellWidthInChars(TInt)
IMPORT_C voidSetFont(const CFont *)
virtual IMPORT_C voidSetGc(CWindowGc *)
voidSetItemMarkPosition(TInt)
voidSetItemMarkReplacement(const TDesC &)
voidSetItemMarkReverse(TBool)
IMPORT_C voidSetSearchStringL(const TDesC *)
Protected Member Functions
virtual IMPORT_C voidDoDrawItemText(const TDesC &, const TRect &, TBool, TBool, TBool, TInt)
virtual IMPORT_C voidDrawItemText(TInt, const TRect &, TBool, TBool, TBool)
virtual IMPORT_C voidResetGc()
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
Inherited Enumerations
CListItemDrawer:TFlags
CListItemDrawer:TListItemAttribute
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()

Detailed Description

Item drawer which can handle text.

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

Member Attribute Documentation

iFont

const CFont *iFont[protected]

Font used by the drawer.

iModel

MTextListBoxModel *iModel[protected]

List box model for the drawer.

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.

ParameterDescription
aTextListBoxModelThe model whose items will be drawn.
aFontThe font in which the items will be drawn.

~CTextListItemDrawer ( )

IMPORT_C~CTextListItemDrawer()

Destructor.

Member Function Documentation

ConstructL ( const CFont * )

IMPORT_C voidConstructL(const CFont *aFont)

Handles 2nd phase construction.

ParameterDescription
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.

ParameterDescription
aDesThe string to draw.
aItemTextRectArea to draw into.
aItemIsCurrentETrue if the item is current.
aViewIsEmphasizedETrue if the view is emphasised.
aItemIsSelectedETrue if the item is selected.
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]

Reimplemented from CListItemDrawer::DrawActualItem(TInt,const TRect &,TBool,TBool,TBool,TBool)const

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

ParameterDescription
aItemIndexIndex of the item to draw.
aActualItemRectArea to draw into.
aItemIsCurrentETrue if the item is current.
aViewIsEmphasizedETrue if the view is emphasised.
aViewIsDimmedIgnored
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.

ParameterDescription
aItemIndexIndex of the item to draw.
aItemTextRectArea to draw into.
aItemIsCurrentETrue if the item is current.
aViewIsEmphasizedETrue if the view is emphasised.
aItemIsSelectedETrue if the item is selected.

Font ( TInt )

IMPORT_C const CFont *Font(TIntaIndex)const

Reimplemented from CListItemDrawer::Font(TInt)const

Gets font for the specified item.

ParameterDescription
aIndexThe index of the target item.

Returns: Specified item's font.

ItemMarkPosition ( )

TInt ItemMarkPosition()const [inline]

Gets item mark position.

Returns: Position of the Item mark.

ItemMarkReplacement ( )

TPtrC ItemMarkReplacement()const [inline]

Gets item mark replacement.

Returns: Pointer to the replacement string.

ItemMarkReverse ( )

TBool ItemMarkReverse()const [inline]

Check if the item has been marked reversed is active.

Returns: Indicates if active or not. ETrue if active

ItemWidthInPixels ( TInt )

IMPORT_C TIntItemWidthInPixels(TIntaItemIndex)const [virtual]

Reimplemented from CListItemDrawer::ItemWidthInPixels(TInt)const

Gets the width in pixels of the specified item.

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

Returns: The specified item s width in pixels.

MatcherCursorAscent ( TInt )

IMPORT_C TIntMatcherCursorAscent(TIntaCurrentItemIndex)const [virtual]

Reimplemented from CListItemDrawer::MatcherCursorAscent(TInt)const

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.

Deprecated

ParameterDescription
aCurrentItemIndexIndex of the current item. Not Used.

Returns: Always returns 0;

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

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

Reimplemented from CListItemDrawer::MatcherCursorRect(const TDesC &,TInt,TInt,TInt)const

Gets the position and size of the matcher cursor.

Deprecated

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

Returns: The rectangle covered by the matcher cursor, in pixels.

MinimumCellSize ( )

IMPORT_C TSizeMinimumCellSize()const [virtual]

Reimplemented from CListItemDrawer::MinimumCellSize()const

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.

ResetGc ( )

IMPORT_C voidResetGc()const [protected, virtual]

Reimplemented from CListItemDrawer::ResetGc()const

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().

ParameterDescription
aNumOfCharsToDisplayInCellNumber of characters to display in a cell.

SetFont ( const CFont * )

IMPORT_C voidSetFont(const CFont *aFont)

Sets the font.

ParameterDescription
aFontThe new font.

SetGc ( CWindowGc * )

IMPORT_C voidSetGc(CWindowGc *aGc)[virtual]

Reimplemented from CListItemDrawer::SetGc(CWindowGc *)

Sets the graphics context.

ParameterDescription
aGcThe graphics context to use.

SetItemMarkPosition ( TInt )

voidSetItemMarkPosition(TIntaPos)[inline]

Sets item mark position.

ParameterDescription
aPosThe new position.

SetItemMarkReplacement ( const TDesC & )

voidSetItemMarkReplacement(const TDesC &aReplacement)[inline]

Sets the item mark replacement.

ParameterDescription
aReplacementThe new replacement descriptor.

SetItemMarkReverse ( TBool )

voidSetItemMarkReverse(TBoolaReverse)[inline]

Sets item mark reverse to be active or not.

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

SetSearchStringL ( const TDesC * )

IMPORT_C voidSetSearchStringL(const TDesC *aSearchString)

Sets the search string.

ParameterDescription
aSearchStringThe new search string.