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@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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: // CGridLay williamr@2: // williamr@2: // williamr@2: williamr@2: inline void CGridLay::SetGridTable(const MGridTable* aGridTable) williamr@2: /** Sets the specified grid table object. williamr@2: williamr@2: @param aGridTable The grid table object. */ williamr@2: { iGridTable = aGridTable; } williamr@2: williamr@2: inline TRangeRef CGridLay::VisibleRange() const williamr@2: /** Gets the range of cells that are currently visible. williamr@2: williamr@2: @return The visible cell range. Note that the TRangeRef::iFrom member is the williamr@2: cell that is visible at the top of the window, and the TRangeRef::iTo member williamr@2: is the cell that is partially visible at the bottom right of the window. */ williamr@2: { return iVisibleRange; } williamr@2: williamr@2: inline TRangeRef CGridLay::TitleRange() const williamr@2: /** Gets the range of cells that form the grid titles. williamr@2: williamr@2: @return The range of cells that form the grid titles. */ williamr@2: { return iTitleRange; } williamr@2: williamr@2: inline TRangeRef CGridLay::GridRange() const williamr@2: /** Gets the range of cells that defines the grid boundary. williamr@2: williamr@2: @return The range of cells that defines the grid boundary. */ williamr@2: { return iGridRange; } williamr@2: williamr@2: inline TBool CGridLay::IsSideLabels() const williamr@2: /** Tests whether side grid labels are printed. williamr@2: williamr@2: @return True, if the side labels are printed; false, otherwise. */ williamr@2: { return (iFlags&EIsSideLabels); } williamr@2: williamr@2: inline TBool CGridLay::IsTopLabels() const williamr@2: /** Tests whether top labels are printed. williamr@2: williamr@2: @return True, if the top labels are printed; false, otherwise. */ williamr@2: { return (iFlags&EIsTopLabels); } williamr@2: williamr@2: inline TBool CGridLay::IsVerticalGridLines() const williamr@2: /** Tests whether vertical grid lines are to be drawn. williamr@2: williamr@2: @return True, if vertical grid lines are to be drawn; false, otherwise. */ williamr@2: { return (iFlags&EIsVerticalGridLines); } williamr@2: williamr@2: inline TBool CGridLay::IsHorizontalGridLines() const williamr@2: /** Tests whether horizontal grid lines are to be drawn. williamr@2: williamr@2: @return True, if horizontal grid lines are to be drawn; false, otherwise. */ williamr@2: { return (iFlags&EIsHorizontalGridLines); } williamr@2: williamr@2: inline TBool CGridLay::IsGridLabelSeparators() const williamr@2: /** Tests whether label separators are to be drawn. williamr@2: williamr@2: @return True, if label separators are to be drawn; false, otherwise. */ williamr@2: { return (iFlags&EIsGridLabelSeparators); } williamr@2: williamr@2: inline TBool CGridLay::IsColumnBursting() const williamr@2: /** Tests whether column bursting is permitted. williamr@2: williamr@2: Column bursting occurs when the contents of a cell are too wide; adjacent williamr@2: cells are then overwritten, provided they are empty. williamr@2: williamr@2: @return True, if column bursting is permitted; false, otherwise. */ williamr@2: { return (iFlags&EIsColumnBursting); } williamr@2: williamr@2: inline TBool CGridLay::IsCursorVisible() const williamr@2: /** Tests whether the cursor is visible. williamr@2: williamr@2: @return True, if the cursor is visible; false, otherwise. */ williamr@2: { return (iFlags&EIsCursorVisible); } williamr@2: williamr@2: inline TBool CGridLay::IsHighlightVisible() const williamr@2: /** Tests whether selected cells are highlighted. williamr@2: williamr@2: @return True, if selected cells are highlighted; false, otherwise. */ williamr@2: { return (iFlags&EIsHighlightVisible); } williamr@2: williamr@2: inline TBool CGridLay::IsRowPermanentlySelected() const williamr@2: /** Tests whether rows are permanently selected. williamr@2: williamr@2: @return True, if rows are permanently selected; false, otherwise. */ williamr@2: { return (iFlags&EIsRowPermanentlySelected); } williamr@2: williamr@2: inline TBool CGridLay::IsTitleLines() const williamr@2: /** Tests whether the grid has both horizontal and vertical title lines. williamr@2: williamr@2: @return True, if the grid has both a horizontal and vertical title line; false, williamr@2: otherwise. */ williamr@2: { return (iFlags&(EIsHorizontalTitleLine|EIsVerticalTitleLine)); } williamr@2: williamr@2: inline TBool CGridLay::IsHorizontalTitleLine() const williamr@2: /** Tests whether the grid has a horizontal title line. williamr@2: williamr@2: @return True, if the grid is to have a horizontal title line; false otherwise. */ williamr@2: { return (iFlags&EIsHorizontalTitleLine); } williamr@2: williamr@2: inline TBool CGridLay::IsVerticalTitleLine() const williamr@2: /** Tests whether the grid has a vertical title line. williamr@2: williamr@2: @return True, if the grid is to have a vertical title line; false otherwise. */ williamr@2: { return (iFlags&EIsVerticalTitleLine); } williamr@2: williamr@2: inline TBool CGridLay::IsIndefiniteRowBoundaries() const williamr@2: /** Tests whether the grid has indefinite row boundaries. williamr@2: williamr@2: @return True, if the grid has indefinite row boundaries; false, otherwise. */ williamr@2: { return (iFlags&EIsIndefiniteRowBoundaries); } williamr@2: williamr@2: inline TBool CGridLay::IsUniformRowHeight() const williamr@2: /** Tests whether all the rows have the same height. williamr@2: williamr@2: @return True, if all rows have the same height; false, otherwise. */ williamr@2: { return (iFlags&EIsUniformRowHeight); } williamr@2: williamr@2: inline TBool CGridLay::IsUniformColumnWidth() const williamr@2: /** Tests whether all columns have the same width. williamr@2: williamr@2: @return True, if all columns have the same width; false, otherwise. */ williamr@2: { return (iFlags&EIsUniformColumnWidth); } williamr@2: williamr@2: inline TBool CGridLay::IsTopLabelDragDisabled() const williamr@2: /** Tests whether a drag operation on the boundary between two columns is permitted. williamr@2: williamr@2: @return True, if a drag operation on a column boundary is permitted; false otherwise. */ williamr@2: { return (iFlags&EIsTopLabelDragDisabled); } williamr@2: williamr@2: inline TBool CGridLay::IsSideLabelDragDisabled() const williamr@2: /** Tests whether a drag operation on the boundary between two rows is permitted. williamr@2: williamr@2: @return True, if a drag operation on a row boundary is permitted; false otherwise. */ williamr@2: { return (iFlags&EIsSideLabelDragDisabled); } williamr@2: williamr@2: inline TBool CGridLay::IsPrintedLabels() const williamr@2: /** Tests whether labels are printed. williamr@2: williamr@2: @return True, if labels are printed; false, otherwise. */ williamr@2: { return (iFlags&EIsPrintedLabels); } williamr@2: williamr@2: inline TBool CGridLay::IsPrintedGridLines() const williamr@2: /** Tests whether grid lines are printed. williamr@2: williamr@2: @return True, if grid lines are printed; false, otherwise. */ williamr@2: { return (iFlags&EIsPrintedGridLines); } williamr@2: williamr@2: inline TBool CGridLay::IsVisibleToRowFullyVisible() const williamr@2: { return (iFlags&EIsVisibleToRowFullyVisible); } williamr@2: williamr@2: inline TBool CGridLay::IsVisibleToColumnFullyVisible() const williamr@2: { return (iFlags&EIsVisibleToColumnFullyVisible); } williamr@2: williamr@2: inline TBool CGridLay::IsEncroachingCellBorders() const williamr@2: /** Tests whether encroaching cell borders are permitted. williamr@2: williamr@2: Encroaching cell borders are where cell borders wider than one pixel are drawn williamr@2: inside the cell, as opposed to outside. williamr@2: williamr@2: @return True, if encroaching cells borders are permitted; false, otherwise. */ williamr@2: { return (iFlags&EIsEncroachingCellBorders); } williamr@2: williamr@2: inline TBool CGridLay::IsRowSelectionDisabled() const williamr@2: /** Tests whether row selection is disabled. williamr@2: williamr@2: @return True, if row selection is disabled; false, otherwise. */ williamr@2: { return (iFlags&EIsRowSelectionDisabled); } williamr@2: williamr@2: inline TBool CGridLay::IsColumnSelectionDisabled() const williamr@2: /** Tests whether column selection is disabled. williamr@2: williamr@2: @return True, if column selection is disabled; false, otherwise. */ williamr@2: { return (iFlags&EIsColumnSelectionDisabled); } williamr@2: williamr@2: inline TBool CGridLay::IsAutoClearGridCells() const williamr@2: /** Tests whether automatic clearing of grid cells is done. williamr@2: williamr@2: Automatic clearing of grid cells is where all cells are cleared on redraw, williamr@2: in case drawing the contents doesn't guarantee to write to every pixel (the williamr@2: usual way of doing flicker-free redraws). williamr@2: williamr@2: @return True, if automatic clearing of grid cells is done; false, otherwise. */ williamr@2: { return (iFlags&EIsAutoClearGridCells); } williamr@2: williamr@2: inline TBool CGridLay::IsPageBreakLinesHidden() const williamr@2: /** Tests whether lines marking page breaks are hidden. williamr@2: williamr@2: @return True, if lines marking page breaks are hidden; false, otherwise. */ williamr@2: { return (iFlags&EIsPageBreakLinesHidden); } williamr@2: williamr@2: inline TBool CGridLay::HasChanged() const williamr@2: /** Tests whether any change has occurred to the grid layout. williamr@2: williamr@2: Such changes include alterations to the height of a row or the williamr@2: width of a column, additions or deletions of rows or columns, williamr@2: and changes to the visibility of grid lines. williamr@2: Note that this list is not exhaustive. williamr@2: williamr@2: @return True, if the grid layout has changed; false, otherwise. */ williamr@2: { return iHasChanged; } williamr@2: williamr@2: inline void CGridLay::SetHasChanged(TBool aHasChanged) williamr@2: /** Sets whether any change has occurred to the grid layout. williamr@2: williamr@2: @param aHasChanged ETrue, if any change has occurred to the grid layout; EFalse, williamr@2: otherwise. */ williamr@2: { iHasChanged=aHasChanged; } williamr@2: williamr@2: inline void CGridLay::SetGridEdgeColor(TRgb aColor) williamr@2: /** Defines the colour that the edges of the grid beyond the grid range are to williamr@2: have. williamr@2: williamr@2: If not changed by this function, the default colour is white. williamr@2: williamr@2: @param aColor The colour value. */ williamr@2: { iGridEdgeColor=aColor; } williamr@2: williamr@2: inline TBool CGridLay::IsPaginated() const williamr@2: /** Tests whether the grid has been paginated. williamr@2: williamr@2: @return True, if the grid has been paginated; false, otherwise. */ williamr@2: { return (iFlags&EIsPaginated); } williamr@2: williamr@2: inline void CGridLay::SetPrintRange(const TRangeRef& aPrintRange) williamr@2: /** Sets the range of cells that are visible for printing. williamr@2: williamr@2: @param aPrintRange The cell range. */ williamr@2: { iVisibleRange=aPrintRange; } williamr@2: williamr@2: inline TSize CGridLay::PageSizeInTwips() const williamr@2: /** Gets the size of a page. williamr@2: williamr@2: @return The size of a page, in twips. */ williamr@2: { return iPageSizeInTwips; } williamr@2: williamr@2: inline TBool CGridLay::IsAutoPagination() const williamr@2: /** Tests whether automatic pagination is in effect. williamr@2: williamr@2: @return True, if automatic pagination is in effect, false, otherwise. */ williamr@2: { return (iFlags&EIsAutoPagination); } williamr@2: williamr@2: // CGridLabelImg williamr@2: williamr@2: inline void CGridLabelImg::SetGraphicsDeviceMap(MGraphicsDeviceMap* aGraphicsDeviceMap) williamr@2: /** Supplies a new interface object for mapping between twips and device-specific williamr@2: units. williamr@2: williamr@2: Note that the caller must call ReleaseFont() before calling this function, williamr@2: and must call NotifyGraphicsDeviceMapChangeL() afterwards. williamr@2: williamr@2: @param aGraphicsDeviceMap A new interface object for mapping between twips williamr@2: and device-specific units. */ williamr@2: { williamr@2: iGraphicsDeviceMap=aGraphicsDeviceMap; williamr@2: } williamr@2: williamr@2: inline TFontSpec CGridLabelImg::FontSpec() const williamr@2: /** Gets the font specification. williamr@2: williamr@2: @return The font specification. */ williamr@2: { williamr@2: return iFontSpec; williamr@2: } williamr@2: williamr@2: inline void CGridLabelImg::SetGridColors(const TGridColors& aGridColors) williamr@2: /** Sets the colours to be used when drawing the label. williamr@2: williamr@2: @param aGridColors The object containing the grid colours specification. */ williamr@2: { williamr@2: iGridColors = aGridColors; williamr@2: } williamr@2: williamr@2: // CGridCellImg williamr@2: williamr@2: inline TInt CGridCellImg::BurstColOffset() const williamr@2: /** Gets the bursting column offset. williamr@2: williamr@2: @return The burst column offset */ williamr@2: { return iBurstColOffset; } williamr@2: williamr@2: inline TInt CGridCellImg::BurstLeft() const williamr@2: /** Gets the left hand bursting value. williamr@2: williamr@2: @return The burst value. */ williamr@2: { return iBurstLeft; } williamr@2: williamr@2: inline TInt CGridCellImg::BurstRight() const williamr@2: /** Gets the right hand bursting value. williamr@2: williamr@2: @return The burst value */ williamr@2: { return iBurstRight; } williamr@2: williamr@2: inline TBool CGridCellImg::IsHorizontalGridLines() const williamr@2: /** Tests whether horizontal grid lines are drawn. williamr@2: williamr@2: This function is set by the CGridImg object and allows classes derived from williamr@2: CGridCellImg to modify or restrict the area into which they draw. williamr@2: williamr@2: @return True, if horizontal grid lines are drawn; false, otherwise. */ williamr@2: { return iGridLineFlags&EIsHorizontalGridLines; } williamr@2: williamr@2: inline TBool CGridCellImg::IsVerticalGridLines() const williamr@2: /** Tests whether vertical grid lines are drawn. williamr@2: williamr@2: This function is set by the CGridImg object and allows classes derived from williamr@2: CGridCellImg to modify or restrict the area into which they draw. williamr@2: williamr@2: @return True, if vertical grid lines are drawn; false, otherwise. */ williamr@2: { return iGridLineFlags&EIsVerticalGridLines; } williamr@2: williamr@2: inline void CGridCellImg::SetGridColors(const TGridColors& aGridColors) williamr@2: /** Sets the colours to be used when drawing. williamr@2: williamr@2: @param aGridColors The object containing the grid colours specification. */ williamr@2: { williamr@2: iGridColors = aGridColors; williamr@2: } williamr@2: williamr@2: // CGridImg williamr@2: williamr@2: inline void CGridImg::SetGridLay(CGridLay* aGridLay) williamr@2: /** Sets the specified grid layout object. williamr@2: williamr@2: @param aGridLay A pointer to the object that controls the layout of rows and williamr@2: columns. */ williamr@2: { iGridLay = aGridLay; } williamr@2: williamr@2: inline void CGridImg::SetWindow(RWindow *aWin) williamr@2: /** Sets the specified window. williamr@2: williamr@2: @param aWin A pointer to the currently active window. */ williamr@2: { iWin = aWin; } williamr@2: williamr@2: ////////////////////////-> williamr@2: //inline void CGridImg::SetGridLabelImg(CGridLabelImg *aGridLabelImg) williamr@2: // { iGridLabelImg = aGridLabelImg; } williamr@2: ////////////////////////-> williamr@2: williamr@2: inline void CGridImg::SetCursorMoveCallBack(MGridCursorMoveCallBack *aCursorMoveCallBack) williamr@2: /** Sets the cursor moved call-back object. williamr@2: williamr@2: The call-back object encapsulates the implementation of a call-back function williamr@2: that is called whenever there is a change to the cursor position. williamr@2: williamr@2: @param aCursorMoveCallBack A pointer to the callback object. */ williamr@2: { iCursorMoveCallBack = aCursorMoveCallBack; } williamr@2: williamr@2: inline const CGridCellRegion* CGridImg::Selected() const williamr@2: /** Gets the currently selected region. williamr@2: williamr@2: @return A pointer to the selected region object. */ williamr@2: { return iSelected; } williamr@2: williamr@2: inline const CGridLabelImg* CGridImg::GridLabelImg() const williamr@2: /** Gets the the object that is used to draw a cell label. williamr@2: williamr@2: @return A pointer to the object that is used to draw a cell label. */ williamr@2: { return iGridLabelImg; } williamr@2: williamr@2: inline TCellRef CGridImg::CursorPos() const williamr@2: /** Gets the current position of the cursor. williamr@2: williamr@2: @return The cell reference of the current cursor position. */ williamr@2: { return iCursorPos; } williamr@2: williamr@2: inline TCellRef CGridImg::AnchorPos() const williamr@2: /** Gets the cursor's anchor position. williamr@2: williamr@2: This is the cell reference of the position that the cursor must return to williamr@2: after a series of selected movements have been made. williamr@2: williamr@2: @return The cell reference of the cursor's anchor position. */ williamr@2: { return iAnchorPos; } williamr@2: williamr@2: inline TCellRef CGridImg::NewCursorPos() const williamr@2: /** Gets the new position of the cursor. williamr@2: williamr@2: @return The cell reference of the new cursor position. williamr@2: @see SetCursorPosL() */ williamr@2: { return iNewCursorPos; } williamr@2: williamr@2: inline TRect CGridImg::GridRect() const williamr@2: /** Gets the rectangle containing the grid. williamr@2: williamr@2: @return The rectangle containing the grid. */ williamr@2: { return iGridRect; } williamr@2: williamr@2: inline TPoint CGridImg::TitlePoint() const williamr@2: /** Gets the position of the title. williamr@2: williamr@2: This is the point at the top left of the grid excluding the labels. williamr@2: williamr@2: @return The position of the title. */ williamr@2: { return iTitlePoint; } williamr@2: williamr@2: inline TPoint CGridImg::MainPoint() const williamr@2: // Returns the most commonly used point in the grid (usually same as TitlePoint()). williamr@2: /** Gets the position at which the visible range starts. williamr@2: williamr@2: @return The position at which the visible range starts. */ williamr@2: { return iMainPoint; } williamr@2: williamr@2: inline TRect CGridImg::MainRect() const williamr@2: /** Gets the rectangle that corresponds to the visible range. williamr@2: williamr@2: @return The rectangle that corresponds to the visible range. */ williamr@2: { return TRect(iMainPoint,iGridRect.iBr); }