API published in: S60 1st Ed
Link against: avkon.lib
Required Capabilities
None
#include <akngridview.h>
Inherits CListBoxView.
Inherited by CAknGMSStyleGridView.
CAknGridView
handles the drawing, the mapping of the grid data index to the underlying listbox index (and visa 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.
Public Types |
|
enum | TGridFlags { EPrimaryIsVertical = 0x0001, ETopToBottom = 0x0002, ELeftToRight = 0x0004 } |
Enumeration flags for grid. More... |
|
enum | TScrollingType { EScrollFollowsItemsAndStops, EScrollFollowsItemsAndLoops, EScrollFollowsGrid, EScrollStops, EScrollIncrementLineAndStops, EScrollIncrementLineAndLoops } |
Enumeration for different scrolling types. More... |
|
Public Member Functions |
|
IMPORT_C | CAknGridView () |
Default C++ constructor. |
|
virtual IMPORT_C | ~CAknGridView () |
Destructor. |
|
IMPORT_C TInt | ActualDataIndex (TInt aListBoxIndex) const |
Returns the actual index of given listbox index. |
|
IMPORT_C TInt | ListBoxIndex (TInt aDataIndex) const |
Returns the listbox index of given data index. |
|
IMPORT_C TInt | CurrentDataIndex () const |
Returns the current data index with respect to the ordering of the cells in the grid. |
|
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. |
|
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. |
|
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. |
|
IMPORT_C void | SetGridCellDimensions (TSize aGridDimensions) |
Checks that number of cells in the grid is always enough to fill the current grid dimensions. |
|
IMPORT_C TSize | GridCellDimensions () const |
Returns the current grid dimensions. |
|
IMPORT_C void | SetSpacesBetweenItems (TSize aSizeOfSpaceBetweenItems) |
Sets the size of the spaces between items. |
|
IMPORT_C TBool | IsPrimaryVertical () const |
Returns ETrue if the primary dimension of the grid is vertical. |
|
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 | 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 | 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 | 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.
|
|
virtual IMPORT_C void | DrawEmptyList () const |
Draws empty grid list. |
|
IMPORT_C void | SetGridDetails (SGrid aGridDetails) |
Grid initialisation function. |
|
IMPORT_C void | MoveToItemIndexL (TInt aItemIndex, TSelectionMode aSelectionMode) |
This moves to the item and draws the grid in the right place. |
|
IMPORT_C TInt | NumberOfColsInView () const |
This function returns the number of visible columns. |
|
IMPORT_C TInt | NumberOfRowsInView () const |
This function returns the number of visible rows. |
|
void | MoveCursorWithRepeatsL (TBool aNextOrPrev, TSelectionMode aSelectionMode, TInt aAmount) |
Moves cursor with repeats. |
|
virtual IMPORT_C void | DrawMatcherCursor () |
From CListBoxView . |
|
IMPORT_C TInt | CurrentItemIndex () const |
From CListBoxView . |
|
IMPORT_C void | SetColumnWidth (TInt aColumnWidth) |
This function sets the width of the grid column. |
|
virtual IMPORT_C void | MoveCursorL (TCursorMovement aCursorMovement, TSelectionMode aSelectionMode) |
Overloaded MoveCursorL method to process cursor movement according to orientation of the grid. |
|
virtual IMPORT_C void | Draw (const TRect *aClipRect=NULL) const |
This function draws every visible item into the specified rectangle. |
|
virtual IMPORT_C void | DrawItem (TInt aItemIndex) const |
This has been overloaded to ensure that only valid cells are drawn and not the empty cells. |
|
virtual IMPORT_C TPoint | ItemPos (TInt aItemIndex) const |
This function gets the position of the top left corner of the specified item, in pixels. |
|
virtual IMPORT_C void | CalcBottomItemIndex () |
This function has been overloaded to draw items correctly. |
|
virtual IMPORT_C TInt | CalcNewTopItemIndexSoItemIsVisible (TInt aItemIndex) const |
This function gets the item the view would need to be moved to in order to make the specified item visible. |
|
virtual IMPORT_C void | DrawItemRange (TInt aStartItemIndex, TInt aEndItemIndex) const |
This function draws every item between the start and end indices inclusively. |
|
TInt | ColumnWidth () const |
This function gets the width of all columns in the view. |
|
virtual IMPORT_C void | SetTopItemIndex (TInt aItemIndex) |
Sets which item appears at the top left corner of the view. |
|
virtual IMPORT_C void | SetItemHeight (TInt aItemHeight) |
This function sets item height in pixels. |
|
virtual IMPORT_C TBool | XYPosToItemIndex (TPoint aPosition, TInt &aItemIndex) const |
Converts a pixel position into an item index. |
|
virtual IMPORT_C void | CalcDataWidth () |
Calculates the data width in columns. |
|
virtual IMPORT_C TInt | VisibleWidth (const TRect &aRect) const |
Gets the visible width of the specified rectangle in pixels. |
|
virtual IMPORT_C TBool | ScrollToMakeItemVisible (TInt aItemIndex) |
Makes the specified item visible by moving the view location and redrawing the control. |
|
virtual IMPORT_C TInt | CalculateHScrollOffsetSoItemIsVisible (TInt aItemIndex) |
Gets the number of columns that this view would need to be scrolled by to make the specified item visible. |
|
virtual IMPORT_C TSize | ItemSize (TInt aItemIndex=0) const |
Gets the size of the specified item. |
|
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 void | CalcItemIndexFromRowAndColIndexes (TInt &aItemIndex, TInt aRowIndex, TInt aColIndex) const |
This function converts a row/column pair into the item index for that item. |
|
Protected Types |
|
enum | TPageIndex { EPreviousPage, ENextPage, EHome, EEnd } |
Enumeration flags for pages. More... |
|
enum | TPositionCurrentIndex { EPage, EColumn, EOppositeCorner } |
Protected Member Functions |
|
IMPORT_C TBool | ItemExists (TInt aListBoxIndex) const |
This function tests whether an item exists. |
|
IMPORT_C void | DrawColumnRange (TInt aStartColIndex, TInt aEndColIndex) const |
This function draws every item in every column between the start and end columns inclusively. |
|
IMPORT_C void | ClearUnusedItemSpace (TInt aStartItemIndex, TInt aEndItemIndex) const |
This function clears each item’s rectangle between the specified start and finish item’s indexes. |
|
IMPORT_C void | UpdateHScrollOffsetBasedOnTopItemIndex () |
This function updates the horizontal scroll offset (iHScrollOffset) based on the top item’s index. |
|
CAknGridM * | GridModel () const |
This inline function is grid model helper. |
|
IMPORT_C void | DoMoveL (TCursorMovement aCursorMovement, TSelectionMode aSelectionMode) |
This function handles movement routines. |
|
Data Structures |
|
struct | SGrid |
Enumeration flags for different layouts. More... |
|
Enumeration flags for grid. |
|
Enumeration flags for pages. |
|
|
|
Default C++ constructor. |
|
Destructor. |
|
Returns the actual index of given listbox index.
|
|
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. Reimplemented from CListBoxView. |
|
Calculates the data width in columns.
Reimplemented from CListBoxView. |
|
This function converts a row/column pair into the item index for that item.
|
|
This function gets the item the view would need to be moved to in order to make the specified item visible.
Reimplemented from CListBoxView. |
|
Converts an item index into the (row, column) pair describing that item.
|
|
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.
|
|
This function clears each item’s rectangle between the specified start and finish item’s indexes.
|
|
This function gets the width of all columns in the view.
|
|
Returns the current data index with respect to the ordering of the cells in the grid.
|
|
From This function returns the current item in the grid and -1 if there is no current item,
Reimplemented from CListBoxView. |
|
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.
|
|
This function handles movement routines.
|
|
This function draws every visible item into the specified rectangle.
As implemented in
Reimplemented from CListBoxView. Reimplemented in CAknGMSStyleGridView. |
|
This function draws every item in every column between the start and end columns inclusively.
|
|
Draws empty grid list. |
|
This has been overloaded to ensure that only valid cells are drawn and not the empty cells.
Reimplemented from CListBoxView. |
|
This function draws every item between the start and end indices inclusively.
|
|
From
Basically empty implementation of Reimplemented from CListBoxView. |
|
Returns the current grid dimensions.
|
|
This inline function is grid model helper.
|
|
Returns
|
|
This function tests whether an item exists.
|
|
This function gets the position of the top left corner of the specified item, in pixels.
Reimplemented from CListBoxView. |
|
Gets the size of the specified item.
Reimplemented from CListBoxView. |
|
Returns the listbox index of given data index.
|
|
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.
|
|
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.
|
|
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.
|
|
Overloaded
|
|
Moves cursor with repeats.
|
|
This moves to the item and draws the grid in the right place.
|
|
This function returns the number of visible columns.
|
|
This function returns the number of visible rows.
|
|
Makes the specified item visible by moving the view location and redrawing the control. Index of the item to make visible.
Reimplemented from CListBoxView. |
|
This function sets the width of the grid column.
This should only be called via the selection box class's
|
|
Sets the current data index with a value given with respect to the ordering of the cells in the grid.
|
|
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.
|
|
Grid initialisation function.
|
|
This function sets item height in pixels.
Reimplemented from CListBoxView. |
|
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.
|
|
Sets the form of scroll to activate upon reaching the limit when moving in the secondary direction of grid.
|
|
Sets the size of the spaces between items.
|
|
Sets which item appears at the top left corner of the view. The function changes items displayed in the view appropriately.
Reimplemented from CListBoxView. |
|
This function updates the horizontal scroll offset (iHScrollOffset) based on the top item’s index.
This function is called internally by |
|
Gets the visible width of the specified rectangle in pixels.
Reimplemented from CListBoxView. |
|
Converts a pixel position into an item index.
The function returns
Reimplemented from CListBoxView. |