CListBoxView Class Reference

class CListBoxView : public CBase

List box view.

A list box view displays the list items which are currently visible in a list box. List box views draw each of the items for display using methods defined in their associated list box drawer.

Together with its list item drawer, a CListBoxView encapsulates the on-screen appearance of data in a list box.

List box views also encapsulate item selection, the current item, and the fundamentals of how the selection and the current item are updated according to user input. Input events themselves are handled by CEikListBox , which calls member functions of CListBoxView appropriately.

This class is sufficient for plain list box views, and may be derived from in order to provide more complex list views. TechView supplies and uses the classes CHierarchicalListBoxView and CSnakingListBoxView , which provide two kinds of indented list views.

Inherits from

Public Member Functions
CListBoxView ()
~CListBoxView ()
IMPORT_C TRgb BackColor ()
IMPORT_C TInt BottomItemIndex ()
IMPORT_C void CalcBottomItemIndex ()
IMPORT_C void CalcDataWidth ()
IMPORT_C TInt CalcNewTopItemIndexSoItemIsVisible ( TInt )
IMPORT_C void ClearSelection ()
void ClearSelection ( TBool )
IMPORT_C void ClearSelectionAnchorAndActiveIndex ()
IMPORT_C void ConstructL ( MListBoxModel *, CListItemDrawer *, CWsScreenDevice *, RWindowGroup *, RWindow *, const TRect &, TInt )
IMPORT_C TInt CurrentItemIndex ()
IMPORT_C TInt DataWidth ()
IMPORT_C void DeselectItem ( TInt )
IMPORT_C void DeselectRangeL ( TInt , TInt )
void DisableVerticalLineDrawing ( TBool )
IMPORT_C void Draw (const TRect *)
IMPORT_C void DrawEmptyList (const TRect &)
IMPORT_C void DrawItem ( TInt )
IMPORT_C void DrawMatcherCursor ()
const TDesC * EmptyListText ()
IMPORT_C void GetSelectionIndexesL ( CSelectionIndexArray *)
IMPORT_C void HScroll ( TInt )
IMPORT_C TInt HScrollOffset ()
IMPORT_C void HideMatcherCursor ()
IMPORT_C TBool IsVisible ()
CListItemDrawer * ItemDrawer ()
TInt ItemHeight ()
IMPORT_C TBool ItemIsPartiallyVisible ( TInt )
IMPORT_C TBool ItemIsSelected ( TInt )
IMPORT_C TBool ItemIsVisible ( TInt )
IMPORT_C TInt ItemOffsetInPixels ()
IMPORT_C TPoint ItemPos ( TInt )
IMPORT_C TSize ItemSize ( TInt )
IMPORT_C TInt MatcherCursorPos ()
IMPORT_C void MoveCursorL ( TCursorMovement , TSelectionMode )
IMPORT_C TInt NumberOfItemsThatFitInRect (const TRect &)
IMPORT_C TBool RedrawDisabled ()
IMPORT_C TBool ScrollToMakeItemVisible ( TInt )
IMPORT_C void SelectItemL ( TInt )
IMPORT_C const CSelectionIndexArray * SelectionIndexes ()
IMPORT_C void SetAnchor ( TInt )
IMPORT_C void SetBackColor ( TRgb )
IMPORT_C void SetCurrentItemIndex ( TInt )
IMPORT_C void SetDimmed ( TBool )
IMPORT_C void SetDisableRedraw ( TBool )
IMPORT_C void SetEmphasized ( TBool )
IMPORT_C void SetHScrollOffset ( TInt )
IMPORT_C void SetItemHeight ( TInt )
IMPORT_C void SetItemOffsetInPixels ( TInt )
IMPORT_C void SetListEmptyTextL (const TDesC &)
IMPORT_C void SetMatcherCursor ( TBool )
IMPORT_C void SetMatcherCursorColor ( TRgb )
IMPORT_C void SetMatcherCursorPos ( TInt )
IMPORT_C void SetPaintedSelection ( TBool )
void SetScrolling ( TBool )
IMPORT_C void SetSelectionIndexesL (const CSelectionIndexArray *)
IMPORT_C void SetTextColor ( TRgb )
IMPORT_C void SetTopItemIndex ( TInt )
IMPORT_C void SetViewRect (const TRect &)
void SetVisibilityObserver ( MListVisibilityObserver *)
IMPORT_C TRgb TextColor ()
IMPORT_C void ToggleItemL ( TInt )
IMPORT_C TInt TopItemIndex ()
IMPORT_C void UpdateSelectionL ( TSelectionMode )
IMPORT_C void VScrollTo ( TInt )
IMPORT_C void VScrollTo ( TInt , TRect &)
IMPORT_C void VerticalMoveToItemL ( TInt , TSelectionMode )
IMPORT_C TRect ViewRect ()
IMPORT_C TInt VisibleWidth (const TRect &)
IMPORT_C TBool XYPosToItemIndex ( TPoint , TInt &)
Protected Member Functions
void ClearFlags ( TInt )
TInt Flags ()
IMPORT_C void SelectRangeL ( TInt , TInt )
void SetFlags ( TInt )
Private Member Functions
void SetItemIndex ( TInt )
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()
Public Member Enumerations
enum TCursorMovement {
ECursorNextItem , ECursorPreviousItem , ECursorNextColumn , ECursorPreviousColumn , ECursorPreviousPage , ECursorNextPage , ECursorFirstItem , ECursorLastItem , ECursorNextScreen , ECursorPrevScreen
}
enum TFlags {
EAnchorExists  = 0x0001, EEmphasized  = 0x0002, EDimmed  = 0x0004, EHasMatcherCursor  = 0x0008, EDisableRedraw  = 0x0010, EPaintedSelection  = 0x0020, EMarkSelection  = 0x0040, EUnmarkSelection  = 0x0080, EItemCountModified  = 0x0100, EOffsetChanged  = 0x0200
}
enum TSelectionMode {
ENoSelection , ESingleSelection , EContiguousSelection , EDisjointSelection , EDisjointMarkSelection , EPenMultiselection , EChangeMarkMode
}
Public Member Type Definitions
typedef CArrayFix < TInt > CSelectionIndexArray
Protected Attributes
TInt iBottomItemIndex
TInt iCurrentItemIndex
TInt iDataWidth
TBool iDisableVerticalLineDrawing
CListBoxViewExtension * iExtension
TInt iFlags
CWindowGc * iGc
RWindowGroup * iGroupWin
TInt iHScrollOffset
CListItemDrawer * iItemDrawer
TInt iItemHeight
HBufC * iListEmptyText
MListBoxModel * iModel
TInt iSpare
TInt iTopItemIndex
TInt iVerticalOffset
TRect iViewRect
RWindow * iWin
Private Attributes
TInt iActiveEndIndex
TInt iAnchorIndex
TRgb iBackColor
TRgb iMatcherCursorColor
TInt iMatcherCursorPos
CSelectionIndexArray * iSelectionIndexes
TRgb iTextColor
MListVisibilityObserver * iVisibilityObserver

Constructor & Destructor Documentation

CListBoxView()

IMPORT_C CListBoxView ( )

C++ default constructor.

Allocates an area of memory for a CListBoxView , and begins its initialisation.

~CListBoxView()

IMPORT_C ~CListBoxView ( )

Destructor.

Member Functions Documentation

BackColor()

IMPORT_C TRgb BackColor ( ) const

Gets the background colour for this view.

BottomItemIndex()

IMPORT_C TInt BottomItemIndex ( ) const

Gets the index of the item at the bottom of this view.

CalcBottomItemIndex()

IMPORT_C void CalcBottomItemIndex ( ) [virtual]

Recalculates the index of the bottom item in the list by using the top item index and the size of the display.

This function is called by the owning list box control when either the size of the list box or the number of items in its model changes.

CalcDataWidth()

IMPORT_C void CalcDataWidth ( ) [virtual]

Recalculates the data width of this list box view from the item width of its list item drawer. This method is called directly by CEikListBox when the list box s size changes or when data is added.

CalcNewTopItemIndexSoItemIsVisible(TInt)

IMPORT_C TInt CalcNewTopItemIndexSoItemIsVisible ( TInt aItemIndex ) const [virtual]

Calculates which item should be selected in order to make a particular item visible. Calling VScrollTo (CalcNewTopItemIndexSoItemIsVisible(idx)), for example, would make the item whose index is idx visible.

Parameters

TInt aItemIndex The index of the new top item.

ClearFlags(TInt)

void ClearFlags ( TInt aMask ) [protected, inline]

Clears this view s flags according to a bitmask.

These flags are defined by the nested enum TFlags (below).

Parameters

TInt aMask Flags to be removed.

ClearSelection()

IMPORT_C void ClearSelection ( )

Resets the selection state so that there is nothing selected.

panic
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.

ClearSelection(TBool)

void ClearSelection ( TBool aDrawItems )

Resets the selection state so that there is nothing selected.

panic
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.

Parameters

TBool aDrawItems Whether or not to draw the items which are deselected.

ClearSelectionAnchorAndActiveIndex()

IMPORT_C void ClearSelectionAnchorAndActiveIndex ( )

Resets the anchor index, the active end and the EAnchorExists flag.

ConstructL(MListBoxModel *, CListItemDrawer *, CWsScreenDevice *, RWindowGroup *, RWindow *, const TRect &, TInt)

IMPORT_C void ConstructL ( MListBoxModel * aListBoxModel,
CListItemDrawer * aItemDrawer,
CWsScreenDevice * aScreen,
RWindowGroup * aGroupWin,
RWindow * aWsWindow,
const TRect & aDisplayArea,
TInt aItemHeight
) [virtual]

By default Symbian 2nd phase constructor is private.

This function completes the initialisation of a default-constructed list box view. The item drawer s graphics context is created on aScreen , and the list item drawer s graphics context is set to this. See CListItemDrawer::SetGc() .

Parameters

MListBoxModel * aListBoxModel The list box model to use.
CListItemDrawer * aItemDrawer A default-constructed item drawer.
CWsScreenDevice * aScreen Screen on which to display.
RWindowGroup * aGroupWin This list box view s window group.
RWindow * aWsWindow Window for this view.
const TRect & aDisplayArea The viewing rectangle this list box view is to use.
TInt aItemHeight Height of a single list item.

CurrentItemIndex()

IMPORT_C TInt CurrentItemIndex ( ) const [virtual]

Gets the current item s index.

DataWidth()

IMPORT_C TInt DataWidth ( ) const

Gets the width of the widest item in the list in pixels.

DeselectItem(TInt)

IMPORT_C void DeselectItem ( TInt aItemIndex )

Deselects an item by index.

panic
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.

Parameters

TInt aItemIndex Item to deselect.

DeselectRangeL(TInt, TInt)

IMPORT_C void DeselectRangeL ( TInt aItemIndex1,
TInt aItemIndex2
)

Deselects range between given indexes.

Parameters

TInt aItemIndex1 First index of selectable range.
TInt aItemIndex2 Second index of selectable range.

DisableVerticalLineDrawing(TBool)

void DisableVerticalLineDrawing ( TBool aDisable )

Disables vertical line drawing.

Parameters

TBool aDisable ETrue if disabled.

Draw(const TRect *)

IMPORT_C void Draw ( const TRect * aClipRect = NULL ) const [virtual]

Draws every visible item into the specified rectangle.

As implemented in CListBoxView , this function's argument is ignored and the internal viewing rectangle is used. See SetViewRect() .

panic
EEikPanicListBoxNoModel Panics if the list box model for this class has not been defined.

Parameters

const TRect * aClipRect = NULL The rectangle to draw into, this is ignored. Default value is NULL.

DrawEmptyList(const TRect &)

IMPORT_C void DrawEmptyList ( const TRect & aClientRect ) const [virtual]

Not implemented.

Parameters

const TRect & aClientRect Not used.

DrawItem(TInt)

IMPORT_C void DrawItem ( TInt aItemIndex ) const [virtual]

Draws the specified item via CListBoxDrawer::DrawItem() if it is visible.

Parameters

TInt aItemIndex Index number of the item to draw.

DrawMatcherCursor()

IMPORT_C void DrawMatcherCursor ( ) [virtual]

Draws the match cursor in its current screen position if the matcher cursor flag has been set.

This is deprecated and broken and should not be used.

EmptyListText()

const TDesC * EmptyListText ( ) const [inline]

Gets an empty list box text.

Return text currently in the empty list text

Flags()

TInt Flags ( ) const [protected, inline]

Gets this view s flags.

These flags are defined by the nested enum TFlags (below).

GetSelectionIndexesL(CSelectionIndexArray *)

IMPORT_C void GetSelectionIndexesL ( CSelectionIndexArray * aSelectionArray ) const

Gets a copy of the array of currently selected items.

panic
EEikPanicListBoxInvalidSelIndexArraySpecified Panics if the given selection index array is not valid.
panic
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.

Parameters

CSelectionIndexArray * aSelectionArray An instantiated CSelectionIndexArray. On return, contains a copy of selection indexes.

HScroll(TInt)

IMPORT_C void HScroll ( TInt aHScrollAmount ) [virtual]

Scrolls horizontally by the specified number of pixels.

Parameters

TInt aHScrollAmount The distance to scroll by in pixels. A negative value scrolls to the left, a positive value scrolls to the right.

HScrollOffset()

IMPORT_C TInt HScrollOffset ( ) const

Gets the offset of the visible portion of the data from the left margin in pixels.

HideMatcherCursor()

IMPORT_C void HideMatcherCursor ( )

Hides the matcher cursor.

IsVisible()

IMPORT_C TBool IsVisible ( ) const

Tests if this view is visible.

ItemDrawer()

CListItemDrawer * ItemDrawer ( ) const [inline]

Gets the object used by this list box view to draw its items.

ItemHeight()

TInt ItemHeight ( ) const [inline]

Returns item's height. All items have the same height.

ItemIsPartiallyVisible(TInt)

IMPORT_C TBool ItemIsPartiallyVisible ( TInt aItemIndex ) const

Tests whether an item is partially visible. Note that this returns EFalse also when item is fully visible, i.e. the whole item area is inside the list view rectangle.

Parameters

TInt aItemIndex Index of item to be tested.

ItemIsSelected(TInt)

IMPORT_C TBool ItemIsSelected ( TInt aItemIndex ) const

Tests whether an item is selected.

Parameters

TInt aItemIndex Index of item to test.

ItemIsVisible(TInt)

IMPORT_C TBool ItemIsVisible ( TInt aItemIndex ) const

Tests whether an item is visible.

Parameters

TInt aItemIndex Index of item to be tested.

ItemOffsetInPixels()

IMPORT_C TInt ItemOffsetInPixels ( ) const

Gets view offset.

ItemPos(TInt)

IMPORT_C TPoint ItemPos ( TInt aItemIndex ) const [virtual]

Gets the on-screen position of an item.

Parameters

TInt aItemIndex Index of an item.

ItemSize(TInt)

IMPORT_C TSize ItemSize ( TInt aItemIndex = 0 ) const [virtual]

Gets the on-screen size of an item.

As implemented in CListBoxView , all items report the same size. The size returned may be larger than the width of the list box view, but will not be smaller.

Parameters

TInt aItemIndex = 0 Index of an item. Default value is 0.

MatcherCursorPos()

IMPORT_C TInt MatcherCursorPos ( ) const

Gets the match cursor s position.

MoveCursorL(TCursorMovement, TSelectionMode)

IMPORT_C void MoveCursorL ( TCursorMovement aCursorMovement,
TSelectionMode aSelectionMode
) [virtual]

Moves the current item cursor in the specified direction. This function is called by CEikListBox in response to user input.

Parameters

TCursorMovement aCursorMovement The cursor movement to apply.
TSelectionMode aSelectionMode The selection mode of the calling list box.

NumberOfItemsThatFitInRect(const TRect &)

IMPORT_C TInt NumberOfItemsThatFitInRect ( const TRect & aRect ) const [virtual]

Gets the number of items that will fit into a given rectangle.

Parameters

const TRect & aRect The rectangle.

RedrawDisabled()

IMPORT_C TBool RedrawDisabled ( ) const

Tests whether redraw is disabled.

ScrollToMakeItemVisible(TInt)

IMPORT_C TBool ScrollToMakeItemVisible ( TInt aItemIndex ) [virtual]

Scrolls vertically to make a particular item visible.

Parameters

TInt aItemIndex The item to make visible.

SelectItemL(TInt)

IMPORT_C void SelectItemL ( TInt aItemIndex )

Selects an item by index.

This function leaves if memory could not be allocated for an extra item in the array of selected items.

panic
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.

Parameters

TInt aItemIndex Item to select.

SelectRangeL(TInt, TInt)

IMPORT_C void SelectRangeL ( TInt aItemIndex1,
TInt aItemIndex2
) [protected]

Selects items between given indexes.

Parameters

TInt aItemIndex1 First index of selectable range.
TInt aItemIndex2 Second index of selectable range.

SelectionIndexes()

IMPORT_C const CSelectionIndexArray * SelectionIndexes ( ) const

Gets a pointer to the selection list of this view.

SetAnchor(TInt)

IMPORT_C void SetAnchor ( TInt aItemIndex )

Sets the anchor to the specified item.

Parameters

TInt aItemIndex The index of the item at which the anchor is set.

SetBackColor(TRgb)

IMPORT_C void SetBackColor ( TRgb aColor )

Sets the background colour.

Parameters

TRgb aColor The background colour.

SetCurrentItemIndex(TInt)

IMPORT_C void SetCurrentItemIndex ( TInt aItemIndex )

Set the index of the current item. This function changes the current item, but does not redraw the list view or update the selection.

panic
EEikPanicListBoxInvalidCurrentItemIndexSpecified Panics if the given index is not valid.

Parameters

TInt aItemIndex Which item to make current.

SetDimmed(TBool)

IMPORT_C void SetDimmed ( TBool aDimmed )

Sets whether items will be drawn dimmed.

The function sets or resets the dim flag.

Parameters

TBool aDimmed If ETrue, this view will draw items dimmed. If EFalse this view will not draw items dimmed.

SetDisableRedraw(TBool)

IMPORT_C void SetDisableRedraw ( TBool aDisableRedraw )

Disables or enables redraws.

If this flag is set to ETrue , all member functions which draw items will return immediately without drawing anything. Functions which update the internal state of the list box will still work, but nothing will be drawn or updated on the screen.

Parameters

TBool aDisableRedraw Disables redraw if ETrue.

SetEmphasized(TBool)

IMPORT_C void SetEmphasized ( TBool aEmphasized )

Sets whether or not items are drawn as emphasised.

The function sets or resets the emphasised flag.

Parameters

TBool aEmphasized If ETrue, this view will draw items emphasised. If EFalse will not draw items emphasised.

SetFlags(TInt)

void SetFlags ( TInt aMask ) [protected, inline]

Sets this view s flags according to a bitmask.

These flags are defined by the nested enum TFlags (below).

Parameters

TInt aMask Sets new flags for the list box.

SetHScrollOffset(TInt)

IMPORT_C void SetHScrollOffset ( TInt aHorizontalOffset )

Sets the horizontal scroll offset in pixels.

Parameters

TInt aHorizontalOffset New value for the horizontal scroll offset, in pixels.

SetItemHeight(TInt)

IMPORT_C void SetItemHeight ( TInt aItemHeight ) [virtual]

Sets the item height.

Parameters

TInt aItemHeight New item height.

SetItemIndex(TInt)

void SetItemIndex ( TInt aItemIndex ) [private]

Set item index directly. For CEikListBox .

Parameters

TInt aItemIndex New item index.

SetItemOffsetInPixels(TInt)

IMPORT_C void SetItemOffsetInPixels ( TInt aOffset )

Sets the offset for view.

Parameters

TInt aOffset

SetListEmptyTextL(const TDesC &)

IMPORT_C void SetListEmptyTextL ( const TDesC & aText )

Sets list box backroung text. This text is visible if the list box has no items.

Parameters

const TDesC & aText The text for the empty list box background.

SetMatcherCursor(TBool)

IMPORT_C void SetMatcherCursor ( TBool aMatcherCursor )

Sets whether the matcher cursor flag to specify whether the match cursor is drawn.

Parameters

TBool aMatcherCursor If ETrue, the view will draw match cursor.

SetMatcherCursorColor(TRgb)

IMPORT_C void SetMatcherCursorColor ( TRgb aColor )

Sets the match cursor s colour.

Parameters

TRgb aColor Colour in which to display the incremental match cursor.

SetMatcherCursorPos(TInt)

IMPORT_C void SetMatcherCursorPos ( TInt aPosWithinCurrentItem )

Sets the match cursor's position.

Parameters

TInt aPosWithinCurrentItem Character position for the match cursor within the current item s string.

SetPaintedSelection(TBool)

IMPORT_C void SetPaintedSelection ( TBool aPaintedSelection )

Sets the painted selection flag.

Parameters

TBool aPaintedSelection If ETrue the painted selection flag is set on. If EFalse the selection flag is set off. If NULL the painted selection flag is cleared.

SetScrolling(TBool)

void SetScrolling ( TBool aIsScrolling )

Sets scrolling state.

Parameters

TBool aIsScrolling

SetSelectionIndexesL(const CSelectionIndexArray *)

IMPORT_C void SetSelectionIndexesL ( const CSelectionIndexArray * aSelectionIndexes )

Sets the currently selected items of this view from a selection index array.

panic
EEikPanicListBoxInvalidSelIndexArraySpecified Panics if the given selection index array is not valid.

Parameters

const CSelectionIndexArray * aSelectionIndexes Items to select.

SetTextColor(TRgb)

IMPORT_C void SetTextColor ( TRgb aColor )

Sets the colour in which to display text.

Parameters

TRgb aColor Colour in which to display text.

SetTopItemIndex(TInt)

IMPORT_C void SetTopItemIndex ( TInt aItemIndex ) [virtual]

Sets the item at the top of the view by its index in the list of all items. This function also invokes CalcBottomItemIndex() .

panic
EEikPanicListBoxInvalidTopItemIndexSpecified Panics if the given index is not valid.

Parameters

TInt aItemIndex Index of the item to start the view at.

SetViewRect(const TRect &)

IMPORT_C void SetViewRect ( const TRect & aRect )

Sets the area within the list window in which the view can draw itself.

Parameters

const TRect & aRect New view rectangle.

SetVisibilityObserver(MListVisibilityObserver *)

void SetVisibilityObserver ( MListVisibilityObserver * aObserver )

Sets the visibility observer.

Parameters

MListVisibilityObserver * aObserver New visibility observer for this control.

TextColor()

IMPORT_C TRgb TextColor ( ) const

Gets the colour in which text is to be displayed.

ToggleItemL(TInt)

IMPORT_C void ToggleItemL ( TInt aItemIndex )

Toggles the selection of an item.

panic
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.

Parameters

TInt aItemIndex Item to toggle.

TopItemIndex()

IMPORT_C TInt TopItemIndex ( ) const

Gets the index of the item at the top of the view.

UpdateSelectionL(TSelectionMode)

IMPORT_C void UpdateSelectionL ( TSelectionMode aSelectionMode ) [virtual]

Updates item selection.

Parameters

TSelectionMode aSelectionMode The selection mode.

VScrollTo(TInt)

IMPORT_C void VScrollTo ( TInt aNewTopItemIndex ) [virtual]

Sets the index of the item to be the top item.

Parameters

TInt aNewTopItemIndex The item to scroll to.

VScrollTo(TInt, TRect &)

IMPORT_C void VScrollTo ( TInt aNewTopItemIndex,
TRect & aMinRedrawRect
) [virtual]

Sets the index of the item to be the top item.

This two argument version returns the area which needs redrawing via aMinRedrawRect& . This function does not perform the redraw.

Parameters

TInt aNewTopItemIndex The distance by which to scroll.
TRect & aMinRedrawRect On return, the minimum rectangle to redraw.

VerticalMoveToItemL(TInt, TSelectionMode)

IMPORT_C void VerticalMoveToItemL ( TInt aTargetItemIndex,
TSelectionMode aSelectionMode
) [virtual]

Moves to the specified item, sets it as the current item and scrolls the display to make the item visible.

Parameters

TInt aTargetItemIndex The index of the item to which to move.
TSelectionMode aSelectionMode The selection mode.

ViewRect()

IMPORT_C TRect ViewRect ( ) const

Gets the list box s view rectangle.

VisibleWidth(const TRect &)

IMPORT_C TInt VisibleWidth ( const TRect & aRect ) const [virtual]

Gets the visible width of the specified rectangle in pixels. This function is called by CListBoxView itself on its own viewing rectangle.

Parameters

const TRect & aRect The rectangle to get the visible width for.

XYPosToItemIndex(TPoint, TInt &)

IMPORT_C TBool XYPosToItemIndex ( TPoint aPosition,
TInt & aItemIndex
) const [virtual]

Converts a pixel position into an item index.

The function returns ETrue and sets aItemIndex to the index of the item whose bounding box contains aPosition . Returns EFalse if no such item exists.

Parameters

TPoint aPosition A position relative to the origin of the list box control.
TInt & aItemIndex Is set to the item at that position.

Member Enumerations Documentation

Enum TCursorMovement

Cursor movement flags. These describe the cursor movements recognised by MoveCursorL() .

Enumerators

ECursorNextItem

Cursors movement to next item.

ECursorPreviousItem

Cursors movement to previous item.

ECursorNextColumn

Cursors movement to next column.

ECursorPreviousColumn

Cursors movement to previous column.

ECursorPreviousPage

Cursors movement to previous page.

ECursorNextPage

Cursors movement to next page.

ECursorFirstItem

Cursors movement to the first item.

ECursorLastItem

Cursors movement to the last item.

ECursorNextScreen

Cursors movement to the next screen.

ECursorPrevScreen

Cursors movement to the previous screen.

Enum TFlags

List box view flags.

These flags may be combined with a logical OR to get a combination of effects.

Enumerators

EAnchorExists = 0x0001

A selection anchor exists.

EEmphasized = 0x0002

The view is emphasised.

EDimmed = 0x0004

The view is dimmed.

EHasMatcherCursor = 0x0008

List box view has a cursor for incremental matching.

EDisableRedraw = 0x0010

Redraw is disabled.

EPaintedSelection = 0x0020

If set, selected items are painted.

EMarkSelection = 0x0040

Item marking enabled.

EUnmarkSelection = 0x0080

Item unmarking enabled.

EItemCountModified = 0x0100

Item count changes enabled.

EOffsetChanged = 0x0200

Vertical offset has changed.

Enum TSelectionMode

Modes for modifying the selection.

Changing the current item of a list box view may also affect which items are selected. The selection mode of such an action describes how (or if) the selection is altered by the action.

Each function of CListBoxView which affects the current item is passed an appropriate selection mode by the calling input handler method of CEikListBox . The mode is varied according to the keyboard modifiers held down by the user, or whether a pointer action was a tap or a sweep.

Note that the behaviour of list box views may vary with the target phone due to the wide range of possible input devices. The following description assumes a phone with a pointer and a keyboard.

Enumerators

ENoSelection

The selection is not changed by actions while this is in effect, holding CTRL while pressing cursor up or down for example.

ESingleSelection

Only a single item in the list is allowed to be selected by an action; when selecting individual items with the pointer, or moving using the cursor keys without any modifiers for example.

EContiguousSelection

A single continuous run of items can be added to the selection array by an action, when keyboard-selecting with the shift key held down, or when sweeping a selection with the pointer for example.

EDisjointSelection

Any single item in the list may be added to the selection by an action, when selecting or drag-selecting with the pointer when the CTRL key is held down for example.

EDisjointMarkSelection

Any single item in the list may be removed from the selection by an action, when unselecting for example.

EPenMultiselection

Multiple items can be added to the selection array by an action, when selecting with the edit key for example.

EChangeMarkMode

Mark mode is changed to EUnmarkSelection if item is marked or EMarkSelection if item is not marked by an action, when selecting or unselecting item for example.

Member Type Definitions Documentation

Typedef CSelectionIndexArray

typedef CArrayFix < TInt > CSelectionIndexArray

The items which are selected within a list box list.

Member Data Documentation

TInt iActiveEndIndex

TInt iActiveEndIndex [private]

TInt iAnchorIndex

TInt iAnchorIndex [private]

TRgb iBackColor

TRgb iBackColor [private]

TInt iBottomItemIndex

TInt iBottomItemIndex [protected]

Index of the item at the bottom of the view. This is not necessarily the item at the end of the list.

TInt iCurrentItemIndex

TInt iCurrentItemIndex [protected]

Index of the current item.

TInt iDataWidth

TInt iDataWidth [protected]

Width (in pixels) of the longest item in the model.

TBool iDisableVerticalLineDrawing

TBool iDisableVerticalLineDrawing [protected]

Indicates whether vertical line drawing is disabled.

CListBoxViewExtension * iExtension

CListBoxViewExtension * iExtension [protected]

TInt iFlags

TInt iFlags [protected]

The flags for this list box. These flags are defined by the nested enum TFlags (below).

CWindowGc * iGc

CWindowGc * iGc [protected]

Graphics context for the control.

RWindowGroup * iGroupWin

RWindowGroup * iGroupWin [protected]

The window group of this view.

TInt iHScrollOffset

TInt iHScrollOffset [protected]

Pixel offset of the visible portion of the data from the left margin.

CListItemDrawer * iItemDrawer

CListItemDrawer * iItemDrawer [protected]

This view s item drawer. Not owned.

TInt iItemHeight

TInt iItemHeight [protected]

Height of each item in the list in pixels.

HBufC * iListEmptyText

HBufC * iListEmptyText [protected]

The empty list text.

TRgb iMatcherCursorColor

TRgb iMatcherCursorColor [private]

TInt iMatcherCursorPos

TInt iMatcherCursorPos [private]

MListBoxModel * iModel

MListBoxModel * iModel [protected]

This view s model. Not owned.

CSelectionIndexArray * iSelectionIndexes

CSelectionIndexArray * iSelectionIndexes [private]

TInt iSpare

TInt iSpare [protected]

TRgb iTextColor

TRgb iTextColor [private]

TInt iTopItemIndex

TInt iTopItemIndex [protected]

Index of the item at the top of the view. This is not necessarily the item at the start of the list.

TInt iVerticalOffset

TInt iVerticalOffset [protected]

Current vertical offset of the view in pixels.

TRect iViewRect

TRect iViewRect [protected]

Graphics context for the control.

MListVisibilityObserver * iVisibilityObserver

MListVisibilityObserver * iVisibilityObserver [private]

RWindow * iWin

RWindow * iWin [protected]

This list box view s window.