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