CListBoxView Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikctl.lib eikcoctl.lib

Capability Information

Required Capabilities

None


#include <eiklbv.h>

Inherited by CAknGridView, CColumnListBoxView, CFormattedCellListBoxView, and CSnakingListBoxView.


Detailed Description

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.


Public Types

typedef CArrayFix< TInt >  CSelectionIndexArray
  The items which are selected within a list box list.
enum   TCursorMovement {
  ECursorNextItem, ECursorPreviousItem, ECursorNextColumn, ECursorPreviousColumn,
  ECursorPreviousPage, ECursorNextPage, ECursorFirstItem, ECursorLastItem,
  ECursorNextScreen, ECursorPrevScreen
}
  Cursor movement flags. More...
enum   TFlags {
  EAnchorExists = 0x0001, EEmphasized = 0x0002, EDimmed = 0x0004, EHasMatcherCursor = 0x0008,
  EDisableRedraw = 0x0010, EPaintedSelection = 0x0020, EMarkSelection = 0x0040, EUnmarkSelection = 0x0080,
  EItemCountModified = 0x0100
}
  List box view flags. More...
enum   TSelectionMode {
  ENoSelection, ESingleSelection, EContiguousSelection, EDisjointSelection,
  EDisjointMarkSelection, EPenMultiselection, EChangeMarkMode
}
  Modes for modifying the selection. More...

Public Member Functions

IMPORT_C  ~CListBoxView ()
  Destructor.
IMPORT_C  CListBoxView ()
  C++ default constructor.
virtual IMPORT_C void  ConstructL (MListBoxModel *aListBoxModel, CListItemDrawer *aItemDrawer, CWsScreenDevice *aScreen, RWindowGroup *aGroupWin, RWindow *aWsWindow, const TRect &aDisplayArea, TInt aItemHeight)
  By default Symbian 2nd phase constructor is private.
IMPORT_C TRect  ViewRect () const
  Gets the list box’s view rectangle.
IMPORT_C void  SetViewRect (const TRect &aRect)
  Sets the area within the list window in which the view can draw itself.
virtual IMPORT_C TInt  CurrentItemIndex () const
  Gets the current item’s index.
IMPORT_C void  SetCurrentItemIndex (TInt aItemIndex)
  Set the index of the current item.
IMPORT_C TInt  TopItemIndex () const
  Gets the index of the item at the top of the view.
virtual IMPORT_C void  SetTopItemIndex (TInt aItemIndex)
  Sets the item at the top of the view by its index in the list of all items.
IMPORT_C TInt  BottomItemIndex () const
  Gets the index of the item at the bottom of this view.
virtual IMPORT_C void  CalcBottomItemIndex ()
  Recalculates the index of the bottom item in the list by using the top item index and the size of the display.
virtual IMPORT_C void  SetItemHeight (TInt aItemHeight)
  Sets the item height.
IMPORT_C void  SetMatcherCursorColor (TRgb aColor)
  Sets the match cursor’s colour.
IMPORT_C void  SetMatcherCursorPos (TInt aPosWithinCurrentItem)
  Sets the match cursor's position.
IMPORT_C TInt  MatcherCursorPos () const
  Gets the match cursor’s position.
virtual IMPORT_C void  DrawMatcherCursor ()
  Draws the match cursor in its current screen position if the matcher cursor flag has been set.
IMPORT_C void  HideMatcherCursor ()
  Hides the matcher cursor.
IMPORT_C void  SetMatcherCursor (TBool aMatcherCursor)
  Sets whether the matcher cursor flag to specify whether the match cursor is drawn.
IMPORT_C void  SetEmphasized (TBool aEmphasized)
  Sets whether or not items are drawn as emphasised.
IMPORT_C void  SetDimmed (TBool aDimmed)
  Sets whether items will be drawn dimmed.
IMPORT_C void  SetDisableRedraw (TBool aDisableRedraw)
  Disables or enables redraws.
IMPORT_C TBool  RedrawDisabled () const
  Tests whether redraw is disabled.
IMPORT_C void  SetPaintedSelection (TBool aPaintedSelection)
  Sets the painted selection flag.
IMPORT_C const CSelectionIndexArray SelectionIndexes () const
  Gets a pointer to the selection list of this view.
IMPORT_C void  GetSelectionIndexesL (CSelectionIndexArray *aSelectionArray) const
  Gets a copy of the array of currently selected items.
IMPORT_C void  SetSelectionIndexesL (const CSelectionIndexArray *aSelectionIndexes)
  Sets the currently selected items of this view from a selection index array.
IMPORT_C void  ClearSelection ()
  Resets the selection state so that there is nothing selected.
virtual IMPORT_C void  UpdateSelectionL (TSelectionMode aSelectionMode)
  Updates item selection.
IMPORT_C void  ToggleItemL (TInt aItemIndex)
  Toggles the selection of an item.
IMPORT_C void  SelectItemL (TInt aItemIndex)
  Selects an item by index.
IMPORT_C void  DeselectItem (TInt aItemIndex)
  Deselects an item by index.
IMPORT_C void  SetAnchor (TInt aItemIndex)
  Sets the anchor to the specified item.
IMPORT_C void  ClearSelectionAnchorAndActiveIndex ()
  Resets the anchor index, the active end and the EAnchorExists flag.
virtual IMPORT_C TBool  ScrollToMakeItemVisible (TInt aItemIndex)
  Scrolls vertically to make a particular item visible.
virtual IMPORT_C void  VScrollTo (TInt aNewTopItemIndex)
  Sets the index of the item to be the top item.
virtual IMPORT_C void  VScrollTo (TInt aNewTopItemIndex, TRect &aMinRedrawRect)
  Sets the index of the item to be the top item.
virtual IMPORT_C void  HScroll (TInt aHScrollAmount)
  Scrolls horizontally by the specified number of pixels.
IMPORT_C TInt  HScrollOffset () const
  Gets the offset of the visible portion of the data from the left margin in pixels.
IMPORT_C void  SetHScrollOffset (TInt aHorizontalOffset)
  Sets the horizontal scroll offset in pixels.
IMPORT_C TInt  DataWidth () const
  Gets the width of the widest item in the list in pixels.
virtual IMPORT_C void  CalcDataWidth ()
  Recalculates the data width of this list box view from the item width of its list item drawer.
virtual IMPORT_C TInt  VisibleWidth (const TRect &aRect) const
  Gets the visible width of the specified rectangle in pixels.
virtual IMPORT_C TInt  CalcNewTopItemIndexSoItemIsVisible (TInt aItemIndex) const
  Calculates which item should be selected in order to make a particular item visible.
virtual IMPORT_C void  Draw (const TRect *aClipRect=NULL) const
  Draws every visible item into the specified rectangle.
virtual IMPORT_C void  DrawItem (TInt aItemIndex) const
  Draws the specified item via CListBoxDrawer::DrawItem() if it is visible.
IMPORT_C void  SetListEmptyTextL (const TDesC &aText)
  Sets list box backroung text.
const TDesC *  EmptyListText () const
  Gets an empty list box text.
IMPORT_C TBool  ItemIsSelected (TInt aItemIndex) const
  Tests whether an item is selected.
IMPORT_C TBool  ItemIsVisible (TInt aItemIndex) const
  Tests whether an item is visible.
virtual IMPORT_C TPoint  ItemPos (TInt aItemIndex) const
  Gets the on-screen position of an item.
virtual IMPORT_C TSize  ItemSize (TInt aItemIndex=0) const
  Gets the on-screen size of an item.
IMPORT_C void  SetTextColor (TRgb aColor)
  Sets the colour in which to display text.
IMPORT_C void  SetBackColor (TRgb aColor)
  Sets the background colour.
IMPORT_C TRgb  TextColor () const
  Gets the colour in which text is to be displayed.
IMPORT_C TRgb  BackColor () const
  Gets the background colour for this view.
virtual IMPORT_C void  MoveCursorL (TCursorMovement aCursorMovement, TSelectionMode aSelectionMode)
  Moves the current item cursor in the specified direction.
virtual IMPORT_C void  VerticalMoveToItemL (TInt aTargetItemIndex, TSelectionMode aSelectionMode)
  Moves to the specified item, sets it as the current item and scrolls the display to make the item visible.
virtual IMPORT_C TBool  XYPosToItemIndex (TPoint aPosition, TInt &aItemIndex) const
  Converts a pixel position into an item index.
virtual IMPORT_C TInt  NumberOfItemsThatFitInRect (const TRect &aRect) const
  Gets the number of items that will fit into a given rectangle.
void  SetVisibilityObserver (MListVisibilityObserver *aObserver)
  Sets the visibility observer.
IMPORT_C TBool  IsVisible () const
  Tests if this view is visible.
CListItemDrawer ItemDrawer () const
  Gets the object used by this list box view to draw its items.
virtual IMPORT_C void  DrawEmptyList (const TRect &aClientRect) const
  Not implemented.
void  DisableVerticalLineDrawing (TBool aDisable)
  Disables vertical line drawing.
IMPORT_C void  DeselectRangeL (TInt aItemIndex1, TInt aItemIndex2)
  Deselects range between given indexes.

Protected Member Functions

TInt  Flags () const
  Gets this view’s flags.
void  SetFlags (TInt aMask)
  Sets this view’s flags according to a bitmask.
void  ClearFlags (TInt aMask)
  Clears this view’s flags according to a bitmask.
IMPORT_C void  SelectRangeL (TInt aItemIndex1, TInt aItemIndex2)
  Selects items between given indexes.

Protected Attributes

TInt  iFlags
  The flags for this list box.
CListItemDrawer iItemDrawer
  This view’s item drawer.
MListBoxModel iModel
  This view’s model.
TInt  iDataWidth
  Width (in pixels) of the longest item in the model.
TInt  iTopItemIndex
  Index of the item at the top of the view.
TInt  iBottomItemIndex
  Index of the item at the bottom of the view.
TInt  iHScrollOffset
  Pixel offset of the visible portion of the data from the left margin.
TInt  iCurrentItemIndex
  Index of the current item.
TInt  iItemHeight
  Height of each item in the list in pixels.
RWindow *  iWin
  This list box view’s window.
RWindowGroup *  iGroupWin
  The window group of this view.
CWindowGc *  iGc
  Graphics context for the control.
TRect  iViewRect
  Graphics context for the control.
HBufC *  iListEmptyText
  The empty list text.
TBool  iDisableVerticalLineDrawing
  Indicates whether vertical line drawing is disabled.

Friends

class  CEikListBox
  List box base class.

Member Typedef Documentation

typedef CArrayFix<TInt> CListBoxView::CSelectionIndexArray
 

The items which are selected within a list box list.


Member Enumeration Documentation

enum CListBoxView::TCursorMovement
 

Cursor movement flags.

These describe the cursor movements recognised by MoveCursorL().

Enumerator:
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 CListBoxView::TFlags
 

List box view flags.

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

Enumerator:
EAnchorExists  A selection anchor exists.
EEmphasized  The view is emphasised.
EDimmed  The view is dimmed.
EHasMatcherCursor  List box view has a cursor for incremental matching.
EDisableRedraw  Redraw is disabled.
EPaintedSelection  If set, selected items are painted.
EMarkSelection  Item marking enabled.
EUnmarkSelection  Item unmarking enabled.
EItemCountModified  Item count changes enabled.
enum CListBoxView::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.

Enumerator:
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.

Constructor & Destructor Documentation

IMPORT_C CListBoxView::~CListBoxView  ) 
 

Destructor.

IMPORT_C CListBoxView::CListBoxView  ) 
 

C++ default constructor.

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


Member Function Documentation

IMPORT_C TRgb CListBoxView::BackColor  )  const
 

Gets the background colour for this view.

Returns:
The background colour.
IMPORT_C TInt CListBoxView::BottomItemIndex  )  const
 

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

Returns:
Index of the item at the bottom of this view.
virtual IMPORT_C void CListBoxView::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.

Reimplemented in CAknGridView, CAknColumnListBoxView, CColumnListBoxView, CFormattedCellListBoxView, and CSnakingListBoxView.

virtual IMPORT_C void CListBoxView::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.

Reimplemented in CAknGridView, and CSnakingListBoxView.

virtual IMPORT_C TInt CListBoxView::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:
aItemIndex  The index of the new top item.
Returns:
The item to be selected.

Reimplemented in CAknGridView, and CSnakingListBoxView.

void CListBoxView::ClearFlags TInt  aMask  )  [inline, protected]
 

Clears this view’s flags according to a bitmask.

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

Parameters:
aMask  Flags to be removed.
IMPORT_C void CListBoxView::ClearSelection  ) 
 

Resets the selection state so that there is nothing selected.

Panic:
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.
IMPORT_C void CListBoxView::ClearSelectionAnchorAndActiveIndex  ) 
 

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

virtual IMPORT_C void CListBoxView::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:
aListBoxModel  The list box model to use.
aItemDrawer  A default-constructed item drawer.
aScreen  Screen on which to display.
aGroupWin  This list box view’s window group.
aWsWindow  Window for this view.
aDisplayArea  The viewing rectangle this list box view is to use.
aItemHeight  Height of a single list item.
virtual IMPORT_C TInt CListBoxView::CurrentItemIndex  )  const [virtual]
 

Gets the current item’s index.

Returns:
Index number of the current item.

Reimplemented in CAknGridView.

IMPORT_C TInt CListBoxView::DataWidth  )  const
 

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

Returns:
Data width in pixels.
IMPORT_C void CListBoxView::DeselectItem TInt  aItemIndex  ) 
 

Deselects an item by index.

Parameters:
aItemIndex  Item to deselect.
Panic:
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.
IMPORT_C void CListBoxView::DeselectRangeL TInt  aItemIndex1,
TInt  aItemIndex2
 

Deselects range between given indexes.

Deprecated:
Parameters:
aItemIndex1  First index of selectable range.
aItemIndex2  Second index of selectable range.
void CListBoxView::DisableVerticalLineDrawing TBool  aDisable  ) 
 

Disables vertical line drawing.

Parameters:
aDisable  ETrue if disabled.
virtual IMPORT_C void CListBoxView::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().

Parameters:
aClipRect  The rectangle to draw into, this is ignored. Default value is NULL.
Panic:
EEikPanicListBoxNoModel Panics if the list box model for this class has not been defined.

Reimplemented in CAknGMSStyleGridView, CAknGridView, CSingleHeadingStyleView, CColumnListBoxView, CFormattedCellListBoxView, CSnakingListBoxView, and CSettingsListBoxView.

virtual IMPORT_C void CListBoxView::DrawEmptyList const TRect &  aClientRect  )  const [virtual]
 

Not implemented.

Parameters:
aClientRect  Not used.

Reimplemented in CAknColumnListBoxView, CAknSetStyleListBoxView, CSingleHeadingStyleView, and CFormattedCellListBoxView.

virtual IMPORT_C void CListBoxView::DrawItem TInt  aItemIndex  )  const [virtual]
 

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

Parameters:
aItemIndex  Index number of the item to draw.

Reimplemented in CAknGridView, and CSettingsListBoxView.

virtual IMPORT_C void CListBoxView::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.

Deprecated:

Reimplemented in CAknGridView.

const TDesC * CListBoxView::EmptyListText  )  const [inline]
 

Gets an empty list box text.

Returns:
Pointer the empty list box text.
TInt CListBoxView::Flags  )  const [inline, protected]
 

Gets this view’s flags.

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

Returns:
List box's flags.
IMPORT_C void CListBoxView::GetSelectionIndexesL CSelectionIndexArray aSelectionArray  )  const
 

Gets a copy of the array of currently selected items.

Parameters:
[in,out]  aSelectionArray  An instantiated CSelectionIndexArray. On return, contains a copy of selection indexes.
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.
IMPORT_C void CListBoxView::HideMatcherCursor  ) 
 

Hides the matcher cursor.

Deprecated:
virtual IMPORT_C void CListBoxView::HScroll TInt  aHScrollAmount  )  [virtual]
 

Scrolls horizontally by the specified number of pixels.

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

Reimplemented in CSnakingListBoxView.

IMPORT_C TInt CListBoxView::HScrollOffset  )  const
 

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

Returns:
The horizontal scroll offset in pixels.
IMPORT_C TBool CListBoxView::IsVisible  )  const
 

Tests if this view is visible.

Returns:
ETrue if this view is visible. EFalse if this view is not visible or does not exist.
CListItemDrawer * CListBoxView::ItemDrawer  )  const [inline]
 

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

Returns:
Pointer to the list box item drawer.

Reimplemented in CSettingsListBoxView.

IMPORT_C TBool CListBoxView::ItemIsSelected TInt  aItemIndex  )  const
 

Tests whether an item is selected.

Parameters:
aItemIndex  Index of item to test.
Returns:
ETrue if the item is selected.
IMPORT_C TBool CListBoxView::ItemIsVisible TInt  aItemIndex  )  const
 

Tests whether an item is visible.

Parameters:
aItemIndex  Index of item to be tested.
Returns:
ETrue if the item is visible.
virtual IMPORT_C TPoint CListBoxView::ItemPos TInt  aItemIndex  )  const [virtual]
 

Gets the on-screen position of an item.

Parameters:
aItemIndex  Index of an item.
Returns:
Position of the item.

Reimplemented in CAknGridView, and CSnakingListBoxView.

virtual IMPORT_C TSize CListBoxView::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:
aItemIndex  Index of an item. Default value is 0.
Returns:
Size of the item.

Reimplemented in CAknGridView, and CSnakingListBoxView.

IMPORT_C TInt CListBoxView::MatcherCursorPos  )  const
 

Gets the match cursor’s position.

Deprecated:
Returns:
Character position of the match cursor within the current item’s string.
virtual IMPORT_C void CListBoxView::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:
aCursorMovement  The cursor movement to apply.
aSelectionMode  The selection mode of the calling list box.
virtual IMPORT_C TInt CListBoxView::NumberOfItemsThatFitInRect const TRect &  aRect  )  const [virtual]
 

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

Parameters:
aRect  The rectangle.
Returns:
The number of items that will fit into the given rectangle.

Reimplemented in CSnakingListBoxView.

IMPORT_C TBool CListBoxView::RedrawDisabled  )  const
 

Tests whether redraw is disabled.

Returns:
ETrue if redraw is disabled.
virtual IMPORT_C TBool CListBoxView::ScrollToMakeItemVisible TInt  aItemIndex  )  [virtual]
 

Scrolls vertically to make a particular item visible.

Parameters:
aItemIndex  The item to make visible.
Returns:
ETrue if any scrolling was done, EFalse if no scrolling was necessary.

Reimplemented in CAknGridView, and CSnakingListBoxView.

IMPORT_C const CSelectionIndexArray* CListBoxView::SelectionIndexes  )  const
 

Gets a pointer to the selection list of this view.

Returns:
Pointer to an array describing the items in the list which are currently selected. The object pointed at is owned by the CListBoxView.
IMPORT_C void CListBoxView::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.

Parameters:
aItemIndex  Item to select.
Panic:
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.
IMPORT_C void CListBoxView::SelectRangeL TInt  aItemIndex1,
TInt  aItemIndex2
[protected]
 

Selects items between given indexes.

Deprecated:
Parameters:
aItemIndex1  First index of selectable range.
aItemIndex2  Second index of selectable range.
IMPORT_C void CListBoxView::SetAnchor TInt  aItemIndex  ) 
 

Sets the anchor to the specified item.

Parameters:
aItemIndex  The index of the item at which the anchor is set.
IMPORT_C void CListBoxView::SetBackColor TRgb  aColor  ) 
 

Sets the background colour.

Parameters:
aColor  The background colour.
IMPORT_C void CListBoxView::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.

Parameters:
aItemIndex  Which item to make current.
Panic:
EEikPanicListBoxInvalidCurrentItemIndexSpecified Panics if the given index is not valid.
IMPORT_C void CListBoxView::SetDimmed TBool  aDimmed  ) 
 

Sets whether items will be drawn dimmed.

The function sets or resets the dim flag.

Parameters:
aDimmed  If ETrue, this view will draw items dimmed. If EFalse this view will not draw items dimmed.
IMPORT_C void CListBoxView::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:
aDisableRedraw  Disables redraw if ETrue.
IMPORT_C void CListBoxView::SetEmphasized TBool  aEmphasized  ) 
 

Sets whether or not items are drawn as emphasised.

The function sets or resets the emphasised flag.

Parameters:
aEmphasized  If ETrue, this view will draw items emphasised. If EFalse will not draw items emphasised.
void CListBoxView::SetFlags TInt  aMask  )  [inline, protected]
 

Sets this view’s flags according to a bitmask.

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

Parameters:
aMask  Sets new flags for the list box.
IMPORT_C void CListBoxView::SetHScrollOffset TInt  aHorizontalOffset  ) 
 

Sets the horizontal scroll offset in pixels.

Parameters:
aHorizontalOffset  New value for the horizontal scroll offset, in pixels.
virtual IMPORT_C void CListBoxView::SetItemHeight TInt  aItemHeight  )  [virtual]
 

Sets the item height.

Parameters:
aItemHeight  New item height.

Reimplemented in CAknGridView, and CSnakingListBoxView.

IMPORT_C void CListBoxView::SetListEmptyTextL const TDesC &  aText  ) 
 

Sets list box backroung text.

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

Parameters:
aText  The text for the empty list box background.
IMPORT_C void CListBoxView::SetMatcherCursor TBool  aMatcherCursor  ) 
 

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

Deprecated:
Parameters:
aMatcherCursor  If ETrue, the view will draw match cursor.
IMPORT_C void CListBoxView::SetMatcherCursorColor TRgb  aColor  ) 
 

Sets the match cursor’s colour.

Deprecated:
Parameters:
aColor  Colour in which to display the incremental match cursor.
IMPORT_C void CListBoxView::SetMatcherCursorPos TInt  aPosWithinCurrentItem  ) 
 

Sets the match cursor's position.

Deprecated:
Parameters:
aPosWithinCurrentItem  Character position for the match cursor within the current item’s string.
IMPORT_C void CListBoxView::SetPaintedSelection TBool  aPaintedSelection  ) 
 

Sets the painted selection flag.

Deprecated:
Parameters:
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.
IMPORT_C void CListBoxView::SetSelectionIndexesL const CSelectionIndexArray aSelectionIndexes  ) 
 

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

Parameters:
aSelectionIndexes  Items to select.
Panic:
EEikPanicListBoxInvalidSelIndexArraySpecified Panics if the given selection index array is not valid.
IMPORT_C void CListBoxView::SetTextColor TRgb  aColor  ) 
 

Sets the colour in which to display text.

Parameters:
aColor  Colour in which to display text.
virtual IMPORT_C void CListBoxView::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().

Parameters:
aItemIndex  Index of the item to start the view at.
Panic:
EEikPanicListBoxInvalidTopItemIndexSpecified Panics if the given index is not valid.

Reimplemented in CAknGridView, and CSnakingListBoxView.

IMPORT_C void CListBoxView::SetViewRect const TRect &  aRect  ) 
 

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

Parameters:
aRect  New view rectangle.
void CListBoxView::SetVisibilityObserver MListVisibilityObserver aObserver  ) 
 

Sets the visibility observer.

Parameters:
aObserver  New visibility observer for this control.
IMPORT_C TRgb CListBoxView::TextColor  )  const
 

Gets the colour in which text is to be displayed.

Returns:
Current text colour.
IMPORT_C void CListBoxView::ToggleItemL TInt  aItemIndex  ) 
 

Toggles the selection of an item.

Parameters:
aItemIndex  Item to toggle.
Panic:
EEikPanicListBoxNoSelIndexArray Panics if selection indexes have not been defined for this class.
IMPORT_C TInt CListBoxView::TopItemIndex  )  const
 

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

Returns:
The item currently displayed at the top of this list box view.
virtual IMPORT_C void CListBoxView::UpdateSelectionL TSelectionMode  aSelectionMode  )  [virtual]
 

Updates item selection.

Parameters:
aSelectionMode  The selection mode.
virtual IMPORT_C void CListBoxView::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:
aTargetItemIndex  The index of the item to which to move.
aSelectionMode  The selection mode.
IMPORT_C TRect CListBoxView::ViewRect  )  const
 

Gets the list box’s view rectangle.

Returns:
This list box’s view rectangle.
virtual IMPORT_C TInt CListBoxView::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:
aRect  The rectangle to get the visible width for.
Returns:
Visible width of aRect.

Reimplemented in CAknGridView, and CSnakingListBoxView.

virtual IMPORT_C void CListBoxView::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:
aNewTopItemIndex  The distance by which to scroll.
aMinRedrawRect  On return, the minimum rectangle to redraw.
virtual IMPORT_C void CListBoxView::VScrollTo TInt  aNewTopItemIndex  )  [virtual]
 

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

Parameters:
aNewTopItemIndex  The item to scroll to.
virtual IMPORT_C TBool CListBoxView::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:
aPosition  A position relative to the origin of the list box control.
aItemIndex  Is set to the item at that position.
Returns:
ETrue if there was an item at aPosition.

Reimplemented in CAknGridView, and CSnakingListBoxView.


Friends And Related Function Documentation

friend class CEikListBox [friend]
 

List box base class.

To access SetFlags()/ClearFlags().


Field Documentation

TInt CListBoxView::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 CListBoxView::iCurrentItemIndex [protected]
 

Index of the current item.

TInt CListBoxView::iDataWidth [protected]
 

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

TBool CListBoxView::iDisableVerticalLineDrawing [protected]
 

Indicates whether vertical line drawing is disabled.

TInt CListBoxView::iFlags [protected]
 

The flags for this list box.

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

CWindowGc* CListBoxView::iGc [protected]
 

Graphics context for the control.

RWindowGroup* CListBoxView::iGroupWin [protected]
 

The window group of this view.

TInt CListBoxView::iHScrollOffset [protected]
 

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

CListItemDrawer* CListBoxView::iItemDrawer [protected]
 

This view’s item drawer.

Not owned.

TInt CListBoxView::iItemHeight [protected]
 

Height of each item in the list in pixels.

HBufC* CListBoxView::iListEmptyText [protected]
 

The empty list text.

MListBoxModel* CListBoxView::iModel [protected]
 

This view’s model.

Not owned.

TInt CListBoxView::iTopItemIndex [protected]
 

Index of the item at the top of the view.

This is not necessarily the item at the start of the list.

TRect CListBoxView::iViewRect [protected]
 

Graphics context for the control.

RWindow* CListBoxView::iWin [protected]
 

This list box view’s window.


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top