class CAknGrid : public CEikListBox |
Application grid handling class from Avkon. Provides support for ordering application grids items.
Series 60 0.9
Protected Member Functions | |
---|---|
IMPORT_C TInt | AdjustRectHeightToWholeNumberOfItems(TRect &) |
IMPORT_C void | AdjustTopItemIndex() |
IMPORT_C void | CalcGridSizeL() |
IMPORT_C TInt | CountComponentControls() |
IMPORT_C void | CreateItemDrawerL() |
IMPORT_C void | HandleDragEventL(TPoint) |
IMPORT_C void | HandleScrollEventL(CEikScrollBar *, TEikScrollEvent) |
IMPORT_C TInt | HorizScrollGranularityInPixels() |
IMPORT_C TInt | HorizontalNudgeValue() |
IMPORT_C TTypeUid::Ptr | MopSupplyObject(TTypeUid) |
IMPORT_C void | MoveToNextOrPreviousItemL(TPoint) |
IMPORT_C void | RestoreClientRectFromViewRect(TRect &) |
IMPORT_C void | UpdateScrollBarThumbs() |
Private Member Functions | |
---|---|
void | DoSetLayoutL(TInt, TInt, TInt, TInt, TInt, TSize, TInt, TInt) |
IMPORT_C void * | ExtensionInterface(TUid) |
CAknGridM * | GridModel() |
CAknGridView * | GridView() |
IMPORT_C TAny * | MListBoxModel_Reserved() |
Private Member Enumerations | |
---|---|
enum | TIndicatorEvent { EMove, EChangeNumOfItems, EResize } |
Inherited Enumerations | |
---|---|
CCoeControl:TZoomType | |
CEikListBox:@170 | |
CEikListBox:TFlags | |
CEikListBox:TReasonForFocusLost | |
CEikListBox:TScrollBarOwnerShip |
Private Attributes | |
---|---|
__DECLARE_TEST | |
TBool | iCurrentIsValid |
CAknGridExtension * | iExtension |
TBitFlags | iHorizontalFlags |
TInt | iMinColWidth |
TInt | iNumOfColsInView |
TInt | iNumOfRowsInView |
TBitFlags | iOrientationFlags |
TSize | iSpaceBetweenItems |
TInt | iSpare |
TBitFlags | iVerticalFlags |
IMPORT_C TInt | AdjustRectHeightToWholeNumberOfItems | ( | TRect & | aRect | ) | const [protected, virtual] |
This function rounds down the height of the rectangle (if necessary) so that only a whole number of items can be displayed inside the list box.
TRect & aRect | Rectangle parameter. |
IMPORT_C void | AdjustTopItemIndex | ( | ) | const [protected, virtual] |
This function called by various functions of this class to ensure that the top item index is always a sane value. The implementation in CEikListBox tries to ensure the minimum amount of white space at the bottom of the list box. Note that this function does not affect the current item index.
IMPORT_C void | CalcGridSizeL | ( | ) | [protected, virtual] |
This protected function used by functions to check/alter the dimensions of the grid as data items are added or removed or the size of the items are altered. It also assumes that SetLayoutL has been called. This will not leave if scrollbars have both been turned off. If a leave occurs the framework generates a Symbian Leave code.
IMPORT_C TInt | ColumnWidth | ( | ) | const |
This function gives a width of the column. A width of the column.
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aReader | ) | [virtual] |
The ConstructFromResourceL function needs to be called in case resource data is used. Usually, the CAknGridM class object is instantiated automatically during the construction phase of the CAknGrid object. If an application programmer provides their own grid model class, the application programmer must instantiate their own grid model class object and give it to the CAknGrid object using the SetModel function before calling the ConstructL/ConstructFromResourceL function. If a leave occurs the framework generates a Symbian Leave code.
TResourceReader & aReader | Construct controls from resource file. |
IMPORT_C void | ConstructL | ( | const CCoeControl * | aParent, |
TInt | aFlags = 0 | |||
) | [virtual] |
This is Symbian default constructor. The ConstructL function needs to be called in case resource data is not used. If a leave occurs the framework generates a Symbian Leave code.
const CCoeControl * aParent | |
TInt aFlags = 0 | Parameter for CEikListBox constructor. If the parameter is missing default value is 0. |
IMPORT_C TInt | CountComponentControls | ( | ) | const [protected, virtual] |
Gets a count of the component controls of this grid. The number of component controls.
IMPORT_C void | CreateItemDrawerL | ( | ) | [protected, virtual] |
Creates a formatted list item drawer. If a leave occurs the framework generates a Symbian Leave code.
IMPORT_C TInt | CurrentDataIndex | ( | ) | const |
CurrentDataIndex retrieves the index of the selection. In grids, you should use this method instead of CEikListBox::CurrentItemIndex(), when you are manipulating data stored in the grid's ItemTextArray. While CurrentItemIndex() returns the same value as CurrentItemIndex() on most phones, there will be difference in some language variants where text reading/writing direction is different from left-to-right. A current position of highlight.
void | DoSetLayoutL | ( | TInt | aOrientation, |
TInt | aHorizontal, | |||
TInt | aVertical, | |||
TInt | aNumOfItemsInPrimaryOrient, | |||
TInt | aNumOfItemsInSecondaryOrient, | |||
TSize | aSizeOfItems, | |||
TInt | aWidthOfSpaceBetweenItems = 0, | |||
TInt | aHeightOfSpaceBetweenItems = 0 | |||
) | [private] |
This function sets the size and initial layout of items. If a leave occurs the framework generates a Symbian Leave code.
const TDesC * | EmptyGridText | ( | ) | const [inline] |
This function sets the empty grid text. A pointer to the grid text descriptor.
Return text currently in the empty grid text
IMPORT_C void * | ExtensionInterface | ( | TUid | aInterface | ) | [private, virtual] |
From CAknControl
TUid aInterface |
IMPORT_C void | FocusChanged | ( | TDrawNow | aDrawNow | ) | [virtual] |
Indicates whether the control should be redrawn now. If ENoDrawNow, the function has no immediately effect. EDrawNow redraw control immediately. Series S60 3.0.
TDrawNow aDrawNow |
IMPORT_C void | HandleDragEventL | ( | TPoint | aPointerPos | ) | [protected, virtual] |
This function handles drag events. If a leave occurs the framework generates a Symbian Leave code.
TPoint aPointerPos | The position of the TPointerEvent for which this handler is invoked. |
IMPORT_C void | HandleItemAdditionL | ( | ) |
This function should be called after one or more items have been added to the grid. If a leave occurs the framework generates a Symbian Leave code.
IMPORT_C void | HandleItemRemovalL | ( | ) |
This function should be called after one or more items have been removed from the grid. If a leave occurs the framework generates a Symbian Leave code.
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
Handling of pointer event within the CEikListBox. Used for e.g. selecting an item from the list box.
const TPointerEvent & aPointerEvent | Details of the pointer event that is being handled. |
IMPORT_C void | HandleResourceChange | ( | TInt | aType | ) | [virtual] |
This function handles resource changes. Series S60 2.6.
TInt aType | Message type. |
IMPORT_C void | HandleScrollEventL | ( | CEikScrollBar * | aScrollBar, |
TEikScrollEvent | aEventType | |||
) | [protected, virtual] |
This function handles scroll events caused by scroll bar. It updates grid's view by event and new thumb position.
CEikScrollBar * aScrollBar | pointer to scroll bar sent this event |
TEikScrollEvent aEventType | type of event |
IMPORT_C void | HandleViewRectSizeChangeL | ( | ) | [virtual] |
This function is called when the grid's items, item's data and scroll bars has been changed. This implementation ensures that the current item is visible after resize. If a leave occurs the framework generates a Symbian Leave code.
IMPORT_C TInt | HorizScrollGranularityInPixels | ( | ) | const [protected, virtual] |
This function gets the granularity for horizontal scrolls. The granularity is the minimum size of a horizontal move of the client area. A grain size for horizontal scrolling in pixels.
IMPORT_C TInt | HorizontalNudgeValue | ( | ) | const [protected, virtual] |
This function scroll horizontal by one column when the left/right scroll arrows (i.e. the nudge buttons) are tapped. A nudge value when the buttons are pressed.
IMPORT_C TInt | IndexOfPosition | ( | TPoint | aGridPosition | ) | const |
The grid position function. Gives the data index by using grid's position. The position must be given from the top left corner. If the function returns -1 the item's position is invalid. Activated item's index value.
TPoint aGridPosition | The data item's co-ordinate values. |
IMPORT_C CFormattedCellListBoxItemDrawer * | ItemDrawer | ( | ) | const |
Item drawer. Gets the pointer to the grid class. A pointer to CFormattedCellListBoxItemDrawer object.
IMPORT_C CListBoxView * | MakeViewClassInstanceL | ( | ) | [virtual] |
This function creates a new object and returns pointer to it. If the leave occurs the framework generates a Symbian Leave code. A pointer to CListBoxView class.
IMPORT_C CTextListBoxModel * | Model | ( | ) | const |
This function creates a new object and returns pointer to CTextListBoxModel class. A pointer to CTextListBoxModel object.
IMPORT_C TTypeUid::Ptr | MopSupplyObject | ( | TTypeUid | aId | ) | [protected, virtual] |
From MObjectProvider.
Retrieves an object of the same type as that encapsulated in aId. This function is used to allow controls to ask their owners for access to other objects that they own.
Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.
TTypeUid aId | An encapsulated object type ID. |
IMPORT_C void | MoveToNextOrPreviousItemL | ( | TPoint | aPoint | ) | [protected] |
Moves to the next or previous item on the grid. If a leave occurs the framework generates a Symbian Leave code.
TPoint aPoint | Co-ordinate object parameter. |
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
This function is from CEikAppUi, handles key events. If a leave occurs the framework generates a Symbian Leave code. Response code ( EKeyWasConsumed, EKeyWasNotConsumed )
const TKeyEvent & aKeyEvent | Event to handled. |
TEventCode aType | of the key event. |
IMPORT_C TPoint | PositionAtIndex | ( | TInt | aItemIndex | ) | const |
The grid position function. Gives the data item's co-ordinate values by using item's index value. TPoint co-ordinate values of active item.
TInt aItemIndex | The data item's index value. |
IMPORT_C void | RestoreClientRectFromViewRect | ( | TRect & | aClientRect | ) | const [protected, virtual] |
This function calculates the client area. This method is called by various functions of this class to recalculate the extent of the client area from iViewRect. This implementation takes into account any rounding of the viewing rectangle made to fit a whole number of items.
TRect & aClientRect | On return contains a size for the client area in pixels. |
IMPORT_C void | SetColumnWidth | ( | TInt | aColumnWidth | ) |
This function sets the column width of the grid. Column width cannot be set in a horizontal grid since the number of columns in the grid is defined by the initialising call to SetLayoutL. The column width cannot be larger than the width of the viewing rectangle.
TInt aColumnWidth | A parameter defines a width of the column. |
IMPORT_C void | SetCurrentDataIndex | ( | TInt | aDataIndex | ) |
Moves the cursor to the required grid data index.
TInt aDataIndex | Data index value. |
IMPORT_C void | SetEmptyGridTextL | ( | const TDesC & | aText | ) |
Function sets a grid text to the data item. If a leave occurs the framework generates a Symbian Leave code. Series S60 3.0
const TDesC & aText | Descriptor parameter. |
IMPORT_C void | SetItemHeightL | ( | TInt | aHeight | ) | [virtual] |
This function sets the row height of the grid. Row height cannot be set in a vertical grid since the number of rows in the grid is defined by the initialising call to SetLayoutL. The row height cannot be larger than the height of the viewing rectangle. If a leave occurs the framework generates a Symbian Leave code.
TInt aHeight | The height of the item's rows. |
IMPORT_C void | SetLayoutFromResourceL | ( | TResourceReader & | aReader | ) |
Sets the layout from a resource. Layout includes orientation (either vertical or horizontal), horizontal and vertical direction of numbering, the number of items in the primary and secondary orientation, and the primary and secondary scrolling types. If a leave occurs the framework generates a Symbian Leave code.
TResourceReader & aReader | Constructs controls from a resource file. |
IMPORT_C void | SetLayoutL | ( | TBool | aVerticalOrientation, |
TBool | aLeftToRight, | |||
TBool | aTopToBottom, | |||
TInt | aNumOfItemsInPrimaryOrient, | |||
TInt | aNumOfItemsInSecondaryOrient, | |||
TSize | aSizeOfItems, | |||
TInt | aWidthOfSpaceBetweenItems = 0, | |||
TInt | aHeightOfSpaceBetweenItems = 0 | |||
) |
Sets the orientation of the grid, either vertical or horizontal, the ordering of the data and the size of the primary dimension of the grid. The value for the parameter aNumOfItemsInPrimaryOrient must be greater than zero since this determines the number of items (be it rows or columns) in the primary orientation of the grid. If a leave occurs the framework generates a Symbian Leave code.
TBool aVerticalOrientation | Items vertical orientation. |
TBool aLeftToRight | ETrue left to right. |
TBool aTopToBottom | ETrue top to bottom. |
TInt aNumOfItemsInPrimaryOrient | Number of items in primary orient. |
TInt aNumOfItemsInSecondaryOrient | Number of items in Secondary orient. |
TSize aSizeOfItems | Item size. |
TInt aWidthOfSpaceBetweenItems = 0 | =0 Width of space between items. |
TInt aHeightOfSpaceBetweenItems = 0 | =0 Height of space between items. |
IMPORT_C void | SetModel | ( | CAknGridM * | aModel | ) |
This function gives CAknGridM class pointer to CAknGrid class. Usually, the CAknGridM class object is instantiated automatically during the construction phase of the CAknGrid object. If an application programmer provides their own grid model class, the application programmer must instantiate their own grid model class object and give it to the CAknGrid object using the SetModel function before calling the ConstructL/ConstructFromResourceL function.
CAknGridM * aModel | Pointer to CAknGridM class. |
IMPORT_C void | SetPrimaryScrollingType | ( | CAknGridView::TScrollingType | aScrollingType | ) |
Sets the movement of the cursor with respect to scrolling when the end item in the current row or column, whichever is the primary orientation of the data items, is encountered. The movement maybe either stop, loop back to same row or column or move onto the next logical data item in the sequence.
CAknGridView::TScrollingType aScrollingType | Items scrolling type enum definition. |
IMPORT_C void | SetRect | ( | const TRect & | aRect | ) |
This function handles viewable rectangle.
const TRect & aRect | Rectangle parameter. |
IMPORT_C void | SetSecondaryScrollingType | ( | CAknGridView::TScrollingType | aSecondaryScrolling | ) |
Sets the movement of the cursor with respect to scrolling when the end item in the secondary dimension of the grid is encountered. The movement maybe either stop, loop back back to same row or column or move onto the next logical data item in the sequence.
CAknGridView::TScrollingType aSecondaryScrolling | Secondary scrolling type enum definition. |
IMPORT_C void | SetStartPositionL | ( | TPoint | aGridStartPosition | ) |
Sets the starting position of the data within the grid. A blank page cannot be accessed (since cannot move into empty cells) so a totally blank page is the same as if the page never existed since the user cannot scroll into it. For this reason it is suggested that the start position be no more than one page into the grid. If a leave occurs the framework generates a Symbian Leave code.
TPoint aGridStartPosition | Parameter manipulate the grid's starting position. |
IMPORT_C void | SetTopItemIndex | ( | TInt | aItemIndex | ) | const [virtual] |
This function sets top item index.
TInt aItemIndex | Item index value. |
IMPORT_C void | SizeChanged | ( | ) | [virtual] |
This function handles size changes. This routine assumes that SetLayoutL has been called to set up the grid.
IMPORT_C void | UpdateScrollBarThumbs | ( | ) | const [protected, virtual] |
Updates the position of grids scroll bars thumbs to reflect the vertical position of selector.
IMPORT_C void | UpdateScrollBarsL | ( | ) | [virtual] |
This function updates the scrollbars, including item position. This function is called when the size of the scrollbars or data changes. If the leave occurs the framework generates a Symbian Leave code.