CAknGridM Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <akngridm.h>

Inherits CTextListBoxModel.


Detailed Description

Model class to CAknGrid.

Usually this class object is instantiated automatically during the construction phase of CAknGrid object.If programmer wants to provide their own model they must instantiate grid model class object of their own and give it to the CAknGrid object using the SetModel function before calling the ConstructL/ConstructFromResourceL function of CAknGrid.


Public Member Functions

IMPORT_C  CAknGridM ()
  Default C++ constructor.
virtual IMPORT_C  ~CAknGridM ()
  Destructor.
virtual IMPORT_C TInt  NumberOfItems () const
  Access to the number of items in the arrays.
virtual IMPORT_C TBool  IndexContainsData (TInt aDataIndex) const
  Tests if the given cell index has data.
virtual IMPORT_C TInt  NumberOfData () const
  Gives the number of data cells in the grid.
IMPORT_C void  SetStartCells (TInt aNumEmpty)
  This function sets the number of empty data cells at the start of the grid.
IMPORT_C TInt  IndexOfFirstDataItem () const
  Gets the index of the first data item in the model.
IMPORT_C TInt  IndexOfLastDataItem () const
  Gets the index of the last data item in the model.
virtual IMPORT_C TPtrC  ItemText (TInt aItemIndex) const
  Gets the text of given index.

Constructor & Destructor Documentation

IMPORT_C CAknGridM::CAknGridM  ) 
 

Default C++ constructor.

virtual IMPORT_C CAknGridM::~CAknGridM  )  [virtual]
 

Destructor.


Member Function Documentation

virtual IMPORT_C TBool CAknGridM::IndexContainsData TInt  aDataIndex  )  const [virtual]
 

Tests if the given cell index has data.

Parameters:
aDataIndex  Index to the item to be checked.
Returns:
ETrue if the data index given is a data cell within the grid otherwise returns EFalse.
IMPORT_C TInt CAknGridM::IndexOfFirstDataItem  )  const
 

Gets the index of the first data item in the model.

Returns:
Index of the first data item if data exists in model. Returns -1 if no data exists.
IMPORT_C TInt CAknGridM::IndexOfLastDataItem  )  const
 

Gets the index of the last data item in the model.

Returns:
Index of the last data item if data exists in model. Returns -1 if no data exists.
virtual IMPORT_C TPtrC CAknGridM::ItemText TInt  aItemIndex  )  const [virtual]
 

Gets the text of given index.

No check is made that the item index given is a valid grid index. A check should be made using IndexContainsData before the function is called. Empty cells at the start should be taken in account of the index given.

Parameters:
aItemIndex  Index of the grid.
Returns:
a Pointer descriptor to the associated item text for a cell.

Reimplemented from CTextListBoxModel.

virtual IMPORT_C TInt CAknGridM::NumberOfData  )  const [virtual]
 

Gives the number of data cells in the grid.

Returns:
Number of the non empty cells in the grid.
virtual IMPORT_C TInt CAknGridM::NumberOfItems  )  const [virtual]
 

Access to the number of items in the arrays.

Returns:
Number of cells within the grid (including empty cells).

Reimplemented from CTextListBoxModel.

IMPORT_C void CAknGridM::SetStartCells TInt  aNumEmpty  ) 
 

This function sets the number of empty data cells at the start of the grid.

Parameters:
aNumEmpty  Number of empty cells.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top