CListItemDrawer Class Reference

#include <mw/eiklbi.h>

Link against: ConnectionUiUtilities.lib

class CListItemDrawer : public CBase

Inherits from

  • CListItemDrawer
    Protected Attributes
    TRgb iBackColor
    CListBoxData *iData
    TRgb iDimmedBackColor
    TRgb iDimmedTextColor
    TBool iDrawMark
    CWindowGc *iGc
    TRgb iHighlightedBackColor
    TRgb iHighlightedTextColor
    TSize iItemCellSize
    TRgb iMarkColor
    TInt iMarkColumnWidth
    TInt iMarkGutter
    TRgb iTextColor
    TRect iViewRect
    Public Member Enumerations
    enumTFlags { EDrawMarkSelection, EPaintedSelection, EDrawOnlyActiveSelection, EDisableHighlight, ..., EUseOverrideSkinTextColor }
    enumTListItemAttribute { ECurrent, EEmphasized, ESelected, EMask }
    Public Member Functions
    ~CListItemDrawer()
    TRgb BackColor()
    IMPORT_C voidClearFlags(TInt)
    virtual IMPORT_C voidClearRect(const TRect &)
    TRgb DimmedBackColor()
    TRgb DimmedTextColor()
    IMPORT_C voidDrawFrame(CWindowGc &, const TRect &, TInt)
    virtual IMPORT_C voidDrawItem(TInt, TPoint, TBool, TBool, TBool, TBool)
    virtual IMPORT_C voidDrawItemMark(TBool, TBool, const TPoint &)
    TInt Flags()
    IMPORT_C CFont *Font(TInt)
    IMPORT_C CWindowGc *Gc()
    TRgb HighlightedBackColor()
    TRgb HighlightedTextColor()
    IMPORT_C TSizeItemCellSize()
    virtual IMPORT_C TIntItemWidthInPixels(TInt)
    IMPORT_C TIntMarkColumn()
    IMPORT_C TIntMarkGutter()
    virtual IMPORT_C TIntMatcherCursorAscent(TInt)
    virtual IMPORT_C TRectMatcherCursorRect(const TDesC &, TInt, TInt, TInt)
    virtual IMPORT_C TSizeMinimumCellSize()
    virtual IMPORT_C TListItemPropertiesProperties(TInt)
    voidSetBackColor(TRgb)
    IMPORT_C voidSetData(CListBoxData *)
    voidSetDimmedBackColor(TRgb)
    voidSetDimmedTextColor(TRgb)
    IMPORT_C voidSetDrawMark(TBool)
    IMPORT_C voidSetFlags(TInt)
    virtual IMPORT_C voidSetGc(CWindowGc *)
    voidSetHighlightedBackColor(TRgb)
    voidSetHighlightedTextColor(TRgb)
    virtual IMPORT_C voidSetItemCellSize(const TSize &)
    virtual IMPORT_C voidSetMarkColumnWidth(TInt)
    virtual IMPORT_C voidSetMarkGutter(TInt)
    IMPORT_C voidSetSkinEnabledL(TBool)
    IMPORT_C voidSetSymbolFont(const CFont *)
    voidSetTextColor(TRgb)
    IMPORT_C voidSetVerticalInterItemGap(TInt)
    virtual IMPORT_C voidSetViewRect(const TRect &)
    IMPORT_C MAknsControlContext *SkinBackgroundControlContext()
    TRgb TextColor()
    Protected Member Functions
    CListItemDrawer()
    pure virtual voidDrawActualItem(TInt, const TRect &, TBool, TBool, TBool, TBool)
    TRgb MarkColor()
    virtual IMPORT_C voidResetGc()
    IMPORT_C voidSetupGc(TInt)
    IMPORT_C TIntVerticalInterItemGap()
    Inherited Functions
    CBase::CBase()
    CBase::Delete(CBase *)
    CBase::Extension_(TUint,TAny *&,TAny *)
    CBase::operator new(TUint)
    CBase::operator new(TUint,TAny *)
    CBase::operator new(TUint,TLeave)
    CBase::operator new(TUint,TLeave,TUint)
    CBase::operator new(TUint,TUint)
    CBase::~CBase()

    Detailed Description

    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.

    Since
    Symbian 5.0

    Member Attribute Documentation

    iBackColor

    TRgb iBackColor[protected]

    Background color.

    iData

    CListBoxData *iData[protected]

    Data model.

    iDimmedBackColor

    TRgb iDimmedBackColor[protected]

    Color of dimmed background.

    iDimmedTextColor

    TRgb iDimmedTextColor[protected]

    Color of dimmed text.

    iDrawMark

    TBool iDrawMark[protected]

    Draw mark.

    iGc

    CWindowGc *iGc[protected]

    Graphics context controller.

    iHighlightedBackColor

    TRgb iHighlightedBackColor[protected]

    Highlighted background color.

    iHighlightedTextColor

    TRgb iHighlightedTextColor[protected]

    Color of highlighted text.

    iItemCellSize

    TSize iItemCellSize[protected]

    Item's cell size.

    iMarkColor

    TRgb iMarkColor[protected]

    Mark color.

    iMarkColumnWidth

    TInt iMarkColumnWidth[protected]

    Mark column width.

    iMarkGutter

    TInt iMarkGutter[protected]

    Mark gutter.

    iTextColor

    TRgb iTextColor[protected]

    Color of text.

    iViewRect

    TRect iViewRect[protected]

    View area.

    Member Enumeration Documentation

    Enum TFlags

    Provides list box attributes for handling multiple selections. These flags can be set using the CListItemDrawer::SetFlags function.

    EnumeratorValueDescription
    EDrawMarkSelection0x0001

    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()

    EPaintedSelection0x0002

    If set, draws a highlight over a selected list item. This is used in the CTextListItemDrawer::DoDrawItemText() function.

    EDrawOnlyActiveSelection0x0004

    This flag is not supported.

    EDisableHighlight0x0008

    If set highlight is disabled.

    EPressedDownState0x0010

    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.

    EDisableMarquee0x0020

    This flag indicates the marquee is disabled. If it is set, CColumnListBoxData or CFormattedCellListBoxData would disable maquee temporarily for performance reason.

    ESingleClickDisabledHighlight0x0040

    This flag indicates that highlight is disabled in list because of single click style.

    ESingleClickEnabled0x0080

    This flag indicates that single click mode is enabled.

    EDrawSmileyIcon0x0100

    This flag indicates that simley icon is enabled.

    EMarkingModeEnabled0x0200

    This flag indicates that marking mode is enabled.

    EDrawWholeBackground0x0400

    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.

    ENativeImplementation0x0800

    Always set unless client application has implemented a custom item drawer that overrides background drawing code.

    EBackgroundDrawn0x1000

    This flag is used during scrolling to indicate that background has been already drawn.

    EUseOverrideSkinTextColor0x2000

    Override text color from skin

    Enum TListItemAttribute

    Provides attributes for list items

    EnumeratorValueDescription
    ECurrent0x0001

    Highlight for current text.

    EEmphasized0x0002

    Highlight for text when the listbox view is emphasized.

    This is used in the following CListBoxView class functions: DrawItem(), DrawMatcherCursor(), SetEmphasized().

    ESelected0x0004

    Highlight for text that is selected. This is used in the following functions: CColumnListBoxItemDrawer::DrawItemText(), CHierarchicalListItemDrawer::DrawActualItem(), CDirContentsListItemDrawer::DrawActualItem().

    EMask0x0007

    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.

    Constructor & Destructor Documentation

    CListItemDrawer ( )

    IMPORT_CCListItemDrawer()[protected]

    C++ default constructor.

    ~CListItemDrawer ( )

    IMPORT_C~CListItemDrawer()

    Destructor.

    Member Function Documentation

    BackColor ( )

    TRgb BackColor()const [inline]

    Gets the colour used to draw the background for non-highlighted items.

    Returns: Background colour.

    ClearFlags ( TInt )

    IMPORT_C voidClearFlags(TIntaFlags)

    Sets the item drawer flags.

    ParameterDescription
    aFlagsThe new item drawer flags.

    ClearRect ( const TRect & )

    IMPORT_C voidClearRect(const TRect &aRect)const [virtual]

    Clears the specified rectangle of this object's graphics context.

    ParameterDescription
    aRectRectangle to clear.

    DimmedBackColor ( )

    TRgb DimmedBackColor()const [inline]

    Gets the colour used to draw the background for dimmed items.

    Returns: The background colour for dimmed items.

    DimmedTextColor ( )

    TRgb DimmedTextColor()const [inline]

    Gets the colour used to draw dimmed text.

    Returns: The dimmed text colour.

    DrawActualItem ( TInt, const TRect &, TBool, TBool, TBool, TBool )

    voidDrawActualItem(TIntaItemIndex,
    const TRect &aActualItemRect,
    TBoolaItemIsCurrent,
    TBoolaViewIsEmphasized,
    TBoolaViewIsDimmed,
    TBoolaItemIsSelected
    )const [protected, pure virtual]

    Draws item text.

    This function is called by CListItemDrawer::DrawItem() with appropriate arguments. Its purpose is to draw the actual item
    • everything other than the item mark - into the graphics context.

    ParameterDescription
    aItemIndexWhich item to draw.
    aActualItemRectWhere the item should be drawn.
    aItemIsCurrentWhether the item is current.
    aViewIsEmphasizedWhether the list box view is emphasised.
    aViewIsDimmedWhether the list box view is dimmed.
    aItemIsSelectedWhether the list box item is selected.

    DrawFrame ( CWindowGc &, const TRect &, TInt )

    IMPORT_C voidDrawFrame(CWindowGc &aGc,
    const TRect &aRect,
    TIntaFlags
    )const

    Draws the frame.

    Uses the colours set with the fonts and colour functions described above.

    Deprecated

    ParameterDescription
    aGcThe graphics context used to draw the frame.
    aRectThe frame's rectangle.
    aFlagsThe item drawer flags.

    DrawItem ( TInt, TPoint, TBool, TBool, TBool, TBool )

    IMPORT_C voidDrawItem(TIntaItemIndex,
    TPointaItemRectPos,
    TBoolaItemIsSelected,
    TBoolaItemIsCurrent,
    TBoolaViewIsEmphasized,
    TBoolaViewIsDimmed
    )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().

    ParameterDescription
    aItemIndexIndex of the item to draw.
    aItemRectPosPosition of the rectangle to draw.
    aItemIsSelectedWhether the item is selected.
    aItemIsCurrentWhether the item is current.
    aViewIsEmphasizedWhether the list box view has the emphasised flag set (see CListBoxView::SetEmphasized()).
    aViewIsDimmedWhether the list box view has its dimmed flag set (see CListBoxView::SetDimmed()).

    DrawItemMark ( TBool, TBool, const TPoint & )

    IMPORT_C voidDrawItemMark(TBoolaItemIsSelected,
    TBoolaViewIsDimmed,
    const TPoint &aMarkPos
    )const [virtual]

    Not Used in S60.

    Flags ( )

    TInt Flags()const [inline]

    Gets the item drawer flags.

    Returns: The item drawer flags.

    Font ( TInt )

    IMPORT_C CFont *Font(TIntaItemIndex)const

    Gets the font for the specified item.

    The function returns NULL if no font storage data has been set.

    ParameterDescription
    aItemIndexThe index of the item for which the font is returned.

    Returns: The item's font.

    Gc ( )

    IMPORT_C CWindowGc *Gc()const

    Gets graphics context which is used for drawing.

    Returns: Pointer to the graphics context used for drawing.

    HighlightedBackColor ( )

    TRgb HighlightedBackColor()const [inline]

    Gets the colour used to draw the background for highlighted items.

    Returns: The highlighted background colour.

    HighlightedTextColor ( )

    TRgb HighlightedTextColor()const [inline]

    Gets the colour used to draw highlighted text.

    Returns: The highlighted text colour.

    ItemCellSize ( )

    IMPORT_C TSizeItemCellSize()const

    Gets current item cell size.

    Since
    Symbian 3.0

    Returns: Item cell size

    ItemWidthInPixels ( TInt )

    IMPORT_C TIntItemWidthInPixels(TIntaItemIndex)const [virtual]

    Gets the width of the specified item.

    ParameterDescription
    aItemIndexThe index of the item whose width is to be returned.

    Returns: The width of the item. This is 0 in CListItemDrawer

    MarkColor ( )

    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.

    MarkColumn ( )

    IMPORT_C TIntMarkColumn()const

    Gets mark column width.

    Returns: Mark column width.

    MarkGutter ( )

    IMPORT_C TIntMarkGutter()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.

    MatcherCursorAscent ( TInt )

    IMPORT_C TIntMatcherCursorAscent(TIntaCurrentItemIndex)const [virtual]

    Gets the ascent of the matcher cursor.

    This is obtained for the item at index aCurrentItemIndex. The function returns 0 by default.

    Deprecated

    ParameterDescription
    aCurrentItemIndexItem index of the target item.

    Returns: The height of the matcher cursor.

    MatcherCursorRect ( const TDesC &, TInt, TInt, TInt )

    IMPORT_C TRectMatcherCursorRect(const TDesC &aMatchableText,
    TIntaCharPos,
    TIntaItemCellYPos,
    TIntaCurrentItemIndex
    )const [virtual]

    Gets a rectangle describing where the matcher cursor should be drawn. The default behavious is to return uninitialised TRect.

    Deprecated

    ParameterDescription
    aMatchableTextThe text of the currently matched string.
    aCharPosThe position in the string of the character just matched in the current incremental match.
    aItemCellYPosY position of the item cell.
    aCurrentItemIndexItem index for the current item.

    Returns: Where the cursor should be drawn.

    MinimumCellSize ( )

    IMPORT_C TSizeMinimumCellSize()const [virtual]

    Gets the minimum cell size.

    Returns: The minimum size for a cell. This is TSize(0, 0) in CListItemDrawer.

    Properties ( TInt )

    IMPORT_C TListItemPropertiesProperties(TIntaItemIndex)const [virtual]

    Gets the colour and style properties of the specified item.

    ParameterDescription
    aItemIndexThe index of the item for which properties are obtained (Not Used).

    Returns: The item's properties.

    ResetGc ( )

    IMPORT_C voidResetGc()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.

    SetBackColor ( TRgb )

    voidSetBackColor(TRgbaColor)[inline]

    Sets the colour used to draw the background for non-highlighted items.

    ParameterDescription
    aColorThe background colour.

    SetData ( CListBoxData * )

    IMPORT_C voidSetData(CListBoxData *aData)

    Sets the font storage data for the item drawer and transfer ownership of that data.

    ParameterDescription
    aDataFont storage data .

    SetDimmedBackColor ( TRgb )

    voidSetDimmedBackColor(TRgbaColor)[inline]

    Sets the colour used to draw the background for dimmed items.

    ParameterDescription
    aColorThe background colour for dimmed items.

    SetDimmedTextColor ( TRgb )

    voidSetDimmedTextColor(TRgbaColor)[inline]

    Sets the colour used to draw dimmed text.

    ParameterDescription
    aColorThe dimmed text colour.

    SetDrawMark ( TBool )

    IMPORT_C voidSetDrawMark(TBoolaDrawMark)

    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.

    ParameterDescription
    aDrawMarkNew value for iDrawMark.

    SetFlags ( TInt )

    IMPORT_C voidSetFlags(TIntaFlags)

    Sets the item drawer flags.

    ParameterDescription
    aFlagsThe new item drawer flags.

    SetGc ( CWindowGc * )

    IMPORT_C voidSetGc(CWindowGc *aGc)[virtual]

    Sets the graphics context which this object uses for drawing.

    ParameterDescription
    aGcPointer to the context to use.

    SetHighlightedBackColor ( TRgb )

    voidSetHighlightedBackColor(TRgbaColor)[inline]

    Sets the colour used to draw the background for highlighted items.

    ParameterDescription
    aColorThe highlighted background colour.

    SetHighlightedTextColor ( TRgb )

    voidSetHighlightedTextColor(TRgbaColor)[inline]

    Sets the colour used to draw highlighted text.

    ParameterDescription
    aColorThe highlighted text colour.

    SetItemCellSize ( const TSize & )

    IMPORT_C voidSetItemCellSize(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.

    ParameterDescription
    aSizeInPixelsNew size for the item cell.

    SetMarkColumnWidth ( TInt )

    IMPORT_C voidSetMarkColumnWidth(TIntaWidthInPixels)[virtual]

    Sets the width of the column containing the mark.

    ParameterDescription
    aWidthInPixelsNew width for the mark column.

    SetMarkGutter ( TInt )

    IMPORT_C voidSetMarkGutter(TIntaGapInPixels)[virtual]

    Sets the width of the gap between the column containing the lists item marks and the text column.

    ParameterDescription
    aGapInPixelsNew gap size.

    SetSkinEnabledL ( TBool )

    IMPORT_C voidSetSkinEnabledL(TBoolaEnabled)

    Ability to enable skins in listboxes.

    Since
    S60 2.0
    ParameterDescription
    aEnabledparameter for enabling/disabling skin. ETrue enables skin, EFalse disables skin

    SetSymbolFont ( const CFont * )

    IMPORT_C voidSetSymbolFont(const CFont *aFont)

    Sets symbol font for the item drawer. The symbol font is used to draw the standard tick item marks.

    ParameterDescription
    aFontThe font to be used.

    SetTextColor ( TRgb )

    voidSetTextColor(TRgbaColor)[inline]

    Sets the colour used to draw non-highlighted text.

    ParameterDescription
    aColorThe text colour.

    SetVerticalInterItemGap ( TInt )

    IMPORT_C voidSetVerticalInterItemGap(TIntaGapInPixels)

    Sets the vertical gap between items in the list.

    ParameterDescription
    aGapInPixelsNew value for the vertical gap between items in pixels.

    SetViewRect ( const TRect & )

    IMPORT_C voidSetViewRect(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.

    ParameterDescription
    aRectNew value for iViewRect.

    SetupGc ( TInt )

    IMPORT_C voidSetupGc(TIntaItemIndex)const [protected]

    Sets up the graphics context for the specified item.

    ParameterDescription
    aItemIndexThe item for which the graphics context will be set up.

    SkinBackgroundControlContext ( )

    IMPORT_C MAknsControlContext *SkinBackgroundControlContext()const

    Access to skin contexts.

    Since
    S60 2.0

    Returns: Pointer to skin background control context.

    TextColor ( )

    TRgb TextColor()const [inline]

    Gets the colour used to draw non-highlighted text.

    Returns: The text colour.

    VerticalInterItemGap ( )

    IMPORT_C TIntVerticalInterItemGap()const [protected]

    Gets the vertical gap between items in pixels.

    Returns: The vertical gap between items in pixels.