epoc32/include/mw/grdstd.inl
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
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.
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // CGridLay
    15 // 
    16 //
    17 
    18 inline void CGridLay::SetGridTable(const MGridTable* aGridTable)
    19 /** Sets the specified grid table object.
    20 
    21 @param aGridTable The grid table object. */
    22 	{ iGridTable = aGridTable; }
    23 
    24 inline TRangeRef CGridLay::VisibleRange() const
    25 /** Gets the range of cells that are currently visible.
    26 
    27 @return The visible cell range. Note that the TRangeRef::iFrom member is the 
    28 cell that is visible at the top of the window, and the TRangeRef::iTo member 
    29 is the cell that is partially visible at the bottom right of the window. */
    30 	{ return iVisibleRange; }
    31 
    32 inline TRangeRef CGridLay::TitleRange() const
    33 /** Gets the range of cells that form the grid titles.
    34 
    35 @return The range of cells that form the grid titles. */
    36 	{ return iTitleRange; }
    37 
    38 inline TRangeRef CGridLay::GridRange() const
    39 /** Gets the range of cells that defines the grid boundary.
    40 
    41 @return The range of cells that defines the grid boundary. */
    42 	{ return iGridRange; }
    43 
    44 inline TBool CGridLay::IsSideLabels() const
    45 /** Tests whether side grid labels are printed.
    46 
    47 @return True, if the side labels are printed; false, otherwise. */
    48 	{ return (iFlags&EIsSideLabels); }
    49 
    50 inline TBool CGridLay::IsTopLabels() const
    51 /** Tests whether top labels are printed.
    52 
    53 @return True, if the top labels are printed; false, otherwise. */
    54 	{ return (iFlags&EIsTopLabels); }
    55 
    56 inline TBool CGridLay::IsVerticalGridLines() const
    57 /** Tests whether vertical grid lines are to be drawn.
    58 
    59 @return True, if vertical grid lines are to be drawn; false, otherwise. */
    60 	{ return (iFlags&EIsVerticalGridLines); }
    61 
    62 inline TBool CGridLay::IsHorizontalGridLines() const
    63 /** Tests whether horizontal grid lines are to be drawn.
    64 
    65 @return True, if horizontal grid lines are to be drawn; false, otherwise. */
    66 	{ return (iFlags&EIsHorizontalGridLines); }
    67 
    68 inline TBool CGridLay::IsGridLabelSeparators() const
    69 /** Tests whether label separators are to be drawn.
    70 
    71 @return True, if label separators are to be drawn; false, otherwise. */
    72 	{ return (iFlags&EIsGridLabelSeparators); }
    73 
    74 inline TBool CGridLay::IsColumnBursting() const
    75 /** Tests whether column bursting is permitted.
    76 
    77 Column bursting occurs when the contents of a cell are too wide; adjacent 
    78 cells are then overwritten, provided they are empty.
    79 
    80 @return True, if column bursting is permitted; false, otherwise. */
    81 	{ return (iFlags&EIsColumnBursting); }
    82 
    83 inline TBool CGridLay::IsCursorVisible() const
    84 /** Tests whether the cursor is visible.
    85 
    86 @return True, if the cursor is visible; false, otherwise. */
    87 	{ return (iFlags&EIsCursorVisible); }
    88 
    89 inline TBool CGridLay::IsHighlightVisible() const
    90 /** Tests whether selected cells are highlighted.
    91 
    92 @return True, if selected cells are highlighted; false, otherwise. */
    93 	{ return (iFlags&EIsHighlightVisible); }
    94 
    95 inline TBool CGridLay::IsRowPermanentlySelected() const
    96 /** Tests whether rows are permanently selected.
    97 
    98 @return True, if rows are permanently selected; false, otherwise. */
    99 	{ return (iFlags&EIsRowPermanentlySelected); }
   100 
   101 inline TBool CGridLay::IsTitleLines() const
   102 /** Tests whether the grid has both horizontal and vertical title lines.
   103 
   104 @return True, if the grid has both a horizontal and vertical title line; false, 
   105 otherwise. */
   106 	{ return (iFlags&(EIsHorizontalTitleLine|EIsVerticalTitleLine)); }
   107 
   108 inline TBool CGridLay::IsHorizontalTitleLine() const
   109 /** Tests whether the grid has a horizontal title line.
   110 
   111 @return True, if the grid is to have a horizontal title line; false otherwise. */
   112 	{ return (iFlags&EIsHorizontalTitleLine); }
   113 
   114 inline TBool CGridLay::IsVerticalTitleLine() const
   115 /** Tests whether the grid has a vertical title line.
   116 
   117 @return True, if the grid is to have a vertical title line; false otherwise. */
   118 	{ return (iFlags&EIsVerticalTitleLine); }
   119 
   120 inline TBool CGridLay::IsIndefiniteRowBoundaries() const
   121 /** Tests whether the grid has indefinite row boundaries.
   122 
   123 @return True, if the grid has indefinite row boundaries; false, otherwise. */
   124 	{ return (iFlags&EIsIndefiniteRowBoundaries); }
   125 
   126 inline TBool CGridLay::IsUniformRowHeight() const
   127 /** Tests whether all the rows have the same height.
   128 
   129 @return True, if all rows have the same height; false, otherwise. */
   130 	{ return (iFlags&EIsUniformRowHeight); }
   131 
   132 inline TBool CGridLay::IsUniformColumnWidth() const
   133 /** Tests whether all columns have the same width.
   134 
   135 @return True, if all columns have the same width; false, otherwise. */
   136 	{ return (iFlags&EIsUniformColumnWidth); }
   137 
   138 inline TBool CGridLay::IsTopLabelDragDisabled() const
   139 /** Tests whether a drag operation on the boundary between two columns is permitted.
   140 
   141 @return True, if a drag operation on a column boundary is permitted; false otherwise. */
   142 	{ return (iFlags&EIsTopLabelDragDisabled); }
   143 
   144 inline TBool CGridLay::IsSideLabelDragDisabled() const
   145 /** Tests whether a drag operation on the boundary between two rows is permitted.
   146 
   147 @return True, if a drag operation on a row boundary is permitted; false otherwise. */
   148 	{ return (iFlags&EIsSideLabelDragDisabled); }
   149 
   150 inline TBool CGridLay::IsPrintedLabels() const
   151 /** Tests whether labels are printed.
   152 
   153 @return True, if labels are printed; false, otherwise. */
   154 	{ return (iFlags&EIsPrintedLabels); }
   155 
   156 inline TBool CGridLay::IsPrintedGridLines() const
   157 /** Tests whether grid lines are printed.
   158 
   159 @return True, if grid lines are printed; false, otherwise. */
   160 	{ return (iFlags&EIsPrintedGridLines); }
   161 
   162 inline TBool CGridLay::IsVisibleToRowFullyVisible() const
   163 	{ return (iFlags&EIsVisibleToRowFullyVisible); }
   164 
   165 inline TBool CGridLay::IsVisibleToColumnFullyVisible() const
   166 	{ return (iFlags&EIsVisibleToColumnFullyVisible); }
   167 
   168 inline TBool CGridLay::IsEncroachingCellBorders() const
   169 /** Tests whether encroaching cell borders are permitted.
   170 
   171 Encroaching cell borders are where cell borders wider than one pixel are drawn 
   172 inside the cell, as opposed to outside.
   173 
   174 @return True, if encroaching cells borders are permitted; false, otherwise. */
   175 	{ return (iFlags&EIsEncroachingCellBorders); }
   176 
   177 inline TBool CGridLay::IsRowSelectionDisabled() const
   178 /** Tests whether row selection is disabled.
   179 
   180 @return True, if row selection is disabled; false, otherwise. */
   181 	{ return (iFlags&EIsRowSelectionDisabled); }
   182 
   183 inline TBool CGridLay::IsColumnSelectionDisabled() const
   184 /** Tests whether column selection is disabled.
   185 
   186 @return True, if column selection is disabled; false, otherwise. */
   187 	{ return (iFlags&EIsColumnSelectionDisabled); }
   188 
   189 inline TBool CGridLay::IsAutoClearGridCells() const
   190 /** Tests whether automatic clearing of grid cells is done.
   191 
   192 Automatic clearing of grid cells is where all cells are cleared on redraw, 
   193 in case drawing the contents doesn't guarantee to write to every pixel (the 
   194 usual way of doing flicker-free redraws).
   195 
   196 @return True, if automatic clearing of grid cells is done; false, otherwise. */
   197 	{ return (iFlags&EIsAutoClearGridCells); }
   198 
   199 inline TBool CGridLay::IsPageBreakLinesHidden() const
   200 /** Tests whether lines marking page breaks are hidden.
   201 
   202 @return True, if lines marking page breaks are hidden; false, otherwise. */
   203 	{ return (iFlags&EIsPageBreakLinesHidden); }
   204 
   205 inline TBool CGridLay::HasChanged() const
   206 /** Tests whether any change has occurred to the grid layout.
   207 
   208 Such changes include alterations to the height of a row or the 
   209 width of a column, additions or deletions of rows or columns, 
   210 and changes to the visibility of grid lines.
   211 Note that this list is not exhaustive.
   212 
   213 @return True, if the grid layout has changed; false, otherwise. */
   214 	{ return iHasChanged; }
   215 
   216 inline void CGridLay::SetHasChanged(TBool aHasChanged)
   217 /** Sets whether any change has occurred to the grid layout.
   218 
   219 @param aHasChanged ETrue, if any change has occurred to the grid layout; EFalse, 
   220 otherwise. */
   221 	{ iHasChanged=aHasChanged; }
   222 
   223 inline void CGridLay::SetGridEdgeColor(TRgb aColor)
   224 /** Defines the colour that the edges of the grid beyond the grid range are to 
   225 have.
   226 
   227 If not changed by this function, the default colour is white.
   228 
   229 @param aColor The colour value. */
   230 	{ iGridEdgeColor=aColor; }
   231 
   232 inline TBool CGridLay::IsPaginated() const
   233 /** Tests whether the grid has been paginated.
   234 
   235 @return True, if the grid has been paginated; false, otherwise. */
   236 	{ return (iFlags&EIsPaginated); }
   237 
   238 inline void CGridLay::SetPrintRange(const TRangeRef& aPrintRange) 
   239 /** Sets the range of cells that are visible for printing.
   240 
   241 @param aPrintRange The cell range. */
   242 	{ iVisibleRange=aPrintRange; }
   243 
   244 inline TSize CGridLay::PageSizeInTwips() const
   245 /** Gets the size of a page.
   246 
   247 @return The size of a page, in twips. */
   248 	{ return iPageSizeInTwips; }
   249 
   250 inline TBool CGridLay::IsAutoPagination() const
   251 /** Tests whether automatic pagination is in effect.
   252 
   253 @return True, if automatic pagination is in effect, false, otherwise. */
   254 	{ return (iFlags&EIsAutoPagination); }
   255 
   256 // CGridLabelImg
   257 
   258 inline void CGridLabelImg::SetGraphicsDeviceMap(MGraphicsDeviceMap* aGraphicsDeviceMap)
   259 /** Supplies a new interface object for mapping between twips and device-specific 
   260 units.
   261 
   262 Note that the caller must call ReleaseFont() before calling this function, 
   263 and must call NotifyGraphicsDeviceMapChangeL() afterwards.
   264 
   265 @param aGraphicsDeviceMap A new interface object for mapping between twips 
   266 and device-specific units. */
   267 	{
   268 	iGraphicsDeviceMap=aGraphicsDeviceMap;
   269 	}
   270 
   271 inline TFontSpec CGridLabelImg::FontSpec() const
   272 /** Gets the font specification.
   273 
   274 @return The font specification. */
   275 	{
   276 	return iFontSpec;
   277 	}
   278 
   279 inline void CGridLabelImg::SetGridColors(const TGridColors& aGridColors)
   280 /** Sets the colours to be used when drawing the label.
   281 
   282 @param aGridColors The object containing the grid colours specification. */
   283 	{
   284 	iGridColors = aGridColors;
   285 	}
   286 
   287 // CGridCellImg
   288 
   289 inline TInt CGridCellImg::BurstColOffset() const
   290 /** Gets the bursting column offset.
   291 
   292 @return The burst column offset */
   293 	{ return iBurstColOffset; }
   294 
   295 inline TInt CGridCellImg::BurstLeft() const
   296 /** Gets the left hand bursting value.
   297 
   298 @return The burst value. */
   299 	{ return iBurstLeft; }
   300 
   301 inline TInt CGridCellImg::BurstRight() const
   302 /** Gets the right hand bursting value.
   303 
   304 @return The burst value */
   305 	{ return iBurstRight; }
   306 
   307 inline TBool CGridCellImg::IsHorizontalGridLines() const
   308 /** Tests whether horizontal grid lines are drawn.
   309 
   310 This function is set by the CGridImg object and allows classes derived from 
   311 CGridCellImg to modify or restrict the area into which they draw.
   312 
   313 @return True, if horizontal grid lines are drawn; false, otherwise. */
   314 	{ return iGridLineFlags&EIsHorizontalGridLines; }
   315 
   316 inline TBool CGridCellImg::IsVerticalGridLines() const
   317 /** Tests whether vertical grid lines are drawn.
   318 
   319 This function is set by the CGridImg object and allows classes derived from 
   320 CGridCellImg to modify or restrict the area into which they draw.
   321 
   322 @return True, if vertical grid lines are drawn; false, otherwise. */
   323 	{ return iGridLineFlags&EIsVerticalGridLines; }
   324 
   325 inline void CGridCellImg::SetGridColors(const TGridColors& aGridColors)
   326 /** Sets the colours to be used when drawing.
   327 
   328 @param aGridColors The object containing the grid colours specification. */
   329 	{
   330 	iGridColors = aGridColors;
   331 	}
   332 
   333 // CGridImg
   334 
   335 inline void CGridImg::SetGridLay(CGridLay* aGridLay)
   336 /** Sets the specified grid layout object.
   337 
   338 @param aGridLay A pointer to the object that controls the layout of rows and 
   339 columns. */
   340 	{ iGridLay = aGridLay; }
   341 
   342 inline void CGridImg::SetWindow(RWindow *aWin)
   343 /** Sets the specified window.
   344 
   345 @param aWin A pointer to the currently active window. */
   346 	{ iWin = aWin; }
   347 
   348 //->
   349 //inline void CGridImg::SetGridLabelImg(CGridLabelImg *aGridLabelImg)
   350 //	{ iGridLabelImg =  aGridLabelImg; }
   351 //->
   352 
   353 inline void CGridImg::SetCursorMoveCallBack(MGridCursorMoveCallBack *aCursorMoveCallBack)
   354 /** Sets the cursor moved call-back object.
   355 
   356 The call-back object encapsulates the implementation of a call-back function 
   357 that is called whenever there is a change to the cursor position.
   358 
   359 @param aCursorMoveCallBack A pointer to the callback object. */
   360 	{ iCursorMoveCallBack = aCursorMoveCallBack; }
   361 
   362 inline const CGridCellRegion* CGridImg::Selected() const
   363 /** Gets the currently selected region.
   364 
   365 @return A pointer to the selected region object. */
   366 	{ return iSelected; }
   367 
   368 inline const CGridLabelImg* CGridImg::GridLabelImg() const
   369 /** Gets the the object that is used to draw a cell label.
   370 
   371 @return A pointer to the object that is used to draw a cell label. */
   372 	{ return iGridLabelImg; }
   373 
   374 inline TCellRef CGridImg::CursorPos() const
   375 /** Gets the current position of the cursor.
   376 
   377 @return The cell reference of the current cursor position. */
   378 	{ return iCursorPos; }
   379 
   380 inline TCellRef CGridImg::AnchorPos() const
   381 /** Gets the cursor's anchor position. 
   382 
   383 This is the cell reference of the position that the cursor must return to 
   384 after a series of selected movements have been made.
   385 
   386 @return The cell reference of the cursor's anchor position. */
   387 	{ return iAnchorPos; }
   388 
   389 inline TCellRef CGridImg::NewCursorPos() const
   390 /** Gets the new position of the cursor.
   391 
   392 @return The cell reference of the new cursor position.
   393 @see SetCursorPosL() */
   394 	{ return iNewCursorPos; }
   395 
   396 inline TRect CGridImg::GridRect() const
   397 /** Gets the rectangle containing the grid.
   398 
   399 @return The rectangle containing the grid. */
   400 	{ return iGridRect; }
   401 
   402 inline TPoint CGridImg::TitlePoint() const
   403 /** Gets the position of the title.
   404 
   405 This is the point at the top left of the grid excluding the labels.
   406 
   407 @return The position of the title. */
   408 	{ return iTitlePoint; }
   409 
   410 inline TPoint CGridImg::MainPoint() const
   411 // Returns the most commonly used point in the grid (usually same as TitlePoint()).
   412 /** Gets the position at which the visible range starts.
   413 
   414 @return The position at which the visible range starts. */
   415 	{ return iMainPoint; }
   416 
   417 inline TRect CGridImg::MainRect() const
   418 /** Gets the rectangle that corresponds to the visible range.
   419 
   420 @return The rectangle that corresponds to the visible range. */
   421 	{ return TRect(iMainPoint,iGridRect.iBr); }
   422 
   423