class CListItemDrawer : public CBase |
The CListItemDrawer class is the base class for the list box item drawers which handle drawing of the contents of list box items. The items may optionally be markable.
Protected Member Functions | |
---|---|
CListItemDrawer () | |
void | DrawActualItem ( TInt , const TRect &, TBool , TBool , TBool , TBool ) |
TRgb | MarkColor () |
IMPORT_C void | ResetGc () |
IMPORT_C void | SetupGc ( TInt ) |
IMPORT_C TInt | VerticalInterItemGap () |
Private Member Functions | |
---|---|
IMPORT_C TAny * | Reserved_1 () |
const CFont * | SymbolFont () |
const CFont *& | SymbolFont () |
TInt & | VerticalInterItemGap () |
Public Member Enumerations | |
---|---|
enum |
TFlags
{
EDrawMarkSelection = 0x0001, EPaintedSelection = 0x0002, EDrawOnlyActiveSelection = 0x0004, EDisableHighlight = 0x0008, EPressedDownState = 0x0010, EDisableMarquee = 0x0020, ESingleClickDisabledHighlight = 0x0040, ESingleClickEnabled = 0x0080, EDrawSmileyIcon = 0x0100, EMarkingModeEnabled = 0x0200, EDrawWholeBackground = 0x0400, ENativeImplementation = 0x0800, EBackgroundDrawn = 0x1000 } |
enum | TListItemAttribute { ECurrent = 0x0001, EEmphasized = 0x0002, ESelected = 0x0004, EMask = 0x0007 } |
Private Attributes | |
---|---|
TUint | iFlags |
TInt | iSpare |
const CFont * | iSymbolFont |
TInt | iVerticalInterItemGap |
TRgb | BackColor | ( | ) | const [inline] |
Gets the colour used to draw the background for non-highlighted items.
IMPORT_C void | ClearFlags | ( | TInt | aFlags | ) |
Sets the item drawer flags.
Clears the item drawer flags aFlags, masking off all but the lower 3 bits.
TInt aFlags | The new item drawer flags. |
IMPORT_C void | ClearRect | ( | const TRect & | aRect | ) | const [virtual] |
Clears the specified rectangle of this object's graphics context.
const TRect & aRect | Rectangle to clear. |
TRgb | DimmedBackColor | ( | ) | const [inline] |
Gets the colour used to draw the background for dimmed items.
void | DrawActualItem | ( | TInt | aItemIndex, |
const TRect & | aActualItemRect, | |||
TBool | aItemIsCurrent, | |||
TBool | aViewIsEmphasized, | |||
TBool | aViewIsDimmed, | |||
TBool | aItemIsSelected | |||
) | const [protected, pure virtual] |
Draws item text.
everything other than the item mark - into the graphics context.
TInt aItemIndex | Which item to draw. |
const TRect & aActualItemRect | Where the item should be drawn. |
TBool aItemIsCurrent | Whether the item is current. |
TBool aViewIsEmphasized | Whether the list box view is emphasised. |
TBool aViewIsDimmed | Whether the list box view is dimmed. |
TBool aItemIsSelected | Whether the list box item is selected. |
IMPORT_C void | DrawFrame | ( | CWindowGc & | aGc, |
const TRect & | aRect, | |||
TInt | aFlags | |||
) | const |
Draws the frame.
Uses the colours set with the fonts and colour functions described above.
IMPORT_C void | DrawItem | ( | TInt | aItemIndex, |
TPoint | aItemRectPos, | |||
TBool | aItemIsSelected, | |||
TBool | aItemIsCurrent, | |||
TBool | aViewIsEmphasized, | |||
TBool | aViewIsDimmed | |||
) | const [virtual] |
Draws the entire item.
This function is called by the list box view. As implemented in CListItemDrawer , this function draws the item text using DrawActualItem() , and an item mark using DrawItemMark() .
TInt aItemIndex | Index of the item to draw. |
TPoint aItemRectPos | Position of the rectangle to draw. |
TBool aItemIsSelected | Whether the item is selected. |
TBool aItemIsCurrent | Whether the item is current. |
TBool aViewIsEmphasized | Whether the list box view has the emphasised flag set (see CListBoxView::SetEmphasized()). |
TBool aViewIsDimmed | Whether the list box view has its dimmed flag set (see CListBoxView::SetDimmed()). |
IMPORT_C void | DrawItemMark | ( | TBool | aItemIsSelected, |
TBool | aViewIsDimmed, | |||
const TPoint & | aMarkPos | |||
) | const [virtual] |
Not Used in S60.
IMPORT_C CFont * | Font | ( | TInt | aItemIndex | ) | const |
Gets the font for the specified item.
The function returns NULL if no font storage data has been set.
Returns the font for the item at index aItemIndex. Returns NULL if no font storage data has been set.
TInt aItemIndex | The index of the item for which the font is returned. |
TRgb | HighlightedBackColor | ( | ) | const [inline] |
Gets the colour used to draw the background for highlighted items.
TRgb | HighlightedTextColor | ( | ) | const [inline] |
Gets the colour used to draw highlighted text.
IMPORT_C TInt | ItemWidthInPixels | ( | TInt | aItemIndex | ) | const [virtual] |
Gets the width of the specified item.
TInt aItemIndex | The index of the item whose width is to be returned. |
TRgb | MarkColor | ( | ) | const [protected, inline] |
Gets the colour used to draw tick marks.
A tick mark usually indicates that an item is selected.
IMPORT_C TInt | MarkGutter | ( | ) | const |
Gets the width of the gap between the column containig the lists item marks and the text column.
IMPORT_C TInt | MatcherCursorAscent | ( | TInt | aCurrentItemIndex | ) | const [virtual] |
Gets the ascent of the matcher cursor.
This is obtained for the item at index aCurrentItemIndex . The function returns 0 by default.
Returns the ascent of the matcher cursor for the item at index aCurrentItemIndex determined from the ascent of the font used for that item.
Returns 0 by default.
TInt aCurrentItemIndex | Item index of the target item. |
IMPORT_C TRect | MatcherCursorRect | ( | const TDesC & | aMatchableText, |
TInt | aCharPos, | |||
TInt | aItemCellYPos, | |||
TInt | aCurrentItemIndex | |||
) | const [virtual] |
Gets a rectangle describing where the matcher cursor should be drawn. The default behavious is to return uninitialised TRect .
Returns the rectangle occupied by the matcher cursor in the text aMatchableText. The pixel position of the rectangle is determined by specifying the character position of the cursor in the text aCharPos and the vertical position of the item cell aItemCellYPos. The size of the rectangle can be determined by giving the index of the current item aCurrentItemIndex.
Returns the rectangle occupied by the item drawer by default.
IMPORT_C TListItemProperties | Properties | ( | TInt | aItemIndex | ) | const [virtual] |
Gets the colour and style properties of the specified item.
Returns the properties of the item at index aItemIndex.
TInt aItemIndex | The index of the item for which properties are obtained (Not Used). |
IMPORT_C void | ResetGc | ( | ) | const [protected, virtual] |
Resets the pen style, brush style, brush colour etc. to suitable starting values for this class.
This function is called after every drawing operation.
void | SetBackColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw the background for non-highlighted items.
TRgb aColor | The background colour. |
IMPORT_C void | SetData | ( | CListBoxData * | aData | ) |
Sets the font storage data for the item drawer and transfer ownership of that data.
Sets the font storage data for the item drawer to aFontStorage and transfers ownership.
CListBoxData * aData | Font storage data . |
void | SetDimmedBackColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw the background for dimmed items.
TRgb aColor | The background colour for dimmed items. |
void | SetDimmedTextColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw dimmed text.
TRgb aColor | The dimmed text colour. |
IMPORT_C void | SetDrawMark | ( | TBool | aDrawMark | ) |
Sets whether item tick marks are drawn.
If the draw mark flag iDrawMark is set, DrawItem() leaves space for the marks column to the left of the text column, and DrawItemMark() draws the item marks.
TBool aDrawMark | New value for iDrawMark. |
IMPORT_C void | SetFlags | ( | TInt | aFlags | ) |
Sets the item drawer flags.
Sets the item drawer flags to aFlags, masking off all but the lower 3 bits.
TInt aFlags | The new item drawer flags. |
IMPORT_C void | SetGc | ( | CWindowGc * | aGc | ) | [virtual] |
Sets the graphics context which this object uses for drawing.
CWindowGc * aGc | Pointer to the context to use. |
void | SetHighlightedBackColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw the background for highlighted items.
TRgb aColor | The highlighted background colour. |
void | SetHighlightedTextColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw highlighted text.
TRgb aColor | The highlighted text colour. |
IMPORT_C void | SetItemCellSize | ( | const TSize & | aSizeInPixels | ) | [virtual] |
Sets the item cell size. The cell size is the on-screen size of the entire item, including its text and its item mark.
const TSize & aSizeInPixels | New size for the item cell. |
IMPORT_C void | SetMarkColumnWidth | ( | TInt | aWidthInPixels | ) | [virtual] |
Sets the width of the column containing the mark.
TInt aWidthInPixels | New width for the mark column. |
IMPORT_C void | SetMarkGutter | ( | TInt | aGapInPixels | ) | [virtual] |
Sets the width of the gap between the column containing the lists item marks and the text column.
TInt aGapInPixels | New gap size. |
IMPORT_C void | SetSkinEnabledL | ( | TBool | aEnabled | ) |
Ability to enable skins in listboxes.
TBool aEnabled | parameter for enabling/disabling skin. ETrue enables skin, EFalse disables skin |
IMPORT_C void | SetSymbolFont | ( | const CFont * | aFont | ) |
Sets symbol font for the item drawer. The symbol font is used to draw the standard tick item marks.
const CFont * aFont | The font to be used. |
void | SetTextColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw non-highlighted text.
TRgb aColor | The text colour. |
IMPORT_C void | SetVerticalInterItemGap | ( | TInt | aGapInPixels | ) |
Sets the vertical gap between items in the list.
TInt aGapInPixels | New value for the vertical gap between items in pixels. |
IMPORT_C void | SetViewRect | ( | const TRect & | aRect | ) | [virtual] |
Sets the viewing rectangle for this item drawer. This value is not used by the CListItemViewer , but may be used by its derived classes.
const TRect & aRect | New value for iViewRect. |
IMPORT_C void | SetupGc | ( | TInt | aItemIndex | ) | const [protected] |
Sets up the graphics context for the specified item.
TInt aItemIndex | The item for which the graphics context will be set up. |
IMPORT_C MAknsControlContext * | SkinBackgroundControlContext | ( | ) | const |
Access to skin contexts.
IMPORT_C TInt | VerticalInterItemGap | ( | ) | const [protected] |
Gets the vertical gap between items in pixels.
Provides list box attributes for handling multiple selections. These flags can be set using the CListItemDrawer::SetFlags function.
EDrawMarkSelection = 0x0001 |
If set, specifies the inclusion of a gap into which a tick mark can be drawn if the item is selected. This is used in the following CListItemDrawer class functions: DrawItem() , DrawItemMark() , SetDrawMark() |
EPaintedSelection = 0x0002 |
If set, draws a highlight over a selected list item. This is used in the CTextListItemDrawer::DoDrawItemText() function. |
EDrawOnlyActiveSelection = 0x0004 |
This flag is not supported. |
EDisableHighlight = 0x0008 |
If set highlight is disabled. |
EPressedDownState = 0x0010 |
This flag indicates CListboxData to draw pressed down state rather than normal highlight on item. Make sure checking this flag in subclass's Draw method, if using a custom CListboxData inheriting from CColumnListBoxData or CFormattedCellListBoxData . |
EDisableMarquee = 0x0020 |
This flag indicates the marquee is disabled. If it is set, CColumnListBoxData or CFormattedCellListBoxData would disable maquee temporarily for performance reason. |
ESingleClickDisabledHighlight = 0x0040 |
This flag indicates that highlight is disabled in list because of single click style. |
ESingleClickEnabled = 0x0080 |
This flag indicates that single click mode is enabled. |
EDrawSmileyIcon = 0x0100 |
This flag indicates that simley icon is enabled. |
EMarkingModeEnabled = 0x0200 |
This flag indicates that marking mode is enabled. |
EDrawWholeBackground = 0x0400 |
If set then itemdrawer draws the whole list area's background in one frame while scrolling. Normally background is drawn separately for each list item. |
ENativeImplementation = 0x0800 |
Always set unless client application has implemented a custom item drawer that overrides background drawing code. |
EBackgroundDrawn = 0x1000 |
This flag is used during scrolling to indicate that background has been already drawn. |
Provides attributes for list items
ECurrent = 0x0001 |
Highlight for current text. |
EEmphasized = 0x0002 |
Highlight for text when the listbox view is emphasized. This is used in the following CListBoxView class functions: DrawItem() , DrawMatcherCursor() , SetEmphasized() . |
ESelected = 0x0004 |
Highlight for text that is selected. This is used in the following functions: CColumnListBoxItemDrawer::DrawItemText() , CHierarchicalListItemDrawer::DrawActualItem() , CDirContentsListItemDrawer::DrawActualItem() . |
EMask = 0x0007 |
Sum of all the above attributes. This last attribute is used to control that one can use only valid attributes above. So do not use it at all. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.