CTextListItemDrawer Class Reference

API published in: S60 1st Ed

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

Capability Information

Required Capabilities

None


#include <
eiklbi.h>

Inherits CListItemDrawer.

Inherited by CColumnListBoxItemDrawer, and CFormattedCellListBoxItemDrawer.


Detailed Description

Item drawer which can handle text.

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


Public Member Functions

IMPORT_C CTextListItemDrawer ()
 C++ default constructor.
IMPORT_C ~CTextListItemDrawer ()
 Destructor.
IMPORT_C CTextListItemDrawer (MTextListBoxModel *aTextListBoxModel, const CFont *aFont)
 C++ default constructor.
IMPORT_C void ConstructL (const CFont *aFont)
 Handles 2nd phase construction.
virtual IMPORT_C void DrawActualItem (TInt aItemIndex, const TRect &aActualItemRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed, TBool aItemIsSelected) const
 Draws the actual item contents for the specified item in the specified rectangle.
virtual IMPORT_C TInt ItemWidthInPixels (TInt aItemIndex) const
 Gets the width in pixels of the specified item.
virtual IMPORT_C TSize MinimumCellSize () const
 Gets the minimum size of a cell based on the font and the number of characters in the cell.
virtual IMPORT_C void SetGc (CWindowGc *aGc)
 Sets the graphics context.
IMPORT_C void SetCellWidthInChars (TInt aNumOfCharsToDisplayInCell)
 Sets the number of characters in a cell.
virtual IMPORT_C TRect MatcherCursorRect (const TDesC &aMatchableText, TInt aCharPos, TInt aItemCellYPos, TInt aCurrentItemIndex) const
 Gets the position and size of the matcher cursor.
virtual IMPORT_C TInt MatcherCursorAscent (TInt aCurrentItemIndex) const
 No Implementation.
IMPORT_C void SetFont (const CFont *aFont)
 Sets the font.
IMPORT_C void SetSearchStringL (const TDesC *aSearchString)
 Sets the search string.
IMPORT_C const CFont * Font (TInt aIndex) const
 Gets font for the specified item.
void SetItemMarkPosition (TInt aPos)
 Sets item mark position.
TInt ItemMarkPosition () const
 Gets item mark position.
void SetItemMarkReplacement (const TDesC &aReplacement)
 Sets the item mark replacement.
TPtrC ItemMarkReplacement () const
 Gets item mark replacement.
void SetItemMarkReverse (TBool aReverse)
 Sets item mark reverse to be active or not.
TBool ItemMarkReverse () const
 Check if the item has been marked reversed is active.

Protected Member Functions

virtual IMPORT_C void DoDrawItemText (const TDesC &aDes, const TRect &aItemTextRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aItemIsSelected, TInt aItemIndex) const
 Draws text.
virtual IMPORT_C void DrawItemText (TInt aItemIndex, const TRect &aItemTextRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aItemIsSelected) const
 Draw item text.
virtual IMPORT_C void ResetGc () const
 Resets the graphics context.

Protected Attributes

MTextListBoxModeliModel
 List box model for the drawer.
const CFont * iFont
 Font used by the drawer.

Constructor & Destructor Documentation

IMPORT_C CTextListItemDrawer::CTextListItemDrawer  ) 
 

C++ default constructor.

IMPORT_C CTextListItemDrawer::~CTextListItemDrawer  ) 
 

Destructor.

IMPORT_C CTextListItemDrawer::CTextListItemDrawer 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:
aTextListBoxModel The model whose items will be drawn.
aFont The font in which the items will be drawn.

Member Function Documentation

IMPORT_C void CTextListItemDrawer::ConstructL const CFont *  aFont  ) 
 

Handles 2nd phase construction.

Parameters:
aFont The font in which the list box items will be drawn.
virtual IMPORT_C void CTextListItemDrawer::DoDrawItemText const TDesC &  aDes,
const TRect &  aItemTextRect,
TBool  aItemIsCurrent,
TBool  aViewIsEmphasized,
TBool  aItemIsSelected,
TInt  aItemIndex
const [protected, virtual]
 

Draws text.

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

Parameters:
aDes The string to draw.
aItemTextRect Area to draw into.
aItemIsCurrent ETrue if the item is current.
aViewIsEmphasized ETrue if the view is emphasised.
aItemIsSelected ETrue if the item is selected.
aItemIndex The item’s index.
virtual IMPORT_C void CTextListItemDrawer::DrawActualItem TInt  aItemIndex,
const TRect &  aActualItemRect,
TBool  aItemIsCurrent,
TBool  aViewIsEmphasized,
TBool  aViewIsDimmed,
TBool  aItemIsSelected
const [virtual]
 

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

Parameters:
aItemIndex Index of the item to draw.
aActualItemRect Area to draw into.
aItemIsCurrent ETrue if the item is current.
aViewIsEmphasized ETrue if the view is emphasised.
aViewIsDimmed Ignored
aItemIsSelected ETrue if the item is selected.

Implements CListItemDrawer.

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

Draw item text.

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

Parameters:
aItemIndex Index of the item to draw.
aItemTextRect Area to draw into.
aItemIsCurrent ETrue if the item is current.
aViewIsEmphasized ETrue if the view is emphasised.
aItemIsSelected ETrue if the item is selected.

Reimplemented in CWordWrappedFormattedCellItemDrawer, CColumnListBoxItemDrawer, CFormattedCellListBoxItemDrawer, and CSettingsListBoxItemDrawer.

IMPORT_C const CFont* CTextListItemDrawer::Font TInt  aIndex  )  const
 

Gets font for the specified item.

Parameters:
aIndex The index of the target item.
Returns:
Specified item's font.

Reimplemented from CListItemDrawer.

TInt CTextListItemDrawer::ItemMarkPosition  )  const [inline]
 

Gets item mark position.

Returns:
Position of the Item mark.
TPtrC CTextListItemDrawer::ItemMarkReplacement  )  const [inline]
 

Gets item mark replacement.

Returns:
Pointer to the replacement string.
TBool CTextListItemDrawer::ItemMarkReverse  )  const [inline]
 

Check if the item has been marked reversed is active.

Returns:
Indicates if active or not. ETrue if active
virtual IMPORT_C TInt CTextListItemDrawer::ItemWidthInPixels TInt  aItemIndex  )  const [virtual]
 

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

Reimplemented in CColumnListBoxItemDrawer, and CFormattedCellListBoxItemDrawer.

virtual IMPORT_C TInt CTextListItemDrawer::MatcherCursorAscent TInt  aCurrentItemIndex  )  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.

Deprecated:
Parameters:
aCurrentItemIndex Index of the current item. Not Used.
Returns:
Always returns 0;

Reimplemented from CListItemDrawer.

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

Gets the position and size of the matcher cursor.

Deprecated:
Parameters:
aMatchableText String currently being matched. Not Used.
aCharPos Position within the string. Not Used.
aItemCellYPos Y position of the item cell in pixels. Not Used.
aCurrentItemIndex Item index for the current item. Not Used.
Returns:
The rectangle covered by the matcher cursor, in pixels.

Reimplemented from CListItemDrawer.

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

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

Reimplemented in CColumnListBoxItemDrawer, and CFormattedCellListBoxItemDrawer.

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

Resets the graphics context.

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

Reimplemented from CListItemDrawer.

IMPORT_C void CTextListItemDrawer::SetCellWidthInChars TInt  aNumOfCharsToDisplayInCell  ) 
 

Sets the number of characters in a cell.

This value affects only MinimumCellSize().

Parameters:
aNumOfCharsToDisplayInCell Number of characters to display in a cell.
IMPORT_C void CTextListItemDrawer::SetFont const CFont *  aFont  ) 
 

Sets the font.

Parameters:
aFont The new font.
virtual IMPORT_C void CTextListItemDrawer::SetGc CWindowGc *  aGc  )  [virtual]
 

Sets the graphics context.

Parameters:
aGc The graphics context to use.

Reimplemented from CListItemDrawer.

void CTextListItemDrawer::SetItemMarkPosition TInt  aPos  )  [inline]
 

Sets item mark position.

Parameters:
aPos The new position.
void CTextListItemDrawer::SetItemMarkReplacement const TDesC &  aReplacement  )  [inline]
 

Sets the item mark replacement.

Parameters:
aReplacement The new replacement descriptor.
void CTextListItemDrawer::SetItemMarkReverse TBool  aReverse  )  [inline]
 

Sets item mark reverse to be active or not.

Parameters:
aReverse The new setting. ETrue if item is marked reversed.
IMPORT_C void CTextListItemDrawer::SetSearchStringL const TDesC *  aSearchString  ) 
 

Sets the search string.

Parameters:
aSearchString The new search string.

Field Documentation

const CFont* CTextListItemDrawer::iFont [protected]
 

Font used by the drawer.

MTextListBoxModel* CTextListItemDrawer::iModel [protected]
 

List box model for the drawer.


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

Copyright © Nokia Corporation 2001-2008
Back to top