Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: eiklbd.h
Link against: eikcoctl.lib

Class CListBoxData

CListBoxData

Support

Supported from 6.0

Description

Base class for list box data classes.

The class stores one or more instances of fonts in normal, bold and italic styles.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CListBoxDataBase class for list box data classes

Defined in CListBoxData:
Alignment(), CListBoxData(), ConstructFontL(), ConstructL(), DrawItem(), Font(), FontBoundValues(), IsSearchString(), RegenerateFonts(), SetAlignmentL(), SetFontHeight(), SetSearchStringL(), SetupGc(), UpdateFontBoundValues(), iBoldFont, iBoldItalicFont, iItalicFont, iNormalFont, iSearchString, ~CListBoxData()

Inherited from CBase:
operator new()


Construction and Destruction


CListBoxData()

CListBoxData();

Description

Constructor. Sets data as left aligned.


ConstructL()

void ConstructL(const CFont* aBaseFont);

Description

Completes construction. Constructs normal, bold, italic and bold italic fonts based on the specified aBaseFont.

Parameters

Const CFont* aBaseFont

The font on which the constructed fonts are based.


~CListBoxData()

~CListBoxData();

Description

Destructor. Deletes the search string if present.

[Top]


Text alignment


Alignment()

CGraphicsContext::TTextAlign Alignment() const;

Description

Gets the text alignment.

Return value

CGraphicsContext::TTextAlign

The text alignment.


SetAlignmentL()

void SetAlignmentL(CGraphicsContext::TTextAlign aAlign);

Description

Sets list item text alignment.

Parameters

CGraphicsContext::TTextAlign aAlign

The required text alignment.

[Top]


Accessing fonts and setting height and bound values


Font()

CFont* Font(const TListItemProperties& aItemProperties) const;

Description

Gets the font in which the item is drawn.

Parameters

Const TListItemProperties& aItemProperties

The properties of the list box item.

Return value

CFont*

The list box item’s font.


SetFontHeight()

void SetFontHeight(TInt aFontHeightInTwips);

Description

Sets font height in twips.

Parameters

TInt aFontHeightInTwips

The required font height in twips.


FontBoundValues()

const TListFontBoundValues& FontBoundValues() const;

Description

Gets the font bound values. These are global font properties such as the normal character width in pixels.

Return value

TListFontBoundValues&

The font bound values.


UpdateFontBoundValues()

protected: void UpdateFontBoundValues(const CFont& aFont);

Description

Updates the font bound values. These are global font properties such as the normal character width in pixels.

Parameters

const CFont& aFont

The font for which bound values are updated.

[Top]


Search string


DrawItem()

void DrawItem (CWindowGc& aGc, const TRect& aItemTextRect,const TDesC& aItemText, const CFont& aItemFont,const TInt aBaseLineOffset,const CGraphicsContext::TTextAlign aAlign) const;

Description

Draws list item text. Supports different drawing for the search string.

Parameters

CWindowGc& aGc

The graphics context.

Const TRect& aItemTextRect

The item’s text rectangle.

Const TDesC& aItemText

The item’s text.

Const CFont& aItemFont

The item’s font.

Const TInt aBaseLineOffset

The item’s base line offset.

Const CGraphicsContext::TTextAlign aAlign

The text alignment.


SetSearchStringL()

void SetSearchStringL(const TDesC* aSearchString);

Description

Sets the search string for search result viewing.

Parameters

const TDesC* aSearchString

The required search string.


IsSearchString()

TBool IsSearchString() const;

Description

Tests whether a search string has been set for this list box.

Return value

TBool

ETrue if a search string with a non-zero length has been set for this list box. Otherwise EFalse.

[Top]


Graphics context


SetupGc()

void SetupGc(const TListItemProperties& aItemProperties, CWindowGc& aGc) const;

Description

Sets list box item underline style, pen colour and font.

Parameters

const TListItemProperties& aItemProperties

The list box item’s properties.

CWindowGc& aGc

The graphics context.

[Top]


Protected functions


ConstructFontL()

protected: void ConstructFontL(const CFont* aBaseFont, TFontStyle aFontStyle, CFontsWithStyle& aFonts);

Description

Constructs a font based on the specified font. This function is called by CListBoxData::ConstructL().

Parameters

const CFont* aBaseFont

The font on which the constructed font is based.

TFontStyle aFontStyle

The font style.

CFontsWithStyle& aFonts

Font array.


RegenerateFonts()

protected: void RegenerateFonts(CFontsWithStyle& aFonts, TInt aFontHeightInTwips);

Description

Regenerates a font based on the font height. Called by CListBoxData::SetFontHeight().

Parameters

CFontsWithStyle& aFonts

The style of font to regenerate.

TInt aFontHeightInTwips

The font height in twips.

[Top]


Protected data


iBoldFont

CFontsWithStyle iBoldFont

Description

Bold font.


iBoldItalicFont

CFontsWithStyle iBoldItalicFont

Description

Bold italic font.


iItalicFont

CFontsWithStyle iItalicFont

Description

Italic font.


iNormalFont

CFontsWithStyle iNormalFont

Description

Normal font.


iSearchString

HBufC* iSearchString

Description

Search string.