CAknGridView Class Reference
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.
Nested Classes and Structures
Public Member Functions |
---|
| CAknGridView() |
| ~CAknGridView() |
IMPORT_C TInt | ActualDataIndex(TInt) |
IMPORT_C void | CalcBottomItemIndex() |
IMPORT_C void | CalcDataWidth() |
IMPORT_C void | CalcItemIndexFromRowAndColIndexes(TInt &, TInt, TInt) |
IMPORT_C TInt | CalcNewTopItemIndexSoItemIsVisible(TInt) |
IMPORT_C void | CalcRowAndColIndexesFromItemIndex(TInt, TInt &, TInt &) |
IMPORT_C TInt | CalculateHScrollOffsetSoItemIsVisible(TInt) |
TInt
| ColumnWidth() |
IMPORT_C TInt | CurrentDataIndex() |
IMPORT_C TInt | CurrentItemIndex() |
IMPORT_C void | DataIndexFromLogicalPos(TInt &, TInt, TInt) |
IMPORT_C void | Draw(const TRect *) |
IMPORT_C void | DrawEmptyList() |
IMPORT_C void | DrawItem(TInt) |
IMPORT_C void | DrawItemRange(TInt, TInt) |
IMPORT_C void | DrawMatcherCursor() |
IMPORT_C TSize | GridCellDimensions() |
IMPORT_C TBool | IsPrimaryVertical() |
IMPORT_C TPoint | ItemPos(TInt) |
IMPORT_C TSize | ItemSize(TInt) |
IMPORT_C TInt | ListBoxIndex(TInt) |
IMPORT_C void | ListBoxIndexFromLogicalPos(TInt &, TInt, TInt) |
IMPORT_C void | LogicalPosFromDataIndex(TInt, TInt &, TInt &) |
IMPORT_C void | LogicalPosFromListBoxIndex(TInt, TInt &, TInt &) |
IMPORT_C void | MoveCursorL(TCursorMovement, TSelectionMode) |
void | MoveCursorWithRepeatsL(TBool, TSelectionMode, TInt) |
IMPORT_C void | MoveToItemIndexL(TInt, TSelectionMode) |
IMPORT_C TInt | NumberOfColsInView() |
IMPORT_C TInt | NumberOfRowsInView() |
IMPORT_C TBool | ScrollToMakeItemVisible(TInt) |
IMPORT_C void | SetColumnWidth(TInt) |
IMPORT_C void | SetCurrentDataIndex(TInt) |
IMPORT_C void | SetGridCellDimensions(TSize) |
IMPORT_C void | SetGridDetails(SGrid) |
IMPORT_C void | SetItemHeight(TInt) |
IMPORT_C void | SetPrimaryScrollingType(TScrollingType) |
IMPORT_C void | SetSecondaryScrollingType(TScrollingType) |
IMPORT_C void | SetSpacesBetweenItems(TSize) |
IMPORT_C void | SetTopItemIndex(TInt) |
IMPORT_C TInt | VisibleWidth(const TRect &) |
IMPORT_C TBool | XYPosToItemIndex(TPoint, TInt &) |
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) |
Inherited Functions |
---|
| CBase::CBase() |
| CBase::Delete(CBase *) |
| CBase::Extension_(TUint,TAny *&,TAny *) |
| CBase::operator new(TUint) |
| CBase::operator new(TUint,TAny *) |
| CBase::operator new(TUint,TLeave) |
| CBase::operator new(TUint,TLeave,TUint) |
| CBase::operator new(TUint,TUint) |
| CBase::~CBase() |
| CListBoxView::BackColor()const |
| CListBoxView::BottomItemIndex()const |
| CListBoxView::CListBoxView() |
| CListBoxView::ClearFlags(TInt) |
| CListBoxView::ClearSelection() |
| CListBoxView::ClearSelection(TBool) |
| CListBoxView::ClearSelectionAnchorAndActiveIndex() |
| CListBoxView::ConstructL(MListBoxModel *,CListItemDrawer *,CWsScreenDevice *,RWindowGroup *,RWindow *,const TRect &,TInt) |
| CListBoxView::DataWidth()const |
| CListBoxView::DeselectItem(TInt) |
| CListBoxView::DeselectRangeL(TInt,TInt) |
| CListBoxView::DisableVerticalLineDrawing(TBool) |
| CListBoxView::DrawEmptyList(const TRect &)const |
| CListBoxView::EmptyListText()const |
| CListBoxView::Flags()const |
| CListBoxView::GetSelectionIndexesL(CSelectionIndexArray *)const |
| CListBoxView::HScroll(TInt) |
| CListBoxView::HScrollOffset()const |
| CListBoxView::HideMatcherCursor() |
| CListBoxView::IsVisible()const |
| CListBoxView::ItemDrawer()const |
| CListBoxView::ItemHeight()const |
| CListBoxView::ItemIsPartiallyVisible(TInt)const |
| CListBoxView::ItemIsSelected(TInt)const |
| CListBoxView::ItemIsVisible(TInt)const |
| CListBoxView::ItemOffsetInPixels()const |
| CListBoxView::MatcherCursorPos()const |
| CListBoxView::NumberOfItemsThatFitInRect(const TRect &)const |
| CListBoxView::RedrawDisabled()const |
| CListBoxView::SelectItemL(TInt) |
| CListBoxView::SelectRangeL(TInt,TInt) |
| CListBoxView::SelectionIndexes()const |
| CListBoxView::SetAnchor(TInt) |
| CListBoxView::SetBackColor(TRgb) |
| CListBoxView::SetCurrentItemIndex(TInt) |
| CListBoxView::SetDimmed(TBool) |
| CListBoxView::SetDisableRedraw(TBool) |
| CListBoxView::SetEmphasized(TBool) |
| CListBoxView::SetFlags(TInt) |
| CListBoxView::SetHScrollOffset(TInt) |
| CListBoxView::SetItemOffsetInPixels(TInt) |
| CListBoxView::SetListEmptyTextL(const TDesC &) |
| CListBoxView::SetMatcherCursor(TBool) |
| CListBoxView::SetMatcherCursorColor(TRgb) |
| CListBoxView::SetMatcherCursorPos(TInt) |
| CListBoxView::SetPaintedSelection(TBool) |
| CListBoxView::SetScrolling(TBool) |
| CListBoxView::SetSelectionIndexesL(const CSelectionIndexArray *) |
| CListBoxView::SetTextColor(TRgb) |
| CListBoxView::SetViewRect(const TRect &) |
| CListBoxView::SetVisibilityObserver(MListVisibilityObserver *) |
| CListBoxView::TextColor()const |
| CListBoxView::ToggleItemL(TInt) |
| CListBoxView::TopItemIndex()const |
| CListBoxView::UpdateSelectionL(TSelectionMode) |
| CListBoxView::VScrollTo(TInt) |
| CListBoxView::VScrollTo(TInt,TRect &) |
| CListBoxView::VerticalMoveToItemL(TInt,TSelectionMode) |
| CListBoxView::ViewRect()const |
| CListBoxView::~CListBoxView() |
Constructor & Destructor Documentation
~CAknGridView()
IMPORT_C | ~CAknGridView | ( | ) | [virtual] |
Member Functions Documentation
ActualDataIndex(TInt)
IMPORT_C TInt | ActualDataIndex | ( | TInt | aListBoxIndex | ) | const |
Returns the actual index of given listbox index.
Parameters
TInt aListBoxIndex | The index of the listbox. |
CalcBottomItemIndex()
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.
CalcDataWidth()
IMPORT_C void | CalcDataWidth | ( | ) | [virtual] |
Calculates the data width in columns. iDataWidth is calculated based on model and drawer information.
CalcItemIndexFromRowAndColIndexes(TInt &, TInt, TInt)
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.
Parameters
TInt & aItemIndex | Reference to the item index. |
TInt aRowIndex | Row index of the item. |
TInt aColIndex | Column index of the item. |
CalcNewTopItemIndexSoItemIsVisible(TInt)
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.
Parameters
TInt aItemIndex | The item to make visible. |
CalcRowAndColIndexesFromItemIndex(TInt, TInt &, TInt &)
IMPORT_C void | CalcRowAndColIndexesFromItemIndex | ( | TInt | aItemIndex, |
| TInt & | aRowIndex, |
| TInt & | aColIndex |
| ) | const |
Converts an item index into the (row, column) pair describing that item.
Parameters
TInt aItemIndex | The item index. |
TInt & aRowIndex | Reference to the row index. |
TInt & aColIndex | Reference the column index. |
CalculateHScrollOffsetSoItemIsVisible(TInt)
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.
Parameters
TInt aItemIndex | Item to make visible. |
ClearUnusedItemSpace(TInt, TInt)
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.
Parameters
TInt aStartItemIndex | The first item to clear. |
TInt aEndItemIndex | The last item to clear. |
ColumnWidth()
TInt
| ColumnWidth | ( | ) | const [inline] |
This function gets the width of all columns in the view.
CurrentDataIndex()
IMPORT_C TInt | CurrentDataIndex | ( | ) | const |
Returns the current data index with respect to the ordering of the cells in the grid.
CurrentItemIndex()
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,
DataIndexFromLogicalPos(TInt &, TInt, TInt)
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.
Parameters
TInt & aItemIndex | Reference to the index for the cell in the grid. |
TInt aRowIndex | The row in the grid. |
TInt aColIndex | The column in the grid. |
DoMoveL(TCursorMovement, TSelectionMode)
This function handles movement routines.
Parameters
TCursorMovement aCursorMovement | Handles cursor movements etc. ECursorNextItem and ECursorPreviousItem. |
TSelectionMode aSelectionMode | Modes for modifying the selection. |
Draw(const TRect *)
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().
Parameters
const TRect * aClipRect = NULL | |
DrawColumnRange(TInt, TInt)
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.
Parameters
TInt aStartColIndex | The first column to draw. |
TInt aEndColIndex | The last column to draw. |
DrawEmptyList()
IMPORT_C void | DrawEmptyList | ( | ) | const [virtual] |
DrawItem(TInt)
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.
Parameters
TInt aItemIndex | Index number of the item to draw. |
DrawItemRange(TInt, TInt)
IMPORT_C void | DrawItemRange | ( | TInt | aStartItemIndex, |
| TInt | aEndItemIndex |
| ) | const [virtual] |
This function draws every item between the start and end indices inclusively.
Parameters
TInt aStartItemIndex | The first item to draw. |
TInt aEndItemIndex | The final item to draw. |
DrawMatcherCursor()
IMPORT_C void | DrawMatcherCursor | ( | ) | [virtual] |
DrawUnusedViewPortion()
void | DrawUnusedViewPortion | ( | ) | const [private] |
Draws the portion of the grid view rectangle that contains no items.
FindNextItem(TInt, TBool, TBool, TBool, TBool)
IMPORT_C TInt | FindNextItem | ( | TInt | aItemIndex, |
| TBool | aLookDown, |
| TBool | aLookRight, |
| TBool | aFirstLookHorizontal, |
| TBool | aBeginSearchOnIndex = EFalse |
| ) | [private] |
GridCellDimensions()
IMPORT_C TSize | GridCellDimensions | ( | ) | const |
Returns the current grid dimensions.
GridModel()
CAknGridM * | GridModel | ( | ) | const [protected, inline] |
This inline function is grid model helper.
IsEdgePassed(TInt, TBool, TBool, TBool, TBool, TInt &)
IsMoveDown(TCursorMovement)
IsMoveRight(TCursorMovement)
IsPrimaryVertical()
IMPORT_C TBool | IsPrimaryVertical | ( | ) | const |
Returns ETrue if the primary dimension of the grid is vertical.
ItemExists(TInt)
IMPORT_C TBool | ItemExists | ( | TInt | aListBoxIndex | ) | const [protected] |
This function tests whether an item exists.
Parameters
TInt aListBoxIndex | Index to test. |
ItemPos(TInt)
IMPORT_C TPoint | ItemPos | ( | TInt | aItemIndex | ) | const [virtual] |
This function gets the position of the top left corner of the specified item, in pixels.
Parameters
TInt aItemIndex | An item in the model. |
ItemSize(TInt)
IMPORT_C TSize | ItemSize | ( | TInt | aItemIndex = 0 | ) | const [virtual] |
Gets the size of the specified item.
ListBoxIndex(TInt)
IMPORT_C TInt | ListBoxIndex | ( | TInt | aDataIndex | ) | const |
Returns the listbox index of given data index.
Parameters
TInt aDataIndex | The index of the actual data. |
ListBoxIndexFromLogicalPos(TInt &, TInt, TInt)
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.
Parameters
TInt & aItemIndex | Reference to the index for the cell in the grid. |
TInt aRowIndex | The row in the grid. |
TInt aColIndex | The column in the grid. |
LogicalPosFromDataIndex(TInt, TInt &, TInt &)
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.
Parameters
TInt aItemIndex | The index for the cell in the grid. |
TInt & aRowIndex | Reference to the row in the grid. |
TInt & aColIndex | Reference to the column in the grid. |
LogicalPosFromListBoxIndex(TInt, TInt &, TInt &)
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.
Parameters
TInt aItemIndex | The index for the cell in the grid. |
TInt & aRowIndex | Reference to the row in the grid. |
TInt & aColIndex | Reference to the column in the grid. |
MoveCursorL(TCursorMovement, TSelectionMode)
Overloaded MoveCursorL method to process cursor movement according to orientation of the grid.
Parameters
TCursorMovement aCursorMovement | The cursor movement to apply etc. ECursorNextItem and ECursorPreviousItem. |
TSelectionMode aSelectionMode | The selection mode of the calling list box. |
MoveCursorWithRepeatsL(TBool, TSelectionMode, TInt)
Moves cursor with repeats.
- Since
- S60 3.2
MoveToItemIndexL(TInt, TSelectionMode)
This moves to the item and draws the grid in the right place.
Parameters
TInt aItemIndex | The wanted item index. |
TSelectionMode aSelectionMode | Mode for modifying the selection. |
NumberOfColsInView()
IMPORT_C TInt | NumberOfColsInView | ( | ) | const |
This function returns the number of visible columns.
NumberOfRowsInView()
IMPORT_C TInt | NumberOfRowsInView | ( | ) | const |
This function returns the number of visible rows.
Reserved_1()
IMPORT_C TAny * | Reserved_1 | ( | ) | [private, virtual] |
ScrollToMakeItemVisible(TInt)
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.
Parameters
TInt aItemIndex | Index of the item to make visible. |
SearchByLines(TInt, TInt, TCursorMovement, TBool)
SetColumnWidth(TInt)
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.
Parameters
TInt aColumnWidth | The required width of all columns in the view, in pixels. |
SetCurrentDataIndex(TInt)
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.
Parameters
TInt aDataIndex | The index to be set. |
SetGridCellDimensions(TSize)
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.
Parameters
TSize aGridDimensions | Grid diemnsions. |
SetGridDetails(SGrid)
IMPORT_C void | SetGridDetails | ( | SGrid | aGridDetails | ) | |
Grid initialisation function.
Parameters
SGrid aGridDetails | Struct of grid details. |
SetItemHeight(TInt)
IMPORT_C void | SetItemHeight | ( | TInt | aItemHeight | ) | [virtual] |
This function sets item height in pixels.
Parameters
TInt aItemHeight | New height in pixels for this view s items. |
SetPrimaryScrollingType(TScrollingType)
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.
SetSecondaryScrollingType(TScrollingType)
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.
SetSpacesBetweenItems(TSize)
IMPORT_C void | SetSpacesBetweenItems | ( | TSize | aSizeOfSpaceBetweenItems | ) | |
Sets the size of the spaces between items.
Parameters
TSize aSizeOfSpaceBetweenItems | The size of the spaces between items. |
SetTopItemIndex(TInt)
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.
Parameters
TInt aItemIndex | Index of the item to set at the top left. |
UpdateHScrollOffsetBasedOnTopItemIndex()
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.
VisibleWidth(const TRect &)
IMPORT_C TInt | VisibleWidth | ( | const TRect & | aRect | ) | const [virtual] |
Gets the visible width of the specified rectangle in pixels.
Parameters
const TRect & aRect | Reference to the rectangle for which to get the visible width. |
XYPosToItemIndex(TPoint, TInt &)
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.
Parameters
TPoint aPosition | A position relative to the origin of the list box control. |
TInt & aItemIndex | Is set to the item at that position. |
Member Enumerations Documentation
Enum TGridFlags
Enumeration flags for grid.
Enumerators
EPrimaryIsVertical = 0x0001 |
Vertical is primary direction.
|
ETopToBottom = 0x0002 |
From top to bottom.
|
ELeftToRight = 0x0004 |
From left to right.
|
Enum TPageIndex
Enumeration flags for pages.
Enumerators
EPreviousPage |
Previous page.
|
ENextPage |
Next page.
|
EHome |
First page.
|
EEnd |
Last page.
|
Enum TPositionCurrentIndex
Enumerators
EPage |
Page.
|
EColumn |
Column.
|
EOppositeCorner |
Opposite corner.
|
Enum TScrollingType
Enumeration for different scrolling types.
Enumerators
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.
|
Member Data Documentation
SGrid
iGridDetails
SGrid
| iGridDetails | [private] |
TScrollingType
iScrollInSecondaryDimension
TScrollingType
iScrollingType
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.