epoc32/include/mw/akngridm.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description: 
williamr@2
    15
*     This class is an extension of the text list
williamr@2
    16
*     model class. It is designed specifically to be used with
williamr@2
    17
*     the grid class and the grid view class.
williamr@2
    18
*
williamr@2
    19
*/
williamr@2
    20
williamr@2
    21
williamr@2
    22
williamr@2
    23
// INCLUDES
williamr@2
    24
#if !defined(__AKNGRIDM_H__)
williamr@2
    25
#define __AKNGRIDM_H__  
williamr@2
    26
williamr@2
    27
#include <eiktxlbm.h>
williamr@4
    28
#include <AknUtils.h>
williamr@2
    29
// CLASS DECLARATION
williamr@2
    30
	/**
williamr@2
    31
	* Model class to @c CAknGrid. 
williamr@2
    32
	* Usually this class object is instantiated automatically during the 
williamr@2
    33
	* construction phase of @c CAknGrid object.If programmer wants to provide
williamr@2
    34
	* their own model they must instantiate grid model class object of their
williamr@2
    35
	* own and give it to the @c CAknGrid object using the @c SetModel function
williamr@2
    36
	* before calling the @c ConstructL/ConstructFromResourceL function of
williamr@2
    37
	* @c CAknGrid.
williamr@2
    38
 	*
williamr@2
    39
 	* @since Series60 0.9
williamr@2
    40
 	*/
williamr@2
    41
class CAknGridM : public CTextListBoxModel
williamr@2
    42
	{
williamr@2
    43
public:
williamr@2
    44
williamr@2
    45
	/**
williamr@2
    46
 	* Default C++ constructor.
williamr@2
    47
 	*/
williamr@2
    48
	IMPORT_C CAknGridM();
williamr@2
    49
	
williamr@2
    50
	/**
williamr@2
    51
 	* Destructor.
williamr@2
    52
 	*/
williamr@2
    53
	IMPORT_C virtual ~CAknGridM();
williamr@2
    54
	
williamr@2
    55
	/**
williamr@2
    56
	* Access to the number of items in the arrays.
williamr@2
    57
	* @return Number of cells within the grid (including empty cells).
williamr@2
    58
	*/
williamr@2
    59
	IMPORT_C virtual TInt NumberOfItems() const;
williamr@2
    60
	
williamr@2
    61
	/**
williamr@2
    62
 	* Tests if the given cell index has data.
williamr@2
    63
 	* @param aDataIndex Index to the item to be checked.
williamr@2
    64
 	* @return @c ETrue if the data index given is a data cell within the grid
williamr@2
    65
 	* otherwise returns @c EFalse.
williamr@2
    66
 	*/
williamr@2
    67
	IMPORT_C virtual TBool IndexContainsData(TInt aDataIndex) const;
williamr@2
    68
	
williamr@2
    69
	/**
williamr@2
    70
	* Gives the number of data cells in the grid.
williamr@2
    71
 	* @return Number of the non empty cells in the grid.
williamr@2
    72
 	*/
williamr@2
    73
	IMPORT_C virtual TInt NumberOfData() const;
williamr@2
    74
	
williamr@2
    75
	/**
williamr@2
    76
 	* This function sets the number of empty data cells at the start of the
williamr@2
    77
 	* grid.
williamr@2
    78
 	* @param aNumEmpty Number of empty cells.
williamr@2
    79
 	*/
williamr@2
    80
	IMPORT_C void SetStartCells(TInt aNumEmpty);
williamr@2
    81
	
williamr@2
    82
	/**
williamr@2
    83
	* Gets the index of the first data item in the model.
williamr@2
    84
 	* @return Index of the first data item if data exists in model. Returns -1 
williamr@2
    85
 	* if no data exists.
williamr@2
    86
 	*/
williamr@2
    87
	IMPORT_C TInt IndexOfFirstDataItem() const;
williamr@2
    88
	
williamr@2
    89
	/**
williamr@2
    90
	* Gets the index of the last data item in the model.
williamr@2
    91
 	* @return Index of the last data item if data exists in model. Returns -1
williamr@2
    92
 	* if no data exists.
williamr@2
    93
 	*/
williamr@2
    94
	IMPORT_C TInt IndexOfLastDataItem() const;
williamr@2
    95
	
williamr@2
    96
	/**
williamr@2
    97
	* Gets the text of given index. No check is made that the item index given
williamr@2
    98
	* is a valid grid index. A check should be made using @c IndexContainsData
williamr@2
    99
	* before the function is called. Empty cells at the start should be taken
williamr@2
   100
	* in account of the index given.
williamr@2
   101
 	* @param aItemIndex Index of the grid.
williamr@2
   102
 	* @return a Pointer descriptor to the associated item text for a cell. 
williamr@2
   103
 	*/
williamr@2
   104
	IMPORT_C virtual TPtrC ItemText(TInt aItemIndex) const;
williamr@2
   105
private:
williamr@2
   106
	TInt iEmptyCellsAtStart;
williamr@2
   107
	TInt iEmptyCellsAtEnd;
williamr@2
   108
williamr@2
   109
    TInt iSpare[2];
williamr@2
   110
	}; 
williamr@2
   111
williamr@2
   112
williamr@2
   113
#endif