Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GRDCELLS.H>
Link against: grid.lib

Class CGridCellRegion

class CGridCellRegion : public CBase;

Description

Defines a selected region.

A selected region consists of one or more cell ranges, represented by TRangeRef objects, that exist within a defined boundary. The boundary is itself defined as a cell range.

Cell ranges map cell selections, and the class provides the behaviour to manage these selections.

Derivation

Members

Defined in CGridCellRegion:

Inherited from CBase:


Construction and destruction


NewL(const TRangeRef &)

IMPORT_C static CGridCellRegion* NewL(const TRangeRef &aBounds);

Description

Creates a new selected region.

Parameters

const TRangeRef &aBounds

The boundary of the region, defined as cell range.

Return value

CGridCellRegion *

A pointer to the new selected region object.


~CGridCellRegion()

IMPORT_C virtual ~CGridCellRegion();

Description

Destructor.

Frees all resources owned by the object prior to its destruction.

[Top]


Member functions


AddColL(TInt)

IMPORT_C void AddColL(TInt aCol);

Description

Defines a new cell range one column in width, and adds it to the region.

The row number of the start cell of the new range is the row number defining the start of the region boundary.

The row number of the end cell of the new range is the row number defining the end of the region boundary.

Parameters

TInt aCol

The new column. This must lie on or within the region boundary, otherwise no new range is added to the region.


AddRowL(TInt)

IMPORT_C void AddRowL(TInt aRow);

Description

Defines a new cell range one row in height, and adds it to the region.

The column number of the start cell of the new range is the column number defining the start of the region boundary.

The column number of the end cell of the new range is the column number defining the end of the region boundary.

Parameters

TInt aRow

The new row. This must lie on or within the region boundary, otherwise no new range is added to the region.


AddCellRangeL(const TRangeRef &)

IMPORT_C void AddCellRangeL(const TRangeRef &aCellRange);

Description

Adds the specified range to the region.

Parameters

const TRangeRef &aCellRange

The new range. This must lie on or within the region boundary, otherwise it is not added to the region.


SetLastCellRange(const TRangeRef &)

IMPORT_C void SetLastCellRange(const TRangeRef &aCellRange);

Description

Replaces the last range in the region with the specified range.

Note that a region is implemented as an array of ranges, and the last range is the last one in the array.

Parameters

const TRangeRef &aCellRange

The range to replace the last range in the region. Note that it is the caller's responsibility to ensure that this region lies within the region boundary, as no checks are made by the function.

Panic codes

GRIDIMG

1 If the region is empty.


ResizeBounds(const TCellRef &)

IMPORT_C void ResizeBounds(const TCellRef &aNewToBounds);

Description

Defines a new region boundary by replacing the end cell with the specified cell.

Any existing ranges that are now wholly outside the new region boundary are deleted.

Any existing ranges whose boundaries were the same as the old region boundary, are stretched or shrunk so that their boundaries are now on the new region boundary.

Any existing ranges that now intersect the new region boundary are truncated back to the new region boundary.

Any existing ranges that remain wholly within the new region boundary remain unchanged.

Parameters

const TCellRef &aNewToBounds

The new end cell for the region boundary.


Reset()

IMPORT_C void Reset();

Description

Deletes all ranges from the region.


Count()const

IMPORT_C TInt Count() const;

Description

Gets the number of ranges in the region.

Return value

TInt

The number of ranges in the region.


IsCellSelected(const TCellRef &)const

IMPORT_C TBool IsCellSelected(const TCellRef &aCell) const;

Description

Tests whether the specified cell is selected.

A cell is selected if it is in the region.

Parameters

const TCellRef &aCell

The cell to be tested.

Return value

TBool

True, if the cell is selected; false, otherwise. Note that this is also false if the region is empty.


IsCellSelected(const TCellRef &,TInt)const

IMPORT_C TBool IsCellSelected(const TCellRef &aCell, TInt aIndex) const;

Description

Tests whether the specified cell is selected in the range identified by the specified index.

A cell is selected if it lies in the range.

Note that a region is implemented as an array of ranges, and the index identifies a specific range within that array.

Parameters

const TCellRef &aCell

The cell to be tested.

TInt aIndex

An index value identifying a specific range within the region.

Return value

TBool

True, if the specified cell is in the range identified by the index; false, otherwise.

Panic codes

GRIDIMG

2 In debug mode only, if the index value is illegal.


IsCellSelectedLastIndex(const TCellRef &)const

IMPORT_C TBool IsCellSelectedLastIndex(const TCellRef &aCell) const;

Description

Tests whether the specified cell is selected in the last range of the region.

A cell is selected if it lies in the range.

Note that a region is implemented as an array of ranges, and the last range is the last one in the array.

Parameters

const TCellRef &aCell

The cell to be tested.

Return value

TBool

True, if the specified cell is in the last range of the region; false, otherwise. Note that this is also false if the region is empty.


IsRowSelected(TInt)const

IMPORT_C TBool IsRowSelected(TInt aRow) const;

Description

Tests whether the specified row is selected.

A row is selected if the row lies within one of the region's ranges, and the range spans all of the columns defined by the region boundary (i.e. extends from one side of the region boundary to the other).

Parameters

TInt aRow

The row to be tested.

Return value

TBool

True, if the row is selected; false otherwise.


IsRowSelected(TInt,TInt)const

IMPORT_C TBool IsRowSelected(TInt aRow, TInt aIndex) const;

Description

Tests whether the specified row is selected in the range identified by the specified index.

A row is selected in a range only if it lies in the range, and the range spans all of the columns defined by region boundary (i.e. extends from one side of the region boundary to the other).

Note that a region is implemented as an array of ranges, and the index identifies a specific range within that array.

Parameters

TInt aRow

The row to be tested.

TInt aIndex

An index value identifying a specific range within the region.

Return value

TBool

True, if the row is selected; false otherwise.

Panic codes

GRIDIMG

2 In debug mode only, if the index value is illegal.


IsRowSelectedLastIndex(TInt)const

IMPORT_C TBool IsRowSelectedLastIndex(TInt aRow) const;

Description

Tests whether the specified row is selected in the last range in the region.

A row is selected in a range only if it lies in the range, and the range spans all of the columns defined by region boundary (i.e. extends from one side of the region boundary to the other).

Note that a region is implemented as an array of ranges, and the last range is the last one in the array.

Parameters

TInt aRow

The row to be tested.

Return value

TBool

True, if the row is selected; false otherwise. Note that this is also false if the region is empty.


IsAnyRowSelected()const

IMPORT_C TBool IsAnyRowSelected() const;

Description

Tests whether any row is selected.

A row is selected if any range spans all of the columns defined by region boundary (i.e. extends from one side of the region boundary to the other).

Return value

TBool

True, if any row is selected; false, otherwise.


IsColSelected(TInt)const

IMPORT_C TBool IsColSelected(TInt aCol) const;

Description

Tests whether the specified column is selected.

A column is selected if the column lies within one of the region's ranges, and the range spans all of the rows defined by the region boundary (i.e. extends from the top of the region boundary to the bottom).

Parameters

TInt aCol

The column to be tested.

Return value

TBool

True, if the column is selected; false, otherwise.


IsColSelected(TInt,TInt)const

IMPORT_C TBool IsColSelected(TInt aCol, TInt aIndex) const;

Description

Tests whether the specified column is selected in the range identified by the specified index.

A column is selected in a range only if it lies in the range, and the range spans all of the rows defined by the region boundary (i.e. extends from the top of the region boundary to the bottom).

Note that a region is implemented as an array of ranges, and the index identifies a specific range within that array.

Parameters

TInt aCol

The column to be tested.

TInt aIndex

An index value identifying a specific range within the region.

Return value

TBool

True, if the column is selected; false, otherwise.

Panic codes

GRIDIMG

2 In debug mode only, if the index value is illegal.


IsColSelectedLastIndex(TInt)const

IMPORT_C TBool IsColSelectedLastIndex(TInt aCol) const;

Description

Tests whether the specified column is selected in the last range in the region.

A column is selected in a range only if it lies in the range, and the range spans all of the rows defined by the region boundary (i.e. extends from the top of the region boundary to the bottom).

Note that a region is implemented as an array of ranges, and the last range is the last one in the array.

Parameters

TInt aCol

The column to be tested.

Return value

TBool

True, if the column is selected; false otherwise. Note that this is also false if the region is empty.


IsAnyColSelected()const

IMPORT_C TBool IsAnyColSelected() const;

Description

Tests whether any column is selected.

A column is selected if any range spans all of the rows defined by region boundary (i.e. extends from the top of the region boundary to the bottom).

Return value

TBool

True, if any column is selected; false, otherwise.


IsRangeSelected(const TRangeRef &)const

IMPORT_C TBool IsRangeSelected(const TRangeRef &aRange) const;

Description

Tests whether the specified range is selected.

A range is selected if it is one of the ranges making up the region.

Parameters

const TRangeRef &aRange

The range to be tested.

Return value

TBool

True, if the range is one of the ranges making up the region; false, otherwise.


IsRangeSelected(const TRangeRef &,TInt)const

IMPORT_C TBool IsRangeSelected(const TRangeRef &aRange, TInt aIndex) const;

Description

Tests whether the specified range is the same as the range identified by the specified index.

Note that a region is implemented as an array of ranges, and the index identifies a specific range within that array.

Parameters

const TRangeRef &aRange

The range to be tested.

TInt aIndex

An index value identifying a specific range within the region.

Return value

TBool

True, if the specified range is the same as the range identified by the index; false, otherwise.

Panic codes

GRIDIMG

2 In debug mode only, if the index value is illegal.


IsRangeSelectedLastIndex(const TRangeRef &)const

IMPORT_C TBool IsRangeSelectedLastIndex(const TRangeRef &aRange) const;

Description

Tests whether the specified range is the same as the last range in the region.

Note that a region is implemented as an array of ranges, and the last range is the last one in the array.

Parameters

const TRangeRef &aRange

The range to be tested.

Return value

TBool

True, if the specified range is the same as the last range in the region; false, otherwise. Note that this is also false if the region is empty.


operator[](TInt)const

IMPORT_C TRangeRef operator[](TInt aIndex) const;

Description

Gets the range within the region that is identified by the specified index.

Note that a region is implemented as an array of ranges.

Parameters

TInt aIndex

The index value.

Return value

TRangeRef

The cell range.


RangeList()const

IMPORT_C const CArrayFix< TRangeRef >* RangeList() const;

Description

Gets a pointer to the internal array of ranges that constitutes the region.

Return value

const CArrayFix< TRangeRef > *

A pointer to the array of ranges that constitutes the region.