class CAknGridView : public CListBoxView |
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.
0.9 avkon.lib
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() |
Private Member Functions | |
---|---|
void | DrawUnusedViewPortion() |
IMPORT_C TInt | FindNextItem(TInt, TBool, TBool, TBool, TBool) |
TBool | IsEdgePassed(TInt, TBool, TBool, TBool, TBool, TInt &) |
TBool | IsMoveDown(TCursorMovement) |
TBool | IsMoveRight(TCursorMovement) |
IMPORT_C TAny * | Reserved_1() |
IMPORT_C TInt | SearchByLines(TInt, TInt, TCursorMovement, TBool) |
Public Member Enumerations | |
---|---|
enum | TGridFlags { EPrimaryIsVertical = 0x0001, ETopToBottom = 0x0002, ELeftToRight = 0x0004 } |
enum | TScrollingType { EScrollFollowsItemsAndStops, EScrollFollowsItemsAndLoops, EScrollFollowsGrid, EScrollStops, EScrollIncrementLineAndStops, EScrollIncrementLineAndLoops } |
Protected Member Enumerations | |
---|---|
enum | TPageIndex { EPreviousPage, ENextPage, EHome, EEnd } |
enum | TPositionCurrentIndex { EPage, EColumn, EOppositeCorner } |
Inherited Enumerations | |
---|---|
CListBoxView:TCursorMovement | |
CListBoxView:TFlags | |
CListBoxView:TSelectionMode |
Private Attributes | |
---|---|
SGrid | iGridDetails |
TScrollingType | iScrollInSecondaryDimension |
TScrollingType | iScrollingType |
TInt | iSpare |
IMPORT_C TInt | ActualDataIndex | ( | TInt | aListBoxIndex | ) | const |
Returns the actual index of given listbox index. The actual data index.
TInt aListBoxIndex | The index of the listbox. |
IMPORT_C void | CalcBottomItemIndex | ( | ) | [virtual] |
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] |
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.
IMPORT_C TInt | CalcNewTopItemIndexSoItemIsVisible | ( | TInt | aItemIndex | ) | const [virtual] |
This function gets the item the view would need to be moved to in order to make the specified item visible. The item to scroll to to make aItemIndex visible.
TInt aItemIndex | The item to make visible. |
IMPORT_C void | CalcRowAndColIndexesFromItemIndex | ( | TInt | aItemIndex, |
TInt & | aRowIndex, | |||
TInt & | aColIndex | |||
) | const |
Converts an item index into the (row, column) pair describing that item.
IMPORT_C TInt | CalculateHScrollOffsetSoItemIsVisible | ( | TInt | aItemIndex | ) | [virtual] |
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. The number of columns to scroll, or zero if no scrolling is needed.
TInt aItemIndex | Item to make visible. |
IMPORT_C void | ClearUnusedItemSpace | ( | TInt | aStartItemIndex, |
TInt | aEndItemIndex | |||
) | const [protected] |
This function clears each item s rectangle between the specified start and finish item s indexes.
TInt | ColumnWidth | ( | ) | const [inline] |
This function gets the width of all columns in the view. 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. Current data index.
IMPORT_C TInt | CurrentItemIndex | ( | ) | const [virtual] |
From CListBoxView. This function returns the current item in the grid and -1 if there is no current item, The current item.
IMPORT_C void | DataIndexFromLogicalPos | ( | TInt & | aItemIndex, |
TInt | aRowIndex, | |||
TInt | aColIndex | |||
) | const |
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.
IMPORT_C void | DoMoveL | ( | TCursorMovement | aCursorMovement, |
TSelectionMode | aSelectionMode | |||
) | [protected] |
This function handles movement routines.
TCursorMovement aCursorMovement | Handles cursor movements etc. ECursorNextItem and ECursorPreviousItem. |
TSelectionMode aSelectionMode | Modes for modifying the selection. |
IMPORT_C void | Draw | ( | const TRect * | aClipRect = NULL | ) | const [virtual] |
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().
const TRect * aClipRect = NULL |
IMPORT_C void | DrawColumnRange | ( | TInt | aStartColIndex, |
TInt | aEndColIndex | |||
) | const [protected] |
This function draws every item in every column between the start and end columns inclusively.
IMPORT_C void | DrawItem | ( | TInt | aItemIndex | ) | const [virtual] |
This has been overloaded to ensure that only valid cells are drawn and not the empty cells.
TInt aItemIndex | Index number of the item to draw. |
IMPORT_C void | DrawItemRange | ( | TInt | aStartItemIndex, |
TInt | aEndItemIndex | |||
) | const [virtual] |
This function draws every item between the start and end indices inclusively.
IMPORT_C void | DrawMatcherCursor | ( | ) | [virtual] |
From CListBoxView. Basically empty implementation of CListBoxView::DrawMatcherCursor.
void | DrawUnusedViewPortion | ( | ) | const [private] |
Draws the portion of the grid view rectangle that contains no items.
IMPORT_C TInt | FindNextItem | ( | TInt | aItemIndex, |
TBool | aLookDown, | |||
TBool | aLookRight, | |||
TBool | aFirstLookHorizontal, | |||
TBool | aBeginSearchOnIndex = EFalse | |||
) | [private] |
IMPORT_C TSize | GridCellDimensions | ( | ) | const |
Returns the current grid dimensions. The size of the current grid.
CAknGridM * | GridModel | ( | ) | const [protected, inline] |
This inline function is grid model helper. A pointer to CAknGridM object.
TBool | IsEdgePassed | ( | TInt | aItemIndex, |
TBool | aLookDown, | |||
TBool | aLookRight, | |||
TBool | aFirstLookHorizontal, | |||
TBool | aBeginSearchOnIndex, | |||
TInt & | aNewIndex | |||
) | [private] |
TBool | IsMoveDown | ( | TCursorMovement | aCursorMovement | ) | [private] |
TCursorMovement aCursorMovement |
TBool | IsMoveRight | ( | TCursorMovement | aCursorMovement | ) | [private] |
TCursorMovement aCursorMovement |
IMPORT_C TBool | IsPrimaryVertical | ( | ) | const |
Returns ETrue if the primary dimension of the grid is vertical. if vertical is set as primary, otherwise EFalse.
IMPORT_C TBool | ItemExists | ( | TInt | aListBoxIndex | ) | const [protected] |
This function tests whether an item exists. ETrue if the specified item exists, EFalse otherwise.
TInt aListBoxIndex | Index to test. |
IMPORT_C TPoint | ItemPos | ( | TInt | aItemIndex | ) | const [virtual] |
This function gets the position of the top left corner of the specified item, in pixels. TPoint position of the top left corner of the item, in pixels.
TInt aItemIndex | An item in the model. |
IMPORT_C TSize | ItemSize | ( | TInt | aItemIndex = 0 | ) | const [virtual] |
Gets the size of the specified item. TSize The size of the item in pixels.
TInt aItemIndex = 0 |
IMPORT_C TInt | ListBoxIndex | ( | TInt | aDataIndex | ) | const |
Returns the listbox index of given data index. The index in listbox.
TInt aDataIndex | The index of the actual data. |
IMPORT_C void | ListBoxIndexFromLogicalPos | ( | TInt & | aItemIndex, |
TInt | aRowIndex, | |||
TInt | aColIndex | |||
) | const |
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.
IMPORT_C void | LogicalPosFromDataIndex | ( | TInt | aItemIndex, |
TInt & | aRowIndex, | |||
TInt & | aColIndex | |||
) | const |
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.
IMPORT_C void | LogicalPosFromListBoxIndex | ( | TInt | aItemIndex, |
TInt & | aRowIndex, | |||
TInt & | aColIndex | |||
) | const |
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.
IMPORT_C void | MoveCursorL | ( | TCursorMovement | aCursorMovement, |
TSelectionMode | aSelectionMode | |||
) | [virtual] |
Overloaded MoveCursorL method to process cursor movement according to orientation of the grid.
TCursorMovement aCursorMovement | The cursor movement to apply etc. ECursorNextItem and ECursorPreviousItem. |
TSelectionMode aSelectionMode | The selection mode of the calling list box. |
void | MoveCursorWithRepeatsL | ( | TBool | aNextOrPrev, |
TSelectionMode | aSelectionMode, | |||
TInt | aAmount | |||
) |
Moves cursor with repeats. S60 3.2
TBool aNextOrPrev | |
TSelectionMode aSelectionMode | selection mode. |
TInt 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.
TInt aItemIndex | The wanted item index. |
TSelectionMode aSelectionMode | Mode for modifying the selection. |
IMPORT_C TInt | NumberOfColsInView | ( | ) | const |
This function returns the number of visible columns. The number of visible columns in view.
IMPORT_C TInt | NumberOfRowsInView | ( | ) | const |
This function returns the number of visible rows. The number of visible rows in view.
IMPORT_C TBool | ScrollToMakeItemVisible | ( | TInt | aItemIndex | ) | [virtual] |
Makes the specified item visible by moving the view location and redrawing the control. Index of the item to make visible. ETrue if the control was redrawn, EFalse if no redraw happened (i.e. the item was already visible, or redraw was disabled).
TInt aItemIndex | Index of the item to make visible. |
IMPORT_C TInt | SearchByLines | ( | TInt | aX, |
TInt | aY, | |||
TCursorMovement | aCursorMovement, | |||
TBool | aBeginSearchOnIndex = EFalse | |||
) | [private] |
TInt aX | |
TInt aY | |
TCursorMovement aCursorMovement | |
TBool aBeginSearchOnIndex = EFalse |
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.
TInt 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.
TInt 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.
TSize aGridDimensions | Grid diemnsions. |
IMPORT_C void | SetGridDetails | ( | SGrid | aGridDetails | ) |
Grid initialisation function.
SGrid aGridDetails | Struct of grid details. |
IMPORT_C void | SetItemHeight | ( | TInt | aItemHeight | ) | [virtual] |
This function sets item height in pixels.
TInt 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.
TScrollingType 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.
TScrollingType aSecondaryScrolling | The secondary scrolling type. |
IMPORT_C void | SetSpacesBetweenItems | ( | TSize | aSizeOfSpaceBetweenItems | ) |
Sets the size of the spaces between items.
TSize aSizeOfSpaceBetweenItems | The size of the spaces between items. |
IMPORT_C void | SetTopItemIndex | ( | TInt | aItemIndex | ) | [virtual] |
Sets which item appears at the top left corner of the view. The function changes items displayed in the view appropriately.
TInt 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.
IMPORT_C TInt | VisibleWidth | ( | const TRect & | aRect | ) | const [virtual] |
Gets the visible width of the specified rectangle in pixels. Visible width of aRect in pixels.
const TRect & aRect | Reference to the rectangle for which to get the visible width. |
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.
ETrue if there was an item at aPosition.
Enumeration flags for grid.
EPrimaryIsVertical = 0x0001 |
Vertical is primary direction. |
ETopToBottom = 0x0002 |
From top to bottom. |
ELeftToRight = 0x0004 |
From left to right. |
Enumeration flags for pages.
EPreviousPage |
Previous page. |
ENextPage |
Next page. |
EHome |
First page. |
EEnd |
Last page. |
Enumeration for different scrolling types.
EScrollFollowsItemsAndStops |
Scrolling follows items and stops. |
EScrollFollowsItemsAndLoops |
Scrolling follows items and loops. |
EScrollFollowsGrid |
Scrolling follows grid. |
EScrollStops |
Scrolling stops. |
EScrollIncrementLineAndStops |
Scrolls one line and stops. |
EScrollIncrementLineAndLoops |
Scrolls one line and loops. |