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.
Symbian 5.0
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 } |
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.
Background colour.
IMPORT_C void | ClearFlags | ( | TInt | aFlags | ) |
Sets the item drawer flags.
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.
The background colour for dimmed items.
TRgb | DimmedTextColor | ( | ) | const [inline] |
Gets the colour used to draw dimmed text.
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.
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.
The item's font.
TInt aItemIndex | The index of the item for which the font is returned. |
IMPORT_C CWindowGc * | Gc | ( | ) | const |
Gets graphics context which is used for drawing.
Pointer to the graphics context used for drawing.
TRgb | HighlightedBackColor | ( | ) | const [inline] |
Gets the colour used to draw the background for highlighted items.
The highlighted background colour.
TRgb | HighlightedTextColor | ( | ) | const [inline] |
Gets the colour used to draw highlighted text.
The highlighted text colour.
IMPORT_C TSize | ItemCellSize | ( | ) | const |
Gets current item cell size.
Symbian 3.0
Item cell size
IMPORT_C TInt | ItemWidthInPixels | ( | TInt | aItemIndex | ) | const [virtual] |
Gets the width of the specified item.
The width of the item. This is 0 in CListItemDrawer
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.
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.
Size of the inter-column gutter.
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.
The height of the matcher cursor.
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.
Where the cursor should be drawn.
IMPORT_C TSize | MinimumCellSize | ( | ) | const [virtual] |
Gets the minimum cell size.
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.
The item's properties.
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.
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.
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.
S60 2.0
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.
S60 2.0
Pointer to skin background control context.
TRgb | TextColor | ( | ) | const [inline] |
Gets the colour used to draw non-highlighted text.
The text colour.
IMPORT_C TInt | VerticalInterItemGap | ( | ) | const [protected] |
Gets the vertical gap between items in pixels.
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. |
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. |