#include <mw/eiklbi.h>
class CListItemDrawer : public CBase |
Public Member Enumerations | |
---|---|
enum | TFlags { EDrawMarkSelection, EPaintedSelection, EDrawOnlyActiveSelection, EDisableHighlight, ..., EUseOverrideSkinTextColor } |
enum | TListItemAttribute { ECurrent, EEmphasized, ESelected, EMask } |
Protected Member Functions | |
---|---|
CListItemDrawer() | |
pure virtual void | DrawActualItem(TInt, const TRect &, TBool, TBool, TBool, TBool) |
TRgb | MarkColor() |
virtual IMPORT_C void | ResetGc() |
IMPORT_C void | SetupGc(TInt) |
IMPORT_C TInt | VerticalInterItemGap() |
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.
Provides list box attributes for handling multiple selections. These flags can be set using the CListItemDrawer::SetFlags function.
Enumerator | Value | Description |
---|---|---|
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. |
EUseOverrideSkinTextColor | 0x2000 |
Override text color from skin |
Provides attributes for list items
Enumerator | Value | Description |
---|---|---|
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. |
TRgb | BackColor | ( | ) | const [inline] |
Gets the colour used to draw the background for non-highlighted items.
Returns: Background colour.
IMPORT_C void | ClearFlags | ( | TInt | aFlags | ) |
Sets the item drawer flags.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aRect | Rectangle to clear. |
TRgb | DimmedBackColor | ( | ) | const [inline] |
Gets the colour used to draw the background for dimmed items.
Returns: The background colour for dimmed items.
TRgb | DimmedTextColor | ( | ) | const [inline] |
Gets the colour used to draw dimmed text.
Returns: The dimmed text colour.
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.
Parameter | Description |
---|---|
aItemIndex | Which item to draw. |
aActualItemRect | Where the item should be drawn. |
aItemIsCurrent | Whether the item is current. |
aViewIsEmphasized | Whether the list box view is emphasised. |
aViewIsDimmed | Whether the list box view is dimmed. |
aItemIsSelected | Whether the list box item is selected. |
Draws the frame.
Uses the colours set with the fonts and colour functions described above.
Parameter | Description |
---|---|
aGc | The graphics context used to draw the frame. |
aRect | The frame's rectangle. |
aFlags | The item drawer flags. |
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().
Parameter | Description |
---|---|
aItemIndex | Index of the item to draw. |
aItemRectPos | Position of the rectangle to draw. |
aItemIsSelected | Whether the item is selected. |
aItemIsCurrent | Whether the item is current. |
aViewIsEmphasized | Whether the list box view has the emphasised flag set (see CListBoxView::SetEmphasized()). |
aViewIsDimmed | Whether the list box view has its dimmed flag set (see CListBoxView::SetDimmed()). |
IMPORT_C CWindowGc * | Gc | ( | ) | const |
Gets graphics context which is used for drawing.
Returns: Pointer to the graphics context used for drawing.
TRgb | HighlightedBackColor | ( | ) | const [inline] |
Gets the colour used to draw the background for highlighted items.
Returns: The highlighted background colour.
TRgb | HighlightedTextColor | ( | ) | const [inline] |
Gets the colour used to draw highlighted text.
Returns: The highlighted text colour.
IMPORT_C TSize | ItemCellSize | ( | ) | const |
Gets current item cell size.
Returns: Item cell size
TRgb | MarkColor | ( | ) | const [protected, inline] |
Gets the colour used to draw tick marks.
A tick mark usually indicates that an item is selected.
Returns: The tick mark colour.
IMPORT_C TInt | MarkGutter | ( | ) | const |
Gets the width of the gap between the column containig the lists item marks and the text column.
Returns: Size of the inter-column gutter.
Gets the ascent of the matcher cursor.
This is obtained for the item at index aCurrentItemIndex. The function returns 0 by default.
Parameter | Description |
---|---|
aCurrentItemIndex | Item index of the target item. |
Returns: The height of the matcher cursor.
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.
Parameter | Description |
---|---|
aMatchableText | The text of the currently matched string. |
aCharPos | The position in the string of the character just matched in the current incremental match. |
aItemCellYPos | Y position of the item cell. |
aCurrentItemIndex | Item index for the current item. |
Returns: Where the cursor should be drawn.
IMPORT_C TSize | MinimumCellSize | ( | ) | const [virtual] |
Gets the minimum cell size.
Returns: The minimum size for a cell. This is TSize(0, 0) in CListItemDrawer.
IMPORT_C TListItemProperties | Properties | ( | TInt | aItemIndex | ) | const [virtual] |
Gets the colour and style properties of the specified item.
Parameter | Description |
---|---|
aItemIndex | The index of the item for which properties are obtained (Not Used). |
Returns: The item's properties.
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.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aData | Font storage data . |
void | SetDimmedBackColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw the background for dimmed items.
Parameter | Description |
---|---|
aColor | The background colour for dimmed items. |
void | SetDimmedTextColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw dimmed text.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aDrawMark | New value for iDrawMark. |
IMPORT_C void | SetFlags | ( | TInt | aFlags | ) |
Sets the item drawer flags.
Parameter | Description |
---|---|
aFlags | The new item drawer flags. |
IMPORT_C void | SetGc | ( | CWindowGc * | aGc | ) | [virtual] |
Sets the graphics context which this object uses for drawing.
Parameter | Description |
---|---|
aGc | Pointer to the context to use. |
void | SetHighlightedBackColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw the background for highlighted items.
Parameter | Description |
---|---|
aColor | The highlighted background colour. |
void | SetHighlightedTextColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw highlighted text.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aSizeInPixels | New size for the item cell. |
IMPORT_C void | SetMarkColumnWidth | ( | TInt | aWidthInPixels | ) | [virtual] |
Sets the width of the column containing the mark.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aGapInPixels | New gap size. |
IMPORT_C void | SetSkinEnabledL | ( | TBool | aEnabled | ) |
Ability to enable skins in listboxes.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aFont | The font to be used. |
void | SetTextColor | ( | TRgb | aColor | ) | [inline] |
Sets the colour used to draw non-highlighted text.
Parameter | Description |
---|---|
aColor | The text colour. |
IMPORT_C void | SetVerticalInterItemGap | ( | TInt | aGapInPixels | ) |
Sets the vertical gap between items in the list.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aRect | New value for iViewRect. |
IMPORT_C void | SetupGc | ( | TInt | aItemIndex | ) | const [protected] |
Sets up the graphics context for the specified item.
Parameter | Description |
---|---|
aItemIndex | The item for which the graphics context will be set up. |
IMPORT_C MAknsControlContext * | SkinBackgroundControlContext | ( | ) | const |
Access to skin contexts.
Returns: Pointer to skin background control context.
TRgb | TextColor | ( | ) | const [inline] |
Gets the colour used to draw non-highlighted text.
Returns: The text colour.
IMPORT_C TInt | VerticalInterItemGap | ( | ) | const [protected] |
Gets the vertical gap between items in pixels.
Returns: The vertical gap between items in pixels.