Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

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

Class CGridLay

class CGridLay : public CBase;

Description

Handles the layout of a grid, and controls how columns, rows and selections appear.

Derivation

Members

Defined in CGridLay:

Inherited from CBase:


Construction and destruction


CGridLay(MGraphicsDeviceMap *)

IMPORT_C CGridLay(MGraphicsDeviceMap *aGraphicsDeviceMap);

Description

Constructor taking an object that implements mapping between twips and device-specific units.

Parameters

MGraphicsDeviceMap *aGraphicsDeviceMap

An object that implements the interface for mapping between twips and device-specific units. Typically, this is a TZoomFactor object.


ConstructL(CGridLay *,CGridImg *)

IMPORT_C void ConstructL(CGridLay *aGridLay, CGridImg *aGridImg);

Description

A second-phase constructor, taking an existing grid layout object, that constructs a partial layout object for printing.

The function assumes that the zoom factor has already been set.

Parameters

CGridLay *aGridLay

Pointer to an existing grid layout object.

CGridImg *aGridImg

Pointer to an existing grid image object.


ConstructL(const MGridTable *,CGridImg *,TInt,TInt)

IMPORT_C void ConstructL(const MGridTable *aGridTable, CGridImg *aGridImg, TInt aNoOfRows, TInt aNoOfCols);

Description

A second-phase constructor for constructing the object with definite row boundaries.

Parameters

const MGridTable *aGridTable

A pointer to the grid table.

CGridImg *aGridImg

Pointer to a grid image object.

TInt aNoOfRows

The number of rows in the grid.

TInt aNoOfCols

The number of columns in the grid.


ConstructL(const MGridTable *,CGridImg *,TInt)

IMPORT_C void ConstructL(const MGridTable *aGridTable, CGridImg *aGridImg, TInt aNoOfCols);

Description

A second-phase constructor for constructing the object with indefinite row boundaries.

Parameters

const MGridTable *aGridTable

A pointer to the grid table.

CGridImg *aGridImg

Pointer to a grid image object.

TInt aNoOfCols

The number of columns in the grid.


~CGridLay()

IMPORT_C virtual ~CGridLay();

Description

Destructor.

Frees resources prior to destruction of the object.

[Top]


Member functions


PageScroll(TMoveDirectionAndAmount)

IMPORT_C TPoint PageScroll(TMoveDirectionAndAmount aPageScroll);

Description

Scrolls the grid by one page.

Parameters

TMoveDirectionAndAmount aPageScroll

The direction and amount by which to scroll.

Return value

TPoint

The number of pixels scrolled, in the x and y directions. This represents the amount of scrolling required to move from the start of the old visible range to the start of the new visible range.


ExposeCell(const TCellRef &)

IMPORT_C TPoint ExposeCell(const TCellRef &aCell);

Description

Scrolls the grid by the minimum necessary to allow the specified cell to become visible.

Parameters

const TCellRef &aCell

The cell to be made visible.

Return value

TPoint

The number of pixels scrolled, in the x and y directions.


ExposeCellToTopLeft(const TCellRef &)

IMPORT_C TPoint ExposeCellToTopLeft(const TCellRef &aCell);

Description

Scrolls the grid by the minimum necessary so that the specified cell is in the top left corner of the visible grid.

Parameters

const TCellRef &aCell

The cell to be made visible in the top left corner of the visible grid.

Return value

TPoint

The number of pixels scrolled, in the x and y directions.


SetGridImgL(CGridImg *)

IMPORT_C void SetGridImgL(CGridImg *aGridImg);

Description

Sets the specified grid image object.

Parameters

CGridImg *aGridImg

The grid image object that draws the contents of the grid.


SetGridTable(const MGridTable *)

inline void SetGridTable(const MGridTable *aGridTable);

Description

Sets the specified grid table object.

Parameters

const MGridTable *aGridTable

The grid table object.


VisibleRange()const

inline TRangeRef VisibleRange() const;

Description

Gets the range of cells that are currently visible.

Return value

TRangeRef

The visible cell range. Note that the TRangeRef::iFrom member is the cell that is visible at the top of the window, and the TRangeRef::iTo member is the cell that is partially visible at the bottom right of the window.


SetVisibleRange(const TCellRef &)

IMPORT_C void SetVisibleRange(const TCellRef &aTopLeftCell);

Description

Scrolls the grid so that the specified cell is visible in the top left corner of the grid.

Parameters

const TCellRef &aTopLeftCell

The cell to be made visible in the top left corner of the visible grid.


TitleRange()const

inline TRangeRef TitleRange() const;

Description

Gets the range of cells that form the grid titles.

Return value

TRangeRef

The range of cells that form the grid titles.


GridRange()const

inline TRangeRef GridRange() const;

Description

Gets the range of cells that defines the grid boundary.

Return value

TRangeRef

The range of cells that defines the grid boundary.


SetGraphicsDeviceMap(MGraphicsDeviceMap *)

IMPORT_C void SetGraphicsDeviceMap(MGraphicsDeviceMap *aGraphicsDeviceMap);

Description

Sets the graphics device map to be used.

Parameters

MGraphicsDeviceMap *aGraphicsDeviceMap

The graphics device map: an interface for mapping between twips and device-specific units.


SetGridToDefault()

IMPORT_C void SetGridToDefault();

Description

Resets the grid to its default layout.


ColumnWidthInTwips(TInt)const

IMPORT_C TInt ColumnWidthInTwips(TInt aCol) const;

Description

Gets the width of the specified column.

Parameters

TInt aCol

The column number.

Return value

TInt

The width of the column, in twips.


SetColumnWidthInTwipsL(TInt,TInt)

IMPORT_C void SetColumnWidthInTwipsL(TInt aCol, TInt aWidthInTwips);

Description

Sets the width of the specified column.

Note that the width cannot be set smaller than the minimum defined column width.

Parameters

TInt aCol

The number of the column whose width is to be set.

TInt aWidthInTwips

The width of the column, in twips.

Panic codes

GRIDIMG

9 In debug mode, if no MGraphicsDeviceMap object has been set.

See also:


SetColumnWidthInTwipsL(TInt,TInt,TInt)

IMPORT_C TInt SetColumnWidthInTwipsL(TInt aStartCol, TInt aEndCol, TInt aWidthInTwips);

Description

Sets the widths of all specified columns to the specified value.

Parameters

TInt aStartCol

The first column whose width is to be set.

TInt aEndCol

The last column whose width is to be set.

TInt aWidthInTwips

The width of the columns, in twips. Note that if the specified columns span the whole grid, then the function sets this value as the default width of all columns through a call to CGridLay::SetDefaultColumnWidthInTwips(TInt).

Return value

TInt

KErrNone if successful; KErrTooBig if the difference between the two column numbers is greater than EMaxArrayChanges.


DefaultColumnWidthInTwips()const

IMPORT_C TInt DefaultColumnWidthInTwips() const;

Description

Gets the default width of columns.

Return value

TInt

The default width of columns, in twips.


SetDefaultColumnWidthInTwips(TInt)

IMPORT_C void SetDefaultColumnWidthInTwips(TInt aWidthInTwips);

Description

Sets the column width default value.

Note that the width cannot be set smaller than the minimum defined column width.

Parameters

TInt aWidthInTwips

The width of columns, in twips.

See also:


SetColumnWidthsToDefault()

IMPORT_C void SetColumnWidthsToDefault();

Description

Sets the widths of all columns to the default value.

See also:


MinColumnWidthInPixels()const

IMPORT_C TInt MinColumnWidthInPixels() const;

Description

Gets the minimum width of columns.

Return value

TInt

The minimum width of columns, in pixels.


SetMinColumnWidthInPixels(TInt)

IMPORT_C void SetMinColumnWidthInPixels(TInt aWidthInPixels);

Description

Sets the minimum width of columns.

Parameters

TInt aWidthInPixels

The minimum width of columns, in pixels.


ColumnWidthOfSelectedInTwips()const

IMPORT_C TInt ColumnWidthOfSelectedInTwips() const;

Description

Gets the width of columns in the selected region.

Return value

TInt

The column width, in twips, if all columns in the selected region have the same width; -1, otherwise.

Panic codes

GRIDIMG

3 If this grid layout object has no grid image object.


SetColumnWidthOfSelectedInTwipsL(TInt)

IMPORT_C void SetColumnWidthOfSelectedInTwipsL(TInt aWidthInTwips);

Description

Sets the widths of all columns in the selected region to the specified value.

Parameters

TInt aWidthInTwips

The column width, in twips.

Panic codes

GRIDIMG

3 If this grid layout object has no grid image object.


RowHeightInTwips(TInt)const

IMPORT_C TInt RowHeightInTwips(TInt aRow) const;

Description

Gets the height of the specified row.

Parameters

TInt aRow

The row number.

Return value

TInt

The height of the row, in twips.


SetRowHeightInTwipsL(TInt,TInt)

IMPORT_C void SetRowHeightInTwipsL(TInt aRow, TInt aHeightInTwips);

Description

Sets the height of the specified row.

Note that the height cannot be set smaller than the minimum defined row height.

Parameters

TInt aRow

The number of row whose height is to be set.

TInt aHeightInTwips

The height of the row, in twips.

See also:


SetRowHeightInTwipsL(TInt,TInt,TInt)

IMPORT_C TInt SetRowHeightInTwipsL(TInt aStartRow, TInt aEndRow, TInt aHeightInTwips);

Description

Sets the heights of all specified rows to the specified value.

Parameters

TInt aStartRow

The first row whose height is to be set.

TInt aEndRow

The last row whose height is to be set.

TInt aHeightInTwips

The height of the rows, in twips. Note that if the specified rows span the whole grid, then the function sets this value as the default height of all rows through a call to CGridLay::SetDefaultRowHeightInTwips(TInt).

Return value

TInt

KErrNone if successful; KErrTooBig if the difference between the two row numbers is greater than EMaxArrayChanges.


DefaultRowHeightInTwips()const

IMPORT_C TInt DefaultRowHeightInTwips() const;

Description

Gets the default height of rows.

Return value

TInt

The default height of rows, in twips,


SetDefaultRowHeightInTwips(TInt)

IMPORT_C void SetDefaultRowHeightInTwips(TInt aHeightInTwips);

Description

Sets the default height of rows.

Note that the height cannot be set smaller than the minimum defined row height.

Parameters

TInt aHeightInTwips

The height of rows, in twips.

See also:


SetRowHeightsToDefault()

IMPORT_C void SetRowHeightsToDefault();

Description

Sets the heights of all rows to the default value.

See also:


MinRowHeightInPixels()const

IMPORT_C TInt MinRowHeightInPixels() const;

Description

Gets the minimum height of rows.

Return value

TInt

The minimum height of rows, in pixels.


SetMinRowHeightInPixels(TInt)

IMPORT_C void SetMinRowHeightInPixels(TInt aHeightInPixels);

Description

Sets the minimum height of rows.

Parameters

TInt aHeightInPixels

The minimum height of rows, in pixels.


RowHeightOfSelectedInTwips()const

IMPORT_C TInt RowHeightOfSelectedInTwips() const;

Description

Gets the height of rows in the selected region.

Return value

TInt

The row height, in twips, if all rows in the selected region have the same width; -1, otherwise.

Panic codes

GRIDIMG

3 If this grid layout object has no grid image object.


SetRowHeightOfSelectedInTwipsL(TInt)

IMPORT_C void SetRowHeightOfSelectedInTwipsL(TInt aHeightInTwips);

Description

Sets the heights of all rows in the selected region to the specified value.

Parameters

TInt aHeightInTwips

The row height, in twips.

Panic codes

GRIDIMG

3 If this grid layout object has no grid image object.


RecalcPixelSparseMaps()

IMPORT_C void RecalcPixelSparseMaps();

Description

Recalculates the internal maps that map row and column numbers to heights and widths respectively.

Heights and widths are held as both pixel and twip values.


InsertDeleteColumns(TInt,TInt,TFixGridRange)

IMPORT_C void InsertDeleteColumns(TInt aStartCol, TInt aNoOfCols, TFixGridRange aFixGridRange=EFixGridRange);

Description

Inserts or deletes columns.

Insertion causes columns to be inserted in front of the specified start column. Deletion causes columns in front of the specified columns to be deleted.

Parameters

TInt aStartCol

The start column.

TInt aNoOfCols

The number of columns to be inserted or deleted. A positive number means that columns are to be inserted; a negative number means that columns are to be deleted.

CGridLay::TFixGridRange aFixGridRange

Indicates whether the grid boundary is to be adjusted by the number of columns (increased or decreased).


InsertDeleteRows(TInt,TInt,TFixGridRange)

IMPORT_C void InsertDeleteRows(TInt aStartRow, TInt aNoOfRows, TFixGridRange aFixGridRange=EFixGridRange);

Description

Inserts or deletes rows.

Insertion causes rows to be inserted below the specified start row. Deletion causes rows below the specified row to be deleted.

Parameters

TInt aStartRow

The start row.

TInt aNoOfRows

The number of rows to be inserted or deleted. A positive number means that rows are to be inserted; a negative number means that rows are to be deleted.

CGridLay::TFixGridRange aFixGridRange

Indicates whether the grid boundary is to be adjusted by the number of rows (increased or decreased).


IsSideLabels()const

inline TBool IsSideLabels() const;

Description

Tests whether side grid labels are printed.

Return value

TBool

True, if the side labels are printed; false, otherwise.


SetSideLabels(TBool)

IMPORT_C void SetSideLabels(TBool aState);

Description

Sets whether side labels are printed.

Parameters

TBool aState

ETrue, if side labels are printed; EFalse, otherwise.


IsTopLabels()const

inline TBool IsTopLabels() const;

Description

Tests whether top labels are printed.

Return value

TBool

True, if the top labels are printed; false, otherwise.


SetTopLabels(TBool)

IMPORT_C void SetTopLabels(TBool aState);

Description

Sets whether top labels are printed.

Parameters

TBool aState

ETrue, if top labels are printed; EFalse, otherwise.


IsVerticalGridLines()const

inline TBool IsVerticalGridLines() const;

Description

Tests whether vertical grid lines are to be drawn.

Return value

TBool

True, if vertical grid lines are to be drawn; false, otherwise.


SetVerticalGridLines(TBool)

IMPORT_C void SetVerticalGridLines(TBool aState);

Description

Sets whether vertical grid lines are to be drawn.

Parameters

TBool aState

ETrue, if vertical grid lines are to be drawn; EFalse, otherwise.


IsHorizontalGridLines()const

inline TBool IsHorizontalGridLines() const;

Description

Tests whether horizontal grid lines are to be drawn.

Return value

TBool

True, if horizontal grid lines are to be drawn; false, otherwise.


SetHorizontalGridLines(TBool)

IMPORT_C void SetHorizontalGridLines(TBool aState);

Description

Sets whether horizontal grid lines are to be drawn.

Parameters

TBool aState

ETrue, if horizontal grid lines are to be drawn; EFalse, otherwise.


IsGridLabelSeparators()const

inline TBool IsGridLabelSeparators() const;

Description

Tests whether label separators are to be drawn.

Return value

TBool

True, if label separators are to be drawn; false, otherwise.


SetGridLabelSeparators(TBool)

IMPORT_C void SetGridLabelSeparators(TBool aState);

Description

Sets whether label separators are to be drawn.

Parameters

TBool aState

ETrue, if label separators are to be drawn; EFalse, otherwise.


IsColumnBursting()const

inline TBool IsColumnBursting() const;

Description

Tests whether column bursting is permitted.

Column bursting occurs when the contents of a cell are too wide; adjacent cells are then overwritten, provided they are empty.

Return value

TBool

True, if column bursting is permitted; false, otherwise.


SetColumnBursting(TBool)

IMPORT_C void SetColumnBursting(TBool aState);

Description

Sets whether column bursting is to be permitted.

Column bursting occurs when the contents of a cell are too wide; adjacent cells are then overwritten, provided they are empty.

Parameters

TBool aState

ETrue, if column bursting is to be permitted; EFalse, otherwise.


IsCursorVisible()const

inline TBool IsCursorVisible() const;

Description

Tests whether the cursor is visible.

Return value

TBool

True, if the cursor is visible; false, otherwise.


SetCursorVisible(TBool)

IMPORT_C void SetCursorVisible(TBool aVisible);

Description

Sets whether the cursor is to be visible.

Parameters

TBool aVisible

ETrue, if the cursor is to be visible; EFalse, otherwise.


IsHighlightVisible()const

inline TBool IsHighlightVisible() const;

Description

Tests whether selected cells are highlighted.

Return value

TBool

True, if selected cells are highlighted; false, otherwise.


SetHighlightVisible(TBool)

IMPORT_C void SetHighlightVisible(TBool aVisible);

Description

Sets whether selected cells are to be highlighted.

Parameters

TBool aVisible

ETrue, if selected cells are to be highlighted; EFalse, otherwise.


IsRowPermanentlySelected()const

inline TBool IsRowPermanentlySelected() const;

Description

Tests whether rows are permanently selected.

Return value

TBool

True, if rows are permanently selected; false, otherwise.


SetRowPermanentlySelectedL(TBool)

IMPORT_C void SetRowPermanentlySelectedL(TBool aState);

Description

Sets whether rows are to be permanently selected.

! Bit naughty

Parameters

TBool aState

ETrue, if rows are to be permanently selected; EFalse, otherwise.


IsTitleLines()const

inline TBool IsTitleLines() const;

Description

Tests whether the grid has both horizontal and vertical title lines.

Return value

TBool

True, if the grid has both a horizontal and vertical title line; false, otherwise.


IsHorizontalTitleLine()const

inline TBool IsHorizontalTitleLine() const;

Description

Tests whether the grid has a horizontal title line.

Return value

TBool

True, if the grid is to have a horizontal title line; false otherwise.


IsVerticalTitleLine()const

inline TBool IsVerticalTitleLine() const;

Description

Tests whether the grid has a vertical title line.

Return value

TBool

True, if the grid is to have a vertical title line; false otherwise.


SetTitleLinesL(TBool)

IMPORT_C void SetTitleLinesL(TBool aState);

Description

Sets whether the grid is to have both horizontal and vertical title lines.

Parameters

TBool aState

ETrue, if the grid is to have both a horizontal and vertical title line; EFalse, otherwise.


SetTitleLinesL(const TCellRef &)

IMPORT_C void SetTitleLinesL(const TCellRef &aCellRef);

Description

Sets horizontal and vertical title lines at the specified cell.

Parameters

const TCellRef &aCellRef

The cell reference at which title lines are set.

Panic codes

GRIDIMG

3 If this grid layout object has no grid image object.


ToggleTitleLinesL()

IMPORT_C void ToggleTitleLinesL();

Description

Sets title lines on, if they are off; sets title lines off, if they are on.


IsIndefiniteRowBoundaries()const

inline TBool IsIndefiniteRowBoundaries() const;

Description

Tests whether the grid has indefinite row boundaries.

Return value

TBool

True, if the grid has indefinite row boundaries; false, otherwise.


IsUniformRowHeight()const

inline TBool IsUniformRowHeight() const;

Description

Tests whether all the rows have the same height.

Return value

TBool

True, if all rows have the same height; false, otherwise.


SetUniformRowHeight(TBool)

IMPORT_C void SetUniformRowHeight(TBool aState);

Description

Sets whether all rows are to have the same height.

Parameters

TBool aState

ETrue, if all rows are to have the same height; EFalse, otherwise.


IsUniformColumnWidth()const

inline TBool IsUniformColumnWidth() const;

Description

Tests whether all columns have the same width.

Return value

TBool

True, if all columns have the same width; false, otherwise.


SetUniformColumnWidth(TBool)

IMPORT_C void SetUniformColumnWidth(TBool aState);

Description

Sets whether all columns are to have the same width.

Parameters

TBool aState

ETrue, if all columns are to have the same width; EFalse, otherwise.


IsTopLabelDragDisabled()const

inline TBool IsTopLabelDragDisabled() const;

Description

Tests whether a drag operation on the boundary between two columns is permitted.

Return value

TBool

True, if a drag operation on a column boundary is permitted; false otherwise.


SetTopLabelDragDisabled(TBool)

IMPORT_C void SetTopLabelDragDisabled(TBool aState);

Description

Sets whether a drag operation on the boundary between two columns is to be permitted.

Parameters

TBool aState

ETrue, if the drag operation is to be permitted; EFalse, otherwise.


IsSideLabelDragDisabled()const

inline TBool IsSideLabelDragDisabled() const;

Description

Tests whether a drag operation on the boundary between two rows is permitted.

Return value

TBool

True, if a drag operation on a row boundary is permitted; false otherwise.


SetSideLabelDragDisabled(TBool)

IMPORT_C void SetSideLabelDragDisabled(TBool aState);

Description

Sets whether a drag operation on the boundary between two rows is to be permitted.

Parameters

TBool aState

ETrue, if the drag operation is to be permitted; EFalse, otherwise.


IsPrintedLabels()const

inline TBool IsPrintedLabels() const;

Description

Tests whether labels are printed.

Return value

TBool

True, if labels are printed; false, otherwise.


SetPrintedLabels(TBool)

IMPORT_C void SetPrintedLabels(TBool aState);

Description

Sets whether labels are printed.

Parameters

TBool aState

ETrue if labels are printed; EFalse, otherwise.


IsPrintedGridLines()const

inline TBool IsPrintedGridLines() const;

Description

Tests whether grid lines are printed.

Return value

TBool

True, if grid lines are printed; false, otherwise.


SetPrintedGridLines(TBool)

IMPORT_C void SetPrintedGridLines(TBool aState);

Description

Sets whether grid lines are printed.

Parameters

TBool aState

ETrue if grid lines are printed; EFalse, otherwise.


IsEncroachingCellBorders()const

inline TBool IsEncroachingCellBorders() const;

Description

Tests whether encroaching cell borders are permitted.

Encroaching cell borders are where cell borders wider than one pixel are drawn inside the cell, as opposed to outside.

Return value

TBool

True, if encroaching cells borders are permitted; false, otherwise.


SetEncroachingCellBorders(TBool)

IMPORT_C void SetEncroachingCellBorders(TBool aState);

Description

Sets whether encroaching cell borders are permitted.

Encroaching cell borders are where cell borders wider than one pixel are drawn inside the cell, as opposed to outside.

Parameters

TBool aState

ETrue, if encroaching cells borders are to be permitted; EFalse, otherwise.


IsRowSelectionDisabled()const

inline TBool IsRowSelectionDisabled() const;

Description

Tests whether row selection is disabled.

Return value

TBool

True, if row selection is disabled; false, otherwise.


SetRowSelectionDisabled(TBool)

IMPORT_C void SetRowSelectionDisabled(TBool aState);

Description

Sets whether row selection is disabled.

Parameters

TBool aState

ETrue, if row selection is disabled; EFalse, otherwise.


IsColumnSelectionDisabled()const

inline TBool IsColumnSelectionDisabled() const;

Description

Tests whether column selection is disabled.

Return value

TBool

True, if column selection is disabled; false, otherwise.


SetColumnSelectionDisabled(TBool)

IMPORT_C void SetColumnSelectionDisabled(TBool aState);

Description

Sets whether column selection is disabled.

Parameters

TBool aState

ETrue, if column selection is disabled; EFalse, otherwise.


IsAutoClearGridCells()const

inline TBool IsAutoClearGridCells() const;

Description

Tests whether automatic clearing of grid cells is done.

Automatic clearing of grid cells is where all cells are cleared on redraw, in case drawing the contents doesn't guarantee to write to every pixel (the usual way of doing flicker-free redraws).

Return value

TBool

True, if automatic clearing of grid cells is done; false, otherwise.


SetAutoClearGridCells(TBool)

IMPORT_C void SetAutoClearGridCells(TBool aState);

Description

Sets whether automatic clearing of grid cells is to be done.

Parameters

TBool aState

ETrue, if automatic clearing of grid cells is to be done; EFalse, otherwise.


IsPageBreakLinesHidden()const

inline TBool IsPageBreakLinesHidden() const;

Description

Tests whether lines marking page breaks are hidden.

Return value

TBool

True, if lines marking page breaks are hidden; false, otherwise.


SetPageBreakLinesHidden(TBool)

IMPORT_C void SetPageBreakLinesHidden(TBool aState);

Description

Sets whether lines marking page breaks are hidden.

Parameters

TBool aState

ETrue, if lines marking page breaks are hidden; EFalse, otherwise.


HasChanged()const

inline TBool HasChanged() const;

Description

Tests whether any change has occurred to the grid layout.

Such changes include alterations to the height of a row or the width of a column, additions or deletions of rows or columns, and changes to the visibility of grid lines. Note that this list is not exhaustive.

Return value

TBool

True, if the grid layout has changed; false, otherwise.


SetHasChanged(TBool)

inline void SetHasChanged(TBool aHasChanged);

Description

Sets whether any change has occurred to the grid layout.

Parameters

TBool aHasChanged

ETrue, if any change has occurred to the grid layout; EFalse, otherwise.


SetGridEdgeColor(TRgb)

inline void SetGridEdgeColor(TRgb aColor);

Description

Defines the colour that the edges of the grid beyond the grid range are to have.

If not changed by this function, the default colour is white.

Parameters

TRgb aColor

The colour value.


MinVisibleFromRow()const

IMPORT_C TInt MinVisibleFromRow() const;

Description

Gets the number of the topmost row visible in the grid.

Return value

TInt

The row number.


MinVisibleFromColumn()const

IMPORT_C TInt MinVisibleFromColumn() const;

Description

Gets the number of the leftmost column visible in the grid.

Return value

TInt

The column number.


ResetVisibleToRow()

IMPORT_C void ResetVisibleToRow();

Description

Resets the row number of the row that should be visible at the bottom of the visible area of the grid.


ResetVisibleToColumn()

IMPORT_C void ResetVisibleToColumn();

Description

Resets the column number of the column visible at the right of the visible area of the grid.


ResetVisibleToCell()

IMPORT_C void ResetVisibleToCell();

Description

Resets the row and column numbers visible at the bottom, and to the right, of the visible area of the grid.


RowExtent()const

IMPORT_C TInt RowExtent() const;

Description

Gets the number of rows in the range.

Return value

TInt

The number of rows.


ColumnExtent()const

IMPORT_C TInt ColumnExtent() const;

Description

Gets the number of columns in the range.

Return value

TInt

The number of columns.


RowToYVal(TInt)const

IMPORT_C TInt RowToYVal(TInt aRow) const;

Description

Converts the specified row number to a screen y-coordinate value.

Note that the resulting value may be outside the current grid window.

Parameters

TInt aRow

The row number.

Return value

TInt

The y-coordinate value.


RowToYVal(TInt,TInt)const

IMPORT_C TInt RowToYVal(TInt aStartRow, TInt aEndRow) const;

Description

Calculates the relative pixel distance between the two specified rows.

Parameters

TInt aStartRow

The row number of the first row.

TInt aEndRow

The row number of the second row.

Return value

TInt

The relative pixel distance.


VisibleRowToYVal(TInt)const

IMPORT_C TInt VisibleRowToYVal(TInt aRow) const;

Description

Converts the specified visible row number to a screen y-coordinate value.

Note that the resulting value may be outside the current grid window.

Parameters

TInt aRow

The row number of the visible row.

Return value

TInt

The y-coordinate value. Note that this is -1, if the row is not visible.


TitleRowToYVal(TInt)const

IMPORT_C TInt TitleRowToYVal(TInt aTitleRow) const;

Description

Calculates the relative pixel distance between the specified row and the first title row.

Parameters

TInt aTitleRow

The row number.

Return value

TInt

The relative pixel distance.


ColumnToXVal(TInt)const

IMPORT_C TInt ColumnToXVal(TInt aCol) const;

Description

Converts the specified column number to a screen x-coordinate value.

Note that the resulting value may be outside the current grid window.

Parameters

TInt aCol

The column number.

Return value

TInt

The column's x-coordinate value.

Panic codes

GRIDIMG

3 In debug mode, if this grid layout object has no grid image.


ColumnToXVal(TInt,TInt)const

IMPORT_C TInt ColumnToXVal(TInt aStartCol, TInt aEndCol) const;

Description

Gets the distance, in pixels, between the two specified columns.

Parameters

TInt aStartCol

The first (start) column number.

TInt aEndCol

The second (end) column number.

Return value

TInt

The distance, in pixels.


VisibleColumnToXVal(TInt)const

IMPORT_C TInt VisibleColumnToXVal(TInt aCol) const;

Description

Converts the specified visible column number to a screen x-coordinate value.

Note that the resulting value may be outside the current grid window.

Parameters

TInt aCol

The column number of the visible column.

Return value

TInt

The x-coordinate value. Note that this is -1, if the column is not visible.


TitleColumnToXVal(TInt)const

IMPORT_C TInt TitleColumnToXVal(TInt aTitleCol) const;

Description

Calculates the relative pixel distance between the specified column and the first title column.

Parameters

TInt aTitleCol

The column number.

Return value

TInt

The relative pixel distance.


YValToRow(TInt)const

IMPORT_C TInt YValToRow(TInt aYVal) const;

Description

Gets the number of the row, limited to the grid boundary, that is on or above the specified y-coordinate value.

Parameters

TInt aYVal

The y-coordinate value. Note that this may represent a point off the visible screen.

Return value

TInt

The row number, limited to the grid boundary.


YValToRow(TInt,TInt)const

IMPORT_C TInt YValToRow(TInt aStartRow, TInt aDisp) const;

Description

Gets the number of the row that is on or above the specified displacement from the specified row.

Parameters

TInt aStartRow

The row from which displacement is calculated.

TInt aDisp

The displacement, in pixels.

Return value

TInt

The row number at the specified displacement.


YValToTitleRow(TInt)const

IMPORT_C TInt YValToTitleRow(TInt aYVal) const;

Description

Gets the number of the row that is on or above the specified y-coordinate value

Parameters

TInt aYVal

The y-coordinate value. Note that this may represent a point off the visible screen.

Return value

TInt

The row number. Note that this may include the title row.


XValToColumn(TInt)const

IMPORT_C TInt XValToColumn(TInt aXVal) const;

Description

Gets the number of the column, limited to the grid boundary, that is on or to the left of the specified x-coordinate value.

Parameters

TInt aXVal

The x-coordinate value. Note that this may represent a point off the visible screen.

Return value

TInt

The column number, limited to the grid boundary.


XValToColumn(TInt,TInt)const

IMPORT_C TInt XValToColumn(TInt aStartCol, TInt aDisp) const;

Description

Gets the number of the column that is on or to the left of the specified displacement from the specified column.

Parameters

TInt aStartCol

The column from which displacement is calculated.

TInt aDisp

The displacement, in pixels.

Return value

TInt

The column number at the specified displacement.


XValToTitleColumn(TInt)const

IMPORT_C TInt XValToTitleColumn(TInt aXVal) const;

Description

Gets the number of the column that is on or to the left of the specified x-coordinate value

Parameters

TInt aXVal

The x-coordinate value. Note that this may represent a point off the visible screen.

Return value

TInt

The column number. Note that this may include the title column.


PointToCell(const TPoint &)const

IMPORT_C TCellRef PointToCell(const TPoint &aPoint) const;

Description

Gets the cell reference of the cell that contains the specified screen co-ordinates.

Parameters

const TPoint &aPoint

The screen co-ordinates.

Return value

TCellRef

The cell reference.


PointToCell(const TCellRef &,const TPoint &)const

IMPORT_C TCellRef PointToCell(const TCellRef &aStartCell, const TPoint &aPointDisp) const;

Description

Gets the cell reference of the cell that is displaced from the specified cell by the specified pixel co-ordinates.

Parameters

const TCellRef &aStartCell

The cell reference from which the displacement is based.

const TPoint &aPointDisp

The displacement.

Return value

TCellRef

The cell at the specified displacement.


CellToPoint(const TCellRef &)const

IMPORT_C TPoint CellToPoint(const TCellRef &aCell) const;

Description

Gets the relative screen coordinates of the top left corner of the specified cell.

Parameters

const TCellRef &aCell

The cell.

Return value

TPoint

The relative screen co-ordinates.


CellToPoint(const TCellRef &,const TCellRef &)const

IMPORT_C TPoint CellToPoint(const TCellRef &aStartCell, const TCellRef &aEndCell) const;

Description

Gets the co-ordinate distance, in pixels, between the specified cells.

Parameters

const TCellRef &aStartCell

The start cell of the range.

const TCellRef &aEndCell

The end cell of the range.

Return value

TPoint

The x and y values representing the distance, in pixels, between the two columns and the two rows, respectively, that are defined by the two cells.


TitleCellToPoint(const TCellRef &)const

IMPORT_C TPoint TitleCellToPoint(const TCellRef &aTitleCell) const;

Description

Gets the relative screen coordinates of the top left corner of the specified cell, when title lines are displayed.

Parameters

const TCellRef &aTitleCell

The cell.

Return value

TPoint

The relative screen co-ordinates.

Panic codes

GRIDIMG

3 In debug mode, if this grid layout object has no grid image.

GRIDIMG

4 In debug mode, if there is no horizontal title line and/or there is no vertical title line.


CellToRect(const TCellRef &)const

IMPORT_C TRect CellToRect(const TCellRef &aCell) const;

Description

Gets the rectangle that is occupied by the specified cell.

Parameters

const TCellRef &aCell

The cell.

Return value

TRect

The occupied rectangle. Note that this excludes the cell's bottom and right grid lines.


YValToNearestRow(TInt,TInt)const

IMPORT_C TInt YValToNearestRow(TInt aStartRow, TInt aDisp) const;

Description

Gets the row that is nearest to the specified displacement from the specified row.

Parameters

TInt aStartRow

The row on which the displacement is based.

TInt aDisp

The displacement value, in pixels.

Return value

TInt

The nearest row.


XValToNearestColumn(TInt,TInt)const

IMPORT_C TInt XValToNearestColumn(TInt aStartCol, TInt aDisp) const;

Description

Gets the column that is nearest to the specified displacement from the specified column.

Parameters

TInt aStartCol

The column on which the displacement is based.

TInt aDisp

The displacement value, in pixels.

Return value

TInt

The nearest column.


TopLeftTitleRangeSize()const

IMPORT_C TSize TopLeftTitleRangeSize() const;

Description

Gets the size of the top left range, if title lines are on.

The top left range is the range of cells formed by the intersection of the rows and columns that form the titles.

Return value

TSize

The size of the top left range.


PaginateL()

IMPORT_C void PaginateL();

Description

Paginates the grid.

Note that when preparing the grid for printing using a CGridPrinter object, then use that object's CGridPrinter::PaginateL() function instead.


ClearPagination()

IMPORT_C void ClearPagination();

Description

Marks the grid as unpaginated.


NotifyPaginationOutOfDateL()

IMPORT_C void NotifyPaginationOutOfDateL();

Description

Notifies this object that repagination must take place.

This function is called as a response to changes in the grid, such as a change in the page size, a change to the width of selected columns, the setting or removal of hard page breaks etc.


IsPaginated()const

inline TBool IsPaginated() const;

Description

Tests whether the grid has been paginated.

Return value

TBool

True, if the grid has been paginated; false, otherwise.


PageToRange(TInt,TPageOrder)const

IMPORT_C TRangeRef PageToRange(TInt aPageNo, TPageOrder aPageOrder) const;

Description

Gets the range of cells that are on the specified page

Parameters

TInt aPageNo

The page number. The first page is assumed to be page zero.

CGridLay::TPageOrder aPageOrder

The page order.

Return value

TRangeRef

The range of cells.

Panic codes

GRIDIMG

5 In debug mode, if the grid has not been paginated.


SetPrintRange(const TRangeRef &)

inline void SetPrintRange(const TRangeRef &aPrintRange);

Description

Sets the range of cells that are visible for printing.

Parameters

const TRangeRef &aPrintRange

The cell range.


NoOfPages()const

IMPORT_C TInt NoOfPages() const;

Description

Gets the number of pages that the grid would print to.

Return value

TInt

The number of pages.

Panic codes

GRIDIMG

5 In debug mode, if the grid has not been paginated.


SetPageSizeInTwipsL(const TSize &)

IMPORT_C void SetPageSizeInTwipsL(const TSize &aPageSize);

Description

Sets the size of a page.

Parameters

const TSize &aPageSize

The size of a page, in twips.


PageSizeInTwips()const

inline TSize PageSizeInTwips() const;

Description

Gets the size of a page.

Return value

TSize

The size of a page, in twips.


IsAutoPagination()const

inline TBool IsAutoPagination() const;

Description

Tests whether automatic pagination is in effect.

Return value

TBool

True, if automatic pagination is in effect, false, otherwise.


SetAutoPagination(TBool)

IMPORT_C void SetAutoPagination(TBool aState);

Description

Sets whether automatic pagination is to be in effect.

Parameters

TBool aState

ETrue, if automatic pagination is to be in effect; EFalse, otherwise.


IsHardRowPageBreak(TInt)const

IMPORT_C TBool IsHardRowPageBreak(TInt aRow) const;

Description

Tests whether there is a hard page break at the specified row.

Parameters

TInt aRow

The row.

Return value

TBool

True, if there is a hard page break at (i.e. immediately above) the specified row; false, otherwise.


IsHardColumnPageBreak(TInt)const

IMPORT_C TBool IsHardColumnPageBreak(TInt aCol) const;

Description

Tests whether there is a hard page break at the specified column.

Parameters

TInt aCol

The column.

Return value

TBool

True, if there is a hard page break at (i.e. immediately to the left of) the specified column; false, otherwise.


SetHardRowPageBreakL(TInt)

IMPORT_C void SetHardRowPageBreakL(TInt aRow);

Description

Sets a hard page break at the specified row.

Note that pagination will be flagged as being out of date.

Parameters

TInt aRow

The row, immediately above which the hard page break is to occur.


ClearHardRowPageBreakL(TInt)

IMPORT_C void ClearHardRowPageBreakL(TInt aRow);

Description

Removes the hard page break at the specified row.

Note that pagination will be flagged as being out of date.

Note also that there is no harm in calling this function if there is no hard page break at the specified row.

Parameters

TInt aRow

The row, immediately above which there is a hard page break.


SetHardColumnPageBreakL(TInt)

IMPORT_C void SetHardColumnPageBreakL(TInt aCol);

Description

Sets a hard page break at the specified column.

Note that pagination will be flagged as being out of date.

Parameters

TInt aCol

The column, immediately to the left of which the hard page break is to occur.


ClearHardColumnPageBreakL(TInt)

IMPORT_C void ClearHardColumnPageBreakL(TInt aCol);

Description

Removes the hard page break at the specified column.

Note that pagination will be flagged as being out of date.

Note also that there is no harm in calling this function if there is no hard page break at the specified column.

Parameters

TInt aCol

The column, immediately to the left of which there is a hard page break.


ClearAllHardPageBreaksL()

IMPORT_C void ClearAllHardPageBreaksL();

Description

Removes all hard page breaks; this includes all row and column page breaks.

Note that pagination will be flagged as being out of date.


ExternalizeL(RWriteStream &)const

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises an object of this class to a write stream.

The presence of this function means that the standard templated operator<<(RWriteStream &,const T &) can be used to externalise objects of this class.

Parameters

RWriteStream &aStream

Stream to which the object should be externalised.


InternalizeL(RReadStream &)

IMPORT_C void InternalizeL(RReadStream &aStream);

Description

Internalises an object of this class from a read stream.

The presence of this function means that the standard templated operator>>(RReadStream &,T &) can be used to internalise objects of this class.

Note that the function has assignment semantics. It replaces the old value of the object with a new value read from the read stream.

Parameters

RReadStream &aStream

Stream from which the object is to be internalised.


StoreL(CStreamStore &)const

IMPORT_C TStreamId StoreL(CStreamStore &aStore) const;

Description

Externalises this object to a stream in the specified store.

Parameters

CStreamStore &aStore

The store in which the stream is to be created and stored.

Return value

TStreamId

The Id of the created stream.


RestoreL(const CStreamStore &,TStreamId)

IMPORT_C void RestoreL(const CStreamStore &aStore, TStreamId aStreamId);

Description

Internalises this object from the specified stream in the specified store.

Note that the function has assignment semantics. It replaces the old value of this object with a new value read from the specified stream.

Parameters

const CStreamStore &aStore

The store containing the stream.

TStreamId aStreamId

The Id of the stream from which this object is to be internalised.


SetGridColors(TGridColors)

IMPORT_C void SetGridColors(TGridColors aColors);

Description

Sets the collection of colours to be used to draw the grid.

Parameters

TGridColors aColors

The grid colour definitions.


GridColors()const

IMPORT_C const TGridColors& GridColors() const;

Description

Gets the collection of colours used to draw the grid.

Return value

const TGridColors &

The grid colour definitions.

[Top]


Member enumerations


Enum TPageOrder

TPageOrder

Description

Defines the order in which pages are printed.

ERightThenDown

All pages in a horizontal line are drawn before starting on the next horizontal line.

EDownThenRight

All pages in a vertical line are drawn before starting on the next vertical line to the right.


Enum TFixGridRange

TFixGridRange

Description

Indicates whether the size of the grid should be adjusted when columns and rows are inserted or deleted.

EFixGridRange

The grid range should not be adjusted on insertion or deletion of rows and/or columns.

EAdjustGridRange

The grid range can be adjusted on insertion or deletion of rows and/or columns.