williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #if !defined(__GRDCELLS_H__) williamr@2: #define __GRDCELLS_H__ williamr@2: williamr@2: #if !defined(__E32STD_H__) williamr@2: #include williamr@2: #endif williamr@2: #if !defined(__E32BASE_H__) williamr@2: #include williamr@2: #endif williamr@2: #if !defined(__BACELL_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: williamr@2: williamr@2: class CGridCellRegion : public CBase williamr@2: /** Defines a selected region. williamr@2: williamr@2: A selected region consists of one or more cell ranges, represented by TRangeRef williamr@2: objects, that exist within a defined boundary. The boundary is itself defined williamr@2: as a cell range. williamr@2: williamr@2: Cell ranges map cell selections, and the class provides the behaviour to manage williamr@2: these selections. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C static CGridCellRegion* NewL(const TRangeRef& aBounds); williamr@2: IMPORT_C virtual ~CGridCellRegion(); williamr@2: IMPORT_C void AddColL(TInt aCol); williamr@2: IMPORT_C void AddRowL(TInt aRow); williamr@2: IMPORT_C void AddCellRangeL(const TRangeRef& aCellRange); williamr@2: IMPORT_C void SetLastCellRange(const TRangeRef& aCellRange); williamr@2: IMPORT_C void ResizeBounds(const TCellRef& aNewToBounds); williamr@2: IMPORT_C void Reset(); williamr@2: IMPORT_C TInt Count() const; williamr@2: IMPORT_C TBool IsCellSelected(const TCellRef &aCell) const; williamr@2: IMPORT_C TBool IsCellSelected(const TCellRef &aCell,TInt aIndex) const; williamr@2: IMPORT_C TBool IsCellSelectedLastIndex(const TCellRef &aCell) const; williamr@2: IMPORT_C TBool IsRowSelected(TInt aRow) const; williamr@2: IMPORT_C TBool IsRowSelected(TInt aRow,TInt aIndex) const; williamr@2: IMPORT_C TBool IsRowSelectedLastIndex(TInt aRow) const; williamr@2: IMPORT_C TBool IsAnyRowSelected() const; williamr@2: IMPORT_C TBool IsColSelected(TInt aCol) const; williamr@2: IMPORT_C TBool IsColSelected(TInt aCol,TInt aIndex) const; williamr@2: IMPORT_C TBool IsColSelectedLastIndex(TInt aCol) const; williamr@2: IMPORT_C TBool IsAnyColSelected() const; williamr@2: IMPORT_C TBool IsRangeSelected(const TRangeRef &aRange) const; williamr@2: IMPORT_C TBool IsRangeSelected(const TRangeRef &aRange,TInt aIndex) const; williamr@2: IMPORT_C TBool IsRangeSelectedLastIndex(const TRangeRef &aRange) const; williamr@2: IMPORT_C TRangeRef operator[](TInt aIndex) const; williamr@2: IMPORT_C const CArrayFix* RangeList() const; williamr@2: private: williamr@2: CGridCellRegion(const TRangeRef& aBounds); williamr@2: void ConstructL(); williamr@2: private: williamr@2: TRangeRef iBounds; williamr@2: CArrayFix* iRangeList; williamr@2: }; williamr@2: #endif