#include <mw/AknGridView.h>
class CAknGridView : public CListBoxView |
Public Member Enumerations | |
---|---|
enum | TGridFlags { EPrimaryIsVertical, ETopToBottom, ELeftToRight } |
enum | TScrollingType { EScrollFollowsItemsAndStops, EScrollFollowsItemsAndLoops, EScrollFollowsGrid, EScrollStops, ..., EScrollIncrementLineAndLoops } |
Protected Member Enumerations | |
---|---|
enum | TPageIndex { EPreviousPage, ENextPage, EHome, EEnd } |
enum | TPositionCurrentIndex { EPage, EColumn, EOppositeCorner } |
Protected Member Functions | |
---|---|
IMPORT_C void | ClearUnusedItemSpace(TInt, TInt) |
IMPORT_C void | DoMoveL(TCursorMovement, TSelectionMode) |
IMPORT_C void | DrawColumnRange(TInt, TInt) |
CAknGridM * | GridModel() |
IMPORT_C TBool | ItemExists(TInt) |
IMPORT_C void | UpdateHScrollOffsetBasedOnTopItemIndex() |
Inherited Enumerations | |
---|---|
CListBoxView:TCursorMovement | |
CListBoxView:TFlags | |
CListBoxView:TSelectionMode |
Inherited Type Definitions | |
---|---|
CListBoxView::CSelectionIndexArray |
CAknGridView handles the drawing, the mapping of the grid data index to the underlying listbox index (and vice versa) as well as the movement around the grid. Differentiation is needed between a data index and the list box index since the inherited list box code handles the top, bottom and current indexes as though everything is order topdown and left to right. This is no good for grid that maybe order in 8 different ways so need conversion between list box index and actual data index. List box index is the index for the data item according to the snaking list box format of numbering data items. Data index is the actual index in the grid according to the ordering applied to the data by the user. Note: the logical position is the intermediate form used to map from a list box index to a data index or vi sa versa. It is essentialy the position of the item in relation to the top left corner of the grid. I.e. the top left position has logical position 0,0.
Enumeration for different scrolling types.
IMPORT_C void | CalcBottomItemIndex | ( | ) | [virtual] |
Reimplemented from CListBoxView::CalcBottomItemIndex()
This function has been overloaded to draw items correctly. Recalculates the bottom item s index. This is called by the list box control when either the size or the number of items in its model changes.
IMPORT_C void | CalcDataWidth | ( | ) | [virtual] |
Reimplemented from CListBoxView::CalcDataWidth()
Calculates the data width in columns. iDataWidth is calculated based on model and drawer information.
IMPORT_C void | CalcItemIndexFromRowAndColIndexes | ( | TInt & | aItemIndex, |
TInt | aRowIndex, | |||
TInt | aColIndex | |||
) | const |
This function converts a row/column pair into the item index for that item.
Parameter | Description |
---|---|
aItemIndex | Reference to the item index. |
aRowIndex | Row index of the item. |
aColIndex | Column index of the item. |
Reimplemented from CListBoxView::CalcNewTopItemIndexSoItemIsVisible(TInt)const
This function gets the item the view would need to be moved to in order to make the specified item visible.
Parameter | Description |
---|---|
aItemIndex | The item to make visible. |
Returns: The item to scroll to to make aItemIndex visible.
Gets the number of columns that this view would need to be scrolled by to make the specified item visible. The function returns 0 if no scrolling is needed. ScrollToMakeItemVisible() uses this function.
Parameter | Description |
---|---|
aItemIndex | Item to make visible. |
Returns: The number of columns to scroll, or zero if no scrolling is needed.
TInt | ColumnWidth | ( | ) | const [inline] |
This function gets the width of all columns in the view.
Returns: The width of all columns in the view, in pixels.
IMPORT_C TInt | CurrentDataIndex | ( | ) | const |
Returns the current data index with respect to the ordering of the cells in the grid.
Returns: Current data index.
IMPORT_C TInt | CurrentItemIndex | ( | ) | const [virtual] |
Reimplemented from CListBoxView::CurrentItemIndex()const
From CListBoxView. This function returns the current item in the grid and -1 if there is no current item,
Returns: The current item.
Converts a logical position on the grid, where the co-ordinates are with respect to the top left hand corner of the grid, to an index for the cell with respect to the ordering of the cells in the grid.
Parameter | Description |
---|---|
aItemIndex | Reference to the index for the cell in the grid. |
aRowIndex | The row in the grid. |
aColIndex | The column in the grid. |
IMPORT_C void | DoMoveL | ( | TCursorMovement | aCursorMovement, |
TSelectionMode | aSelectionMode | |||
) | [protected] |
This function handles movement routines.
Parameter | Description |
---|---|
aCursorMovement | Handles cursor movements etc. ECursorNextItem and ECursorPreviousItem. |
aSelectionMode | Modes for modifying the selection. |
IMPORT_C void | Draw | ( | const TRect * | aClipRect = NULL | ) | const [virtual] |
Reimplemented from CListBoxView::Draw(const TRect *)const
This function 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().
IMPORT_C void | DrawItem | ( | TInt | aItemIndex | ) | const [virtual] |
Reimplemented from CListBoxView::DrawItem(TInt)const
This has been overloaded to ensure that only valid cells are drawn and not the empty cells.
Parameter | Description |
---|---|
aItemIndex | Index number of the item to draw. |
IMPORT_C void | DrawMatcherCursor | ( | ) | [virtual] |
Reimplemented from CListBoxView::DrawMatcherCursor()
From CListBoxView. Basically empty implementation of CListBoxView::DrawMatcherCursor.
IMPORT_C TSize | GridCellDimensions | ( | ) | const |
Returns the current grid dimensions.
Returns: The size of the current grid.
CAknGridM * | GridModel | ( | ) | const [protected, inline] |
This inline function is grid model helper.
Returns: A pointer to CAknGridM object.
IMPORT_C TBool | IsPrimaryVertical | ( | ) | const |
Returns ETrue if the primary dimension of the grid is vertical.
Returns: if vertical is set as primary, otherwise EFalse.
Reimplemented from CListBoxView::ItemPos(TInt)const
This function gets the position of the top left corner of the specified item, in pixels.
Parameter | Description |
---|---|
aItemIndex | An item in the model. |
Returns: TPoint position of the top left corner of the item, in pixels.
Reimplemented from CListBoxView::ItemSize(TInt)const
Gets the size of the specified item.
Returns: TSize The size of the item in pixels.
Converts a CEikListBox index for a cell in the grid, given with respect to the snaking listbox top down, left to right structure underlying the grid structure, to a logical position on the grid, where the co-ordinates are with respect to the top left hand corner of the grid.
Parameter | Description |
---|---|
aItemIndex | Reference to the index for the cell in the grid. |
aRowIndex | The row in the grid. |
aColIndex | The column in the grid. |
Converts an index for a cell in the grid, given with respect to the ordering of the cells in the grid, to a logical position on the grid, where the co-ordinates are with respect to the top left hand corner of the grid.
Parameter | Description |
---|---|
aItemIndex | The index for the cell in the grid. |
aRowIndex | Reference to the row in the grid. |
aColIndex | Reference to the column in the grid. |
Converts a logical position on the grid, where the co-ordinates are with respect to the top left hand corner of the grid, to a CEikListBox index for the cell with respect to the snaking listbox top down, left to right structure underlying the grid structure.
Parameter | Description |
---|---|
aItemIndex | The index for the cell in the grid. |
aRowIndex | Reference to the row in the grid. |
aColIndex | Reference to the column in the grid. |
IMPORT_C void | MoveCursorL | ( | TCursorMovement | aCursorMovement, |
TSelectionMode | aSelectionMode | |||
) | [virtual] |
Reimplemented from CListBoxView::MoveCursorL(TCursorMovement,TSelectionMode)
Overloaded MoveCursorL method to process cursor movement according to orientation of the grid.
Parameter | Description |
---|---|
aCursorMovement | The cursor movement to apply etc. ECursorNextItem and ECursorPreviousItem. |
aSelectionMode | The selection mode of the calling list box. |
void | MoveCursorWithRepeatsL | ( | TBool | aNextOrPrev, |
TSelectionMode | aSelectionMode, | |||
TInt | aAmount | |||
) |
Parameter | Description |
---|---|
aSelectionMode | selection mode. |
aAmount | Amount of steps to move. |
IMPORT_C void | MoveToItemIndexL | ( | TInt | aItemIndex, |
TSelectionMode | aSelectionMode | |||
) |
This moves to the item and draws the grid in the right place.
Parameter | Description |
---|---|
aItemIndex | The wanted item index. |
aSelectionMode | Mode for modifying the selection. |
IMPORT_C TInt | NumberOfColsInView | ( | ) | const |
This function returns the number of visible columns.
Returns: The number of visible columns in view.
IMPORT_C TInt | NumberOfRowsInView | ( | ) | const |
This function returns the number of visible rows.
Returns: The number of visible rows in view.
Reimplemented from CListBoxView::ScrollToMakeItemVisible(TInt)
Makes the specified item visible by moving the view location and redrawing the control. Index of the item to make visible.
Parameter | Description |
---|---|
aItemIndex | Index of the item to make visible. |
Returns: ETrue if the control was redrawn, EFalse if no redraw happened (i.e. the item was already visible, or redraw was disabled).
IMPORT_C void | SetColumnWidth | ( | TInt | aColumnWidth | ) |
This function sets the width of the grid column. This should only be called via the selection box class's SetColumnWidth method.
Parameter | Description |
---|---|
aColumnWidth | The required width of all columns in the view, in pixels. |
IMPORT_C void | SetCurrentDataIndex | ( | TInt | aDataIndex | ) |
Sets the current data index with a value given with respect to the ordering of the cells in the grid.
Parameter | Description |
---|---|
aDataIndex | The index to be set. |
IMPORT_C void | SetGridCellDimensions | ( | TSize | aGridDimensions | ) |
Checks that number of cells in the grid is always enough to fill the current grid dimensions. This method should be called after any method that may alter the amount of data within the grid.
Parameter | Description |
---|---|
aGridDimensions | Grid diemnsions. |
IMPORT_C void | SetGridDetails | ( | SGrid | aGridDetails | ) |
Grid initialisation function.
Parameter | Description |
---|---|
aGridDetails | Struct of grid details. |
IMPORT_C void | SetItemHeight | ( | TInt | aItemHeight | ) | [virtual] |
Reimplemented from CListBoxView::SetItemHeight(TInt)
This function sets item height in pixels.
Parameter | Description |
---|---|
aItemHeight | New height in pixels for this view s items. |
IMPORT_C void | SetPrimaryScrollingType | ( | TScrollingType | aScrollingType | ) |
Sets the form of scroll to activate upon reaching the limit when moving in the primary direction of grid, primary meaning whether the items are organised vertically or horizontally.
Parameter | Description |
---|---|
aScrollingType | The primary scrolling type. |
IMPORT_C void | SetSecondaryScrollingType | ( | TScrollingType | aSecondaryScrolling | ) |
Sets the form of scroll to activate upon reaching the limit when moving in the secondary direction of grid.
Parameter | Description |
---|---|
aSecondaryScrolling | The secondary scrolling type. |
IMPORT_C void | SetSpacesBetweenItems | ( | TSize | aSizeOfSpaceBetweenItems | ) |
Sets the size of the spaces between items.
Parameter | Description |
---|---|
aSizeOfSpaceBetweenItems | The size of the spaces between items. |
IMPORT_C void | SetTopItemIndex | ( | TInt | aItemIndex | ) | [virtual] |
Reimplemented from CListBoxView::SetTopItemIndex(TInt)
Sets which item appears at the top left corner of the view. The function changes items displayed in the view appropriately.
Parameter | Description |
---|---|
aItemIndex | Index of the item to set at the top left. |
IMPORT_C void | UpdateHScrollOffsetBasedOnTopItemIndex | ( | ) | [protected] |
This function updates the horizontal scroll offset (iHScrollOffset) based on the top item s index. This function is called internally by CEikSnakingListBoxes when needed.
Reimplemented from CListBoxView::VisibleWidth(const TRect &)const
Gets the visible width of the specified rectangle in pixels.
Parameter | Description |
---|---|
aRect | Reference to the rectangle for which to get the visible width. |
Returns: Visible width of aRect in pixels.
Reimplemented from CListBoxView::XYPosToItemIndex(TPoint,TInt &)const
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.
Parameter | Description |
---|---|
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.