williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// 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
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#if !defined(__GRDSTD_H__)
|
williamr@2
|
17 |
#define __GRDSTD_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#if !defined(__E32STD_H__)
|
williamr@2
|
20 |
#include <e32std.h>
|
williamr@2
|
21 |
#endif
|
williamr@2
|
22 |
#if !defined(__GDI_H__)
|
williamr@2
|
23 |
#include <gdi.h>
|
williamr@2
|
24 |
#endif
|
williamr@2
|
25 |
#if !defined(__GRDCELLS_H__)
|
williamr@2
|
26 |
#include <grdcells.h>
|
williamr@2
|
27 |
#endif
|
williamr@2
|
28 |
#if !defined(__GRDDEF_H__)
|
williamr@2
|
29 |
#include <grddef.h>
|
williamr@2
|
30 |
#endif
|
williamr@2
|
31 |
|
williamr@2
|
32 |
|
williamr@2
|
33 |
|
williamr@2
|
34 |
class MGridTable
|
williamr@2
|
35 |
/** An interface that can be implemented to provide row and column information.
|
williamr@2
|
36 |
|
williamr@2
|
37 |
Note that for grids that have indefinite row boundaries, an implementation
|
williamr@2
|
38 |
is mandatory.
|
williamr@2
|
39 |
|
williamr@2
|
40 |
A concrete implementation is passed to a CGridLay object through its CGridLay::ConstructL()
|
williamr@2
|
41 |
functions or its CGridLay::SetGridTable() function.
|
williamr@2
|
42 |
|
williamr@2
|
43 |
@publishedAll
|
williamr@2
|
44 |
@released */
|
williamr@2
|
45 |
{
|
williamr@2
|
46 |
public:
|
williamr@2
|
47 |
enum
|
williamr@2
|
48 |
{
|
williamr@2
|
49 |
/** The number of rows returned by the default implementation of RowExtent(). */
|
williamr@2
|
50 |
EDefaultRowExtent=20,
|
williamr@2
|
51 |
/** The number of columns returned by the default implementation of ColumnExtent(). */
|
williamr@2
|
52 |
EDefaultColumnExtent=20
|
williamr@2
|
53 |
};
|
williamr@2
|
54 |
public:
|
williamr@2
|
55 |
IMPORT_C virtual TBool RequestRow(TInt aRow,TInt& aReturnRow) const;//If used should be derived from
|
williamr@2
|
56 |
IMPORT_C virtual TInt RowExtent() const;
|
williamr@2
|
57 |
IMPORT_C virtual TInt ColumnExtent() const;
|
williamr@2
|
58 |
};
|
williamr@2
|
59 |
|
williamr@2
|
60 |
|
williamr@2
|
61 |
////////////////////////->
|
williamr@2
|
62 |
|
williamr@2
|
63 |
class TGridColors
|
williamr@2
|
64 |
/** The grid colour specification.
|
williamr@2
|
65 |
|
williamr@2
|
66 |
An object of this type encapsulates the colours to be used when drawing a
|
williamr@2
|
67 |
grid cell.
|
williamr@2
|
68 |
|
williamr@2
|
69 |
@publishedAll
|
williamr@2
|
70 |
@released
|
williamr@2
|
71 |
@see CGridLabelImg */
|
williamr@2
|
72 |
{
|
williamr@2
|
73 |
public:
|
williamr@2
|
74 |
IMPORT_C TGridColors();
|
williamr@2
|
75 |
IMPORT_C TGridColors(TRgb aForeground, TRgb aBackground, TRgb aLines, TRgb aLabelSeparators);
|
williamr@2
|
76 |
public:
|
williamr@2
|
77 |
/** The foreground colour. */
|
williamr@2
|
78 |
TRgb iForeground;
|
williamr@2
|
79 |
/** The background colour. */
|
williamr@2
|
80 |
TRgb iBackground;
|
williamr@2
|
81 |
/** The colour of lines. */
|
williamr@2
|
82 |
TRgb iLines;
|
williamr@2
|
83 |
/** The colour of label separators. */
|
williamr@2
|
84 |
TRgb iLabelSeparators;
|
williamr@2
|
85 |
// TRgb iEdge;
|
williamr@2
|
86 |
};
|
williamr@2
|
87 |
////////////////////////->
|
williamr@2
|
88 |
|
williamr@2
|
89 |
|
williamr@2
|
90 |
class RReadStream;
|
williamr@2
|
91 |
class RWriteStream;
|
williamr@2
|
92 |
class CStreamStore;
|
williamr@2
|
93 |
class CGridImg;
|
williamr@2
|
94 |
class CSparseMap;
|
williamr@2
|
95 |
|
williamr@2
|
96 |
|
williamr@2
|
97 |
class CGridLay : public CBase
|
williamr@2
|
98 |
/** Handles the layout of a grid, and controls how columns, rows and selections
|
williamr@2
|
99 |
appear.
|
williamr@2
|
100 |
|
williamr@2
|
101 |
@publishedAll
|
williamr@2
|
102 |
@released */
|
williamr@2
|
103 |
{
|
williamr@2
|
104 |
friend class CGridImg;
|
williamr@2
|
105 |
public:
|
williamr@2
|
106 |
/** Defines the order in which pages are printed. */
|
williamr@2
|
107 |
enum TPageOrder
|
williamr@2
|
108 |
{
|
williamr@2
|
109 |
/** All pages in a horizontal line are drawn before starting on the next horizontal
|
williamr@2
|
110 |
line. */
|
williamr@2
|
111 |
ERightThenDown,
|
williamr@2
|
112 |
/** All pages in a vertical line are drawn before starting on the next vertical
|
williamr@2
|
113 |
line to the right. */
|
williamr@2
|
114 |
EDownThenRight
|
williamr@2
|
115 |
};
|
williamr@2
|
116 |
/** Indicates whether the size of the grid should be adjusted when columns and
|
williamr@2
|
117 |
rows are inserted or deleted. */
|
williamr@2
|
118 |
enum TFixGridRange
|
williamr@2
|
119 |
{
|
williamr@2
|
120 |
/** The grid range should not be adjusted on insertion or deletion of rows and/or columns. */
|
williamr@2
|
121 |
EFixGridRange,
|
williamr@2
|
122 |
/** The grid range can be adjusted on insertion or deletion of rows and/or columns. */
|
williamr@2
|
123 |
EAdjustGridRange
|
williamr@2
|
124 |
};
|
williamr@2
|
125 |
public:
|
williamr@2
|
126 |
IMPORT_C CGridLay(MGraphicsDeviceMap* aGraphicsDeviceMap);
|
williamr@2
|
127 |
IMPORT_C void ConstructL(CGridLay* aGridLay,CGridImg* aGridImg);//Constructs Partial Copy
|
williamr@2
|
128 |
IMPORT_C void ConstructL(const MGridTable *aGridTable,CGridImg *aGridImg,TInt aNoOfRows,TInt aNoOfCols);
|
williamr@2
|
129 |
IMPORT_C void ConstructL(const MGridTable *aGridTable,CGridImg *aGridImg,TInt aNoOfCols);
|
williamr@2
|
130 |
IMPORT_C virtual ~CGridLay();
|
williamr@2
|
131 |
|
williamr@2
|
132 |
IMPORT_C TPoint PageScroll(TMoveDirectionAndAmount aPageScroll);
|
williamr@2
|
133 |
IMPORT_C TPoint ExposeCell(const TCellRef &aCell);
|
williamr@2
|
134 |
IMPORT_C TPoint ExposeCellToTopLeft(const TCellRef &aCell);
|
williamr@2
|
135 |
|
williamr@2
|
136 |
IMPORT_C void SetGridImgL(CGridImg* aGridImg);
|
williamr@2
|
137 |
inline void SetGridTable(const MGridTable* aGridTable);
|
williamr@2
|
138 |
inline TRangeRef VisibleRange() const;
|
williamr@2
|
139 |
IMPORT_C void SetVisibleRange(const TCellRef& aTopLeftCell);
|
williamr@2
|
140 |
inline TRangeRef TitleRange() const;
|
williamr@2
|
141 |
inline TRangeRef GridRange() const;
|
williamr@2
|
142 |
IMPORT_C void SetGraphicsDeviceMap(MGraphicsDeviceMap* aGraphicsDeviceMap);
|
williamr@2
|
143 |
IMPORT_C void SetGridToDefault();
|
williamr@2
|
144 |
|
williamr@2
|
145 |
IMPORT_C TInt ColumnWidthInTwips(TInt aCol) const;
|
williamr@2
|
146 |
IMPORT_C void SetColumnWidthInTwipsL(TInt aCol,TInt aWidthInTwips);
|
williamr@2
|
147 |
IMPORT_C TInt SetColumnWidthInTwipsL(TInt aStartCol,TInt aEndCol,TInt aWidthInTwips);
|
williamr@2
|
148 |
IMPORT_C TInt DefaultColumnWidthInTwips() const;
|
williamr@2
|
149 |
IMPORT_C void SetDefaultColumnWidthInTwips(TInt aWidthInTwips);
|
williamr@2
|
150 |
IMPORT_C void SetColumnWidthsToDefault();
|
williamr@2
|
151 |
IMPORT_C TInt MinColumnWidthInPixels() const;
|
williamr@2
|
152 |
IMPORT_C void SetMinColumnWidthInPixels(TInt aWidthInPixels);
|
williamr@2
|
153 |
IMPORT_C TInt ColumnWidthOfSelectedInTwips() const;
|
williamr@2
|
154 |
IMPORT_C void SetColumnWidthOfSelectedInTwipsL(TInt aWidthInTwips);
|
williamr@2
|
155 |
IMPORT_C TInt RowHeightInTwips(TInt aRow) const;
|
williamr@2
|
156 |
IMPORT_C void SetRowHeightInTwipsL(TInt aRow,TInt aHeightInTwips);
|
williamr@2
|
157 |
IMPORT_C TInt SetRowHeightInTwipsL(TInt aStartRow,TInt aEndRow,TInt aHeightInTwips);
|
williamr@2
|
158 |
IMPORT_C TInt DefaultRowHeightInTwips() const;
|
williamr@2
|
159 |
IMPORT_C void SetDefaultRowHeightInTwips(TInt aHeightInTwips);
|
williamr@2
|
160 |
IMPORT_C void SetRowHeightsToDefault();
|
williamr@2
|
161 |
IMPORT_C TInt MinRowHeightInPixels() const;
|
williamr@2
|
162 |
IMPORT_C void SetMinRowHeightInPixels(TInt aHeightInPixels);
|
williamr@2
|
163 |
IMPORT_C TInt RowHeightOfSelectedInTwips() const;
|
williamr@2
|
164 |
IMPORT_C void SetRowHeightOfSelectedInTwipsL(TInt aHeightInTwips);
|
williamr@2
|
165 |
IMPORT_C void RecalcPixelSparseMaps();
|
williamr@2
|
166 |
IMPORT_C void InsertDeleteColumns(TInt aStartCol,TInt aNoOfCols,
|
williamr@2
|
167 |
TFixGridRange aFixGridRange=EFixGridRange);
|
williamr@2
|
168 |
IMPORT_C void InsertDeleteRows(TInt aStartRow,TInt aNoOfRows,
|
williamr@2
|
169 |
TFixGridRange aFixGridRange=EFixGridRange);
|
williamr@2
|
170 |
|
williamr@2
|
171 |
inline TBool IsSideLabels() const;
|
williamr@2
|
172 |
IMPORT_C void SetSideLabels(TBool aState);
|
williamr@2
|
173 |
inline TBool IsTopLabels() const;
|
williamr@2
|
174 |
IMPORT_C void SetTopLabels(TBool aState);
|
williamr@2
|
175 |
inline TBool IsVerticalGridLines() const;
|
williamr@2
|
176 |
IMPORT_C void SetVerticalGridLines(TBool aState);
|
williamr@2
|
177 |
inline TBool IsHorizontalGridLines() const;
|
williamr@2
|
178 |
IMPORT_C void SetHorizontalGridLines(TBool aState);
|
williamr@2
|
179 |
inline TBool IsGridLabelSeparators() const;
|
williamr@2
|
180 |
IMPORT_C void SetGridLabelSeparators(TBool aState);
|
williamr@2
|
181 |
inline TBool IsColumnBursting() const;
|
williamr@2
|
182 |
IMPORT_C void SetColumnBursting(TBool aState);
|
williamr@2
|
183 |
inline TBool IsCursorVisible() const;
|
williamr@2
|
184 |
IMPORT_C void SetCursorVisible(TBool aVisible);
|
williamr@2
|
185 |
inline TBool IsHighlightVisible() const;
|
williamr@2
|
186 |
IMPORT_C void SetHighlightVisible(TBool aVisible);
|
williamr@2
|
187 |
inline TBool IsRowPermanentlySelected() const;
|
williamr@2
|
188 |
IMPORT_C void SetRowPermanentlySelectedL(TBool aState);
|
williamr@2
|
189 |
inline TBool IsTitleLines() const;
|
williamr@2
|
190 |
inline TBool IsHorizontalTitleLine() const;
|
williamr@2
|
191 |
inline TBool IsVerticalTitleLine() const;
|
williamr@2
|
192 |
IMPORT_C void SetTitleLinesL(TBool aState);
|
williamr@2
|
193 |
IMPORT_C void SetTitleLinesL(const TCellRef& aCellRef);
|
williamr@2
|
194 |
IMPORT_C void ToggleTitleLinesL();
|
williamr@2
|
195 |
inline TBool IsIndefiniteRowBoundaries() const;
|
williamr@2
|
196 |
inline TBool IsUniformRowHeight() const;
|
williamr@2
|
197 |
IMPORT_C void SetUniformRowHeight(TBool aState);
|
williamr@2
|
198 |
inline TBool IsUniformColumnWidth() const;
|
williamr@2
|
199 |
IMPORT_C void SetUniformColumnWidth(TBool aState);
|
williamr@2
|
200 |
inline TBool IsTopLabelDragDisabled() const;
|
williamr@2
|
201 |
IMPORT_C void SetTopLabelDragDisabled(TBool aState);
|
williamr@2
|
202 |
inline TBool IsSideLabelDragDisabled() const;
|
williamr@2
|
203 |
IMPORT_C void SetSideLabelDragDisabled(TBool aState);
|
williamr@2
|
204 |
inline TBool IsPrintedLabels() const;
|
williamr@2
|
205 |
IMPORT_C void SetPrintedLabels(TBool aState);
|
williamr@2
|
206 |
inline TBool IsPrintedGridLines() const;
|
williamr@2
|
207 |
IMPORT_C void SetPrintedGridLines(TBool aState);
|
williamr@2
|
208 |
inline TBool IsEncroachingCellBorders() const;
|
williamr@2
|
209 |
IMPORT_C void SetEncroachingCellBorders(TBool aState);
|
williamr@2
|
210 |
inline TBool IsRowSelectionDisabled() const;
|
williamr@2
|
211 |
IMPORT_C void SetRowSelectionDisabled(TBool aState);
|
williamr@2
|
212 |
inline TBool IsColumnSelectionDisabled() const;
|
williamr@2
|
213 |
IMPORT_C void SetColumnSelectionDisabled(TBool aState);
|
williamr@2
|
214 |
inline TBool IsAutoClearGridCells() const;
|
williamr@2
|
215 |
IMPORT_C void SetAutoClearGridCells(TBool aState);
|
williamr@2
|
216 |
inline TBool IsPageBreakLinesHidden() const;
|
williamr@2
|
217 |
IMPORT_C void SetPageBreakLinesHidden(TBool aState);
|
williamr@2
|
218 |
inline TBool HasChanged() const;
|
williamr@2
|
219 |
inline void SetHasChanged(TBool aHasChanged);
|
williamr@2
|
220 |
inline void SetGridEdgeColor(TRgb aColor);
|
williamr@2
|
221 |
|
williamr@2
|
222 |
IMPORT_C TInt MinVisibleFromRow() const;
|
williamr@2
|
223 |
IMPORT_C TInt MinVisibleFromColumn() const;
|
williamr@2
|
224 |
IMPORT_C void ResetVisibleToRow();
|
williamr@2
|
225 |
IMPORT_C void ResetVisibleToColumn();
|
williamr@2
|
226 |
IMPORT_C void ResetVisibleToCell();
|
williamr@2
|
227 |
IMPORT_C TInt RowExtent() const;
|
williamr@2
|
228 |
IMPORT_C TInt ColumnExtent() const;
|
williamr@2
|
229 |
|
williamr@2
|
230 |
IMPORT_C TInt RowToYVal(TInt aRow) const;
|
williamr@2
|
231 |
IMPORT_C TInt RowToYVal(TInt aStartRow,TInt aEndRow) const;
|
williamr@2
|
232 |
IMPORT_C TInt VisibleRowToYVal(TInt aRow) const;
|
williamr@2
|
233 |
IMPORT_C TInt TitleRowToYVal(TInt aTitleRow) const;
|
williamr@2
|
234 |
IMPORT_C TInt ColumnToXVal(TInt aCol) const;
|
williamr@2
|
235 |
IMPORT_C TInt ColumnToXVal(TInt aStartCol,TInt aEndCol) const;
|
williamr@2
|
236 |
IMPORT_C TInt VisibleColumnToXVal(TInt aCol) const;
|
williamr@2
|
237 |
IMPORT_C TInt TitleColumnToXVal(TInt aTitleCol) const;
|
williamr@2
|
238 |
IMPORT_C TInt YValToRow(TInt aYVal) const;
|
williamr@2
|
239 |
IMPORT_C TInt YValToRow(TInt aStartRow,TInt aDisp) const;
|
williamr@2
|
240 |
IMPORT_C TInt YValToTitleRow(TInt aYVal) const;
|
williamr@2
|
241 |
IMPORT_C TInt XValToColumn(TInt aXVal) const;
|
williamr@2
|
242 |
IMPORT_C TInt XValToColumn(TInt aStartCol,TInt aDisp) const;
|
williamr@2
|
243 |
IMPORT_C TInt XValToTitleColumn(TInt aXVal) const;
|
williamr@2
|
244 |
IMPORT_C TCellRef PointToCell(const TPoint &aPoint) const;
|
williamr@2
|
245 |
IMPORT_C TCellRef PointToCell(const TCellRef &aStartCell,const TPoint &aPointDisp) const;
|
williamr@2
|
246 |
IMPORT_C TPoint CellToPoint(const TCellRef &aCell) const;
|
williamr@2
|
247 |
IMPORT_C TPoint CellToPoint(const TCellRef &aStartCell,const TCellRef &aEndCell) const;
|
williamr@2
|
248 |
IMPORT_C TPoint TitleCellToPoint(const TCellRef& aTitleCell) const;
|
williamr@2
|
249 |
IMPORT_C TRect CellToRect(const TCellRef& aCell) const;
|
williamr@2
|
250 |
IMPORT_C TInt YValToNearestRow(TInt aStartRow,TInt aDisp) const;
|
williamr@2
|
251 |
IMPORT_C TInt XValToNearestColumn(TInt aStartCol,TInt aDisp) const;
|
williamr@2
|
252 |
IMPORT_C TSize TopLeftTitleRangeSize() const;
|
williamr@2
|
253 |
|
williamr@2
|
254 |
IMPORT_C void PaginateL();
|
williamr@2
|
255 |
IMPORT_C void ClearPagination();
|
williamr@2
|
256 |
IMPORT_C void NotifyPaginationOutOfDateL();
|
williamr@2
|
257 |
inline TBool IsPaginated() const;
|
williamr@2
|
258 |
IMPORT_C TRangeRef PageToRange(TInt aPageNo,TPageOrder aPageOrder) const;
|
williamr@2
|
259 |
inline void SetPrintRange(const TRangeRef& aPrintRange);
|
williamr@2
|
260 |
IMPORT_C TInt NoOfPages() const;
|
williamr@2
|
261 |
IMPORT_C void SetPageSizeInTwipsL(const TSize& aPageSize);
|
williamr@2
|
262 |
inline TSize PageSizeInTwips() const;
|
williamr@2
|
263 |
inline TBool IsAutoPagination() const;
|
williamr@2
|
264 |
IMPORT_C void SetAutoPagination(TBool aState);
|
williamr@2
|
265 |
IMPORT_C TBool IsHardRowPageBreak(TInt aRow) const;
|
williamr@2
|
266 |
IMPORT_C TBool IsHardColumnPageBreak(TInt aCol) const;
|
williamr@2
|
267 |
IMPORT_C void SetHardRowPageBreakL(TInt aRow);
|
williamr@2
|
268 |
IMPORT_C void ClearHardRowPageBreakL(TInt aRow);
|
williamr@2
|
269 |
IMPORT_C void SetHardColumnPageBreakL(TInt aCol);
|
williamr@2
|
270 |
IMPORT_C void ClearHardColumnPageBreakL(TInt aCol);
|
williamr@2
|
271 |
IMPORT_C void ClearAllHardPageBreaksL();
|
williamr@2
|
272 |
|
williamr@2
|
273 |
IMPORT_C void ExternalizeL(RWriteStream &aStream) const;
|
williamr@2
|
274 |
IMPORT_C void InternalizeL(RReadStream &aStream);
|
williamr@2
|
275 |
IMPORT_C TStreamId StoreL(CStreamStore& aStore) const;
|
williamr@2
|
276 |
IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aStreamId);
|
williamr@2
|
277 |
////////////////////////->
|
williamr@2
|
278 |
// Setting the grid colors
|
williamr@2
|
279 |
IMPORT_C void SetGridColors(TGridColors aColors);
|
williamr@2
|
280 |
// Getting the grid colors
|
williamr@2
|
281 |
IMPORT_C const TGridColors& GridColors() const;
|
williamr@2
|
282 |
////////////////////////->
|
williamr@2
|
283 |
private:
|
williamr@2
|
284 |
void SetIndefiniteRowBoundaries(TBool aState);
|
williamr@2
|
285 |
inline TBool IsVisibleToRowFullyVisible() const;
|
williamr@2
|
286 |
void SetVisibleToRowFullyVisible(TBool aState);
|
williamr@2
|
287 |
inline TBool IsVisibleToColumnFullyVisible() const;
|
williamr@2
|
288 |
void SetVisibleToColumnFullyVisible(TBool aState);
|
williamr@2
|
289 |
TInt ColumnWidthInPixels(TInt aCol) const;
|
williamr@2
|
290 |
void SetColumnWidthInPixelsL(TInt aCol,TInt aWidthInPixels);
|
williamr@2
|
291 |
void PreCheckColumnWidthChange(TInt aCol,TBool aNonZeroWidth);
|
williamr@2
|
292 |
void PostCheckColumnWidthChange(TInt aCol,TBool aNonZeroWidth);
|
williamr@2
|
293 |
TInt DefaultColumnWidthInPixels() const;
|
williamr@2
|
294 |
void SetDefaultColumnWidthInPixels(TInt aWidthInPixels);
|
williamr@2
|
295 |
TInt RowHeightInPixels(TInt aRow) const;
|
williamr@2
|
296 |
void SetRowHeightInPixelsL(TInt aRow,TInt aHeightInPixels);
|
williamr@2
|
297 |
void PreCheckRowHeightChange(TInt aRow,TBool aNonZeroHeight);
|
williamr@2
|
298 |
void PostCheckRowHeightChange(TInt aRow,TBool aNonZeroHeight);
|
williamr@2
|
299 |
TInt DefaultRowHeightInPixels() const;
|
williamr@2
|
300 |
void SetDefaultRowHeightInPixels(TInt aHeightInPixels);
|
williamr@2
|
301 |
TPoint CalcOffsetBetweenCells(const TCellRef& aCell1,const TCellRef& aCell2) const;
|
williamr@2
|
302 |
TBool LimitRow(TInt& aRow) const;
|
williamr@2
|
303 |
TBool LimitColumn(TInt &aColumn) const;
|
williamr@2
|
304 |
void LimitRow(TInt& aRow,TInt aLowerLimit,TInt aUpperLimit) const;
|
williamr@2
|
305 |
void LimitColumn(TInt& aCol,TInt aLowerLimit,TInt aUpperLimit) const;
|
williamr@2
|
306 |
TBool LimitCell(TCellRef& aCell) const;
|
williamr@2
|
307 |
void LimitRowToVisible(TInt& aRow) const;
|
williamr@2
|
308 |
void LimitColumnToVisible(TInt& aCol) const;
|
williamr@2
|
309 |
void LimitCellToVisible(TCellRef& aCell) const;
|
williamr@2
|
310 |
TBool IsCellOutOfVisibleRange(const TCellRef &aCell) const;
|
williamr@2
|
311 |
TBool IsCellOutOfGridRange(const TCellRef& aCell) const;
|
williamr@2
|
312 |
void StepRowForward(TInt& aRow) const;
|
williamr@2
|
313 |
void StepRowBackward(TInt& aRow) const;
|
williamr@2
|
314 |
void StepColumnForward(TInt& aCol) const;
|
williamr@2
|
315 |
void StepColumnBackward(TInt& aCol) const;
|
williamr@2
|
316 |
void CalcVisibleFromRow(TInt aVisibleToRow,TInt& aNewVisibleFromRow) const;
|
williamr@2
|
317 |
TBool CalcVisibleToRow(TInt aVisibleFromRow,TInt& aNewVisibleToRow) const;
|
williamr@2
|
318 |
void CalcVisibleFromColumn(TInt aVisibleToCol,TInt& aNewVisibleFromCol) const;
|
williamr@2
|
319 |
TBool CalcVisibleToColumn(TInt aVisibleFromCol,TInt& aNewVisibleToCol) const;
|
williamr@2
|
320 |
TInt CalcVisibleFromRowAfterPageScroll(TMoveDirectionAndAmount aPageScroll) const;
|
williamr@2
|
321 |
TInt CalcVisibleFromColumnAfterPageScroll(TMoveDirectionAndAmount aPageScroll) const;
|
williamr@2
|
322 |
TCellRef CalcVisibleFromCellAfterPageScroll(TMoveDirectionAndAmount aPageScroll) const;
|
williamr@2
|
323 |
TBool FindNextRowPageBreak(TInt aSearchStart,TInt& aFoundRow) const;
|
williamr@2
|
324 |
TBool FindNextColumnPageBreak(TInt aSearchStart,TInt& aFoundCol) const;
|
williamr@2
|
325 |
void DoMainPaginationLoopL(TInt aPageSpan,CSparseMap* aCellSpanMap,CSparseMap* aPageMap,
|
williamr@2
|
326 |
CArrayFix<TInt>* aHardPageBreaks,TInt aStartId);
|
williamr@2
|
327 |
TBool RequestRow(TInt aRow,TInt& aReturnRow) const;
|
williamr@2
|
328 |
|
williamr@2
|
329 |
void ConstructL(const MGridTable *aGridTable,CGridImg *aGridImg,const TRangeRef& aGridRange);
|
williamr@2
|
330 |
//private:
|
williamr@2
|
331 |
private:
|
williamr@2
|
332 |
enum
|
williamr@2
|
333 |
{
|
williamr@2
|
334 |
EMaxArrayChanges=256,
|
williamr@2
|
335 |
EInitialDefaultRowHeightInTwips = 300,
|
williamr@2
|
336 |
EInitialDefaultColumnWidthInTwips = 900
|
williamr@2
|
337 |
};
|
williamr@2
|
338 |
enum
|
williamr@2
|
339 |
{
|
williamr@2
|
340 |
EIsTopLabels = 0x1,
|
williamr@2
|
341 |
EIsSideLabels = 0x2,
|
williamr@2
|
342 |
EIsHorizontalGridLines = 0x4,
|
williamr@2
|
343 |
EIsVerticalGridLines = 0x8,
|
williamr@2
|
344 |
EIsColumnBursting = 0x10,
|
williamr@2
|
345 |
EIsCursorVisible = 0x20,
|
williamr@2
|
346 |
EIsRowPermanentlySelected = 0x40,
|
williamr@2
|
347 |
EIsHorizontalTitleLine = 0x80,
|
williamr@2
|
348 |
EIsVerticalTitleLine = 0x100,
|
williamr@2
|
349 |
EIsIndefiniteRowBoundaries = 0x200,
|
williamr@2
|
350 |
EIsUniformRowHeight = 0x400,
|
williamr@2
|
351 |
EIsUniformColumnWidth = 0x800,
|
williamr@2
|
352 |
EIsTopLabelDragDisabled = 0x1000,
|
williamr@2
|
353 |
EIsSideLabelDragDisabled = 0x2000,
|
williamr@2
|
354 |
EIsPaginated = 0x4000,
|
williamr@2
|
355 |
EIsAutoPagination = 0x8000,
|
williamr@2
|
356 |
EIsPrintedLabels = 0x10000,
|
williamr@2
|
357 |
EIsPrintedGridLines = 0x20000,
|
williamr@2
|
358 |
EIsVisibleToRowFullyVisible = 0x40000,
|
williamr@2
|
359 |
EIsVisibleToColumnFullyVisible = 0x80000,
|
williamr@2
|
360 |
EIsEncroachingCellBorders = 0x100000,
|
williamr@2
|
361 |
EIsColumnSelectionDisabled = 0x200000,
|
williamr@2
|
362 |
EIsRowSelectionDisabled = 0x400000,
|
williamr@2
|
363 |
EIsAutoClearGridCells = 0x800000,
|
williamr@2
|
364 |
EIsGridLabelSeparators = 0x1000000,
|
williamr@2
|
365 |
EIsHighlightVisible = 0x2000000,
|
williamr@2
|
366 |
EIsPageBreakLinesHidden = 0x4000000
|
williamr@2
|
367 |
};
|
williamr@2
|
368 |
private:
|
williamr@2
|
369 |
const MGridTable* iGridTable;
|
williamr@2
|
370 |
const MGraphicsDeviceMap* iGraphicsDeviceMap; //*
|
williamr@2
|
371 |
CGridImg* iGridImg; //*
|
williamr@2
|
372 |
// persistent
|
williamr@2
|
373 |
TRangeRef iGridRange; //*
|
williamr@2
|
374 |
TRangeRef iVisibleRange;
|
williamr@2
|
375 |
TRangeRef iTitleRange;
|
williamr@2
|
376 |
CSparseMap* iColumnWidthMap; //*
|
williamr@2
|
377 |
CSparseMap* iRowHeightMap; //*
|
williamr@2
|
378 |
CSparseMap* iColumnPageMap; //*
|
williamr@2
|
379 |
CSparseMap* iRowPageMap; //*
|
williamr@2
|
380 |
CArrayFix<TInt>* iHardRowPageBreaks;
|
williamr@2
|
381 |
CArrayFix<TInt>* iHardColumnPageBreaks;
|
williamr@2
|
382 |
TRgb iGridEdgeColor;
|
williamr@2
|
383 |
TInt iMinRowHeightInPixels;
|
williamr@2
|
384 |
TInt iMinColumnWidthInPixels;
|
williamr@2
|
385 |
TSize iPageSizeInTwips; //*
|
williamr@2
|
386 |
TUint32 iFlags; //* Starred items are used in printing
|
williamr@2
|
387 |
////////////////////////->
|
williamr@2
|
388 |
TGridColors iColors;
|
williamr@2
|
389 |
////////////////////////->
|
williamr@2
|
390 |
// End of persistent data
|
williamr@2
|
391 |
TBool iHasChanged;
|
williamr@2
|
392 |
};
|
williamr@2
|
393 |
|
williamr@2
|
394 |
|
williamr@2
|
395 |
|
williamr@2
|
396 |
|
williamr@2
|
397 |
class CGridLabelImg : public CBase
|
williamr@2
|
398 |
/** Draws a grid cell's label.
|
williamr@2
|
399 |
|
williamr@2
|
400 |
@publishedAll
|
williamr@2
|
401 |
@released */
|
williamr@2
|
402 |
{
|
williamr@2
|
403 |
friend class CGridImg;
|
williamr@2
|
404 |
public:
|
williamr@2
|
405 |
IMPORT_C virtual ~CGridLabelImg();
|
williamr@2
|
406 |
IMPORT_C void ConstructL();
|
williamr@2
|
407 |
inline void SetGraphicsDeviceMap(MGraphicsDeviceMap* aGraphicsDeviceMap);
|
williamr@2
|
408 |
inline TFontSpec FontSpec() const;
|
williamr@2
|
409 |
IMPORT_C void ReleaseFont();
|
williamr@2
|
410 |
IMPORT_C void NotifyGraphicsDeviceMapChangeL();
|
williamr@2
|
411 |
inline void SetGridColors(const TGridColors& aGridColors);
|
williamr@2
|
412 |
protected:
|
williamr@2
|
413 |
IMPORT_C CGridLabelImg(const TFontSpec& aFontSpec,MGraphicsDeviceMap* aGraphicsDeviceMap);
|
williamr@2
|
414 |
////////////////////////->
|
williamr@2
|
415 |
IMPORT_C void DrawTopLeftLabelL(CGraphicsContext* aGc,const TRect& aRect, TRgb aColor) const;
|
williamr@2
|
416 |
////////////////////////->
|
williamr@2
|
417 |
private:
|
williamr@2
|
418 |
/** Draws a row label.
|
williamr@2
|
419 |
|
williamr@2
|
420 |
@publishedAll
|
williamr@2
|
421 |
@released
|
williamr@2
|
422 |
@param aGc The graphics context to be used.
|
williamr@2
|
423 |
@param aRow The row for which the label is to be drawn.
|
williamr@2
|
424 |
@param aRect The rectangle in which the label is to be drawn. */
|
williamr@2
|
425 |
virtual void DrawRowLabelL(CGraphicsContext* aGc,TInt aRow,const TRect& aRect) const=0;
|
williamr@2
|
426 |
/** Draws a column label.
|
williamr@2
|
427 |
|
williamr@2
|
428 |
@publishedAll
|
williamr@2
|
429 |
@released
|
williamr@2
|
430 |
@param aGc The graphics context to be used.
|
williamr@2
|
431 |
@param aCol The column for which the label is to be drawn.
|
williamr@2
|
432 |
@param aRect The rectangle in which the label is to be drawn. */
|
williamr@2
|
433 |
virtual void DrawColLabelL(CGraphicsContext* aGc,TInt aCol,const TRect& aRect) const=0;
|
williamr@2
|
434 |
IMPORT_C virtual void DrawTopLeftLabelL(CGraphicsContext* aGc,const TRect& aRect) const;
|
williamr@2
|
435 |
IMPORT_C virtual TInt SideLabelWidthInPixels(TInt aStartRow,TInt aEndRow) const;
|
williamr@2
|
436 |
IMPORT_C virtual TInt TopLabelHeightInPixels() const;
|
williamr@2
|
437 |
IMPORT_C virtual void DrawRowCursorL(CGraphicsContext* aGc,const TRect& aRect) const;
|
williamr@2
|
438 |
protected:
|
williamr@2
|
439 |
enum
|
williamr@2
|
440 |
{
|
williamr@2
|
441 |
/** The default width of side labels, in twips.
|
williamr@2
|
442 |
|
williamr@2
|
443 |
This is used by the default implementation of SideLabelWidthInPixels(). */
|
williamr@2
|
444 |
EDefaultSideLabelWidthInTwips=300,
|
williamr@2
|
445 |
/** The default height of top labels, in twips.
|
williamr@2
|
446 |
|
williamr@2
|
447 |
This is used by the default implementation of TopLabelHeightInPixels(). */
|
williamr@2
|
448 |
EDefaultTopLabelHeightInTwips=300
|
williamr@2
|
449 |
};
|
williamr@2
|
450 |
protected:
|
williamr@2
|
451 |
/** The nearest font to that specified in the font specification. */
|
williamr@2
|
452 |
CFont* iFont;
|
williamr@2
|
453 |
/** The font specification in device independent terms. */
|
williamr@2
|
454 |
TFontSpec iFontSpec;
|
williamr@2
|
455 |
/** The graphics device map, an interface for mapping between twips and device-specific
|
williamr@2
|
456 |
units. */
|
williamr@2
|
457 |
MGraphicsDeviceMap* iGraphicsDeviceMap;
|
williamr@2
|
458 |
/** The grid colour specification. */
|
williamr@2
|
459 |
TGridColors iGridColors;
|
williamr@2
|
460 |
private:
|
williamr@2
|
461 |
TInt iSpare;
|
williamr@2
|
462 |
};
|
williamr@2
|
463 |
|
williamr@2
|
464 |
|
williamr@2
|
465 |
class CGridCellImg : public CBase
|
williamr@2
|
466 |
/** Draws a grid cell's contents.
|
williamr@2
|
467 |
|
williamr@2
|
468 |
@publishedAll
|
williamr@2
|
469 |
@released */
|
williamr@2
|
470 |
{
|
williamr@2
|
471 |
friend class CGridImg;
|
williamr@2
|
472 |
public:
|
williamr@2
|
473 |
IMPORT_C virtual ~CGridCellImg();
|
williamr@2
|
474 |
inline TInt BurstColOffset() const;
|
williamr@2
|
475 |
inline TInt BurstLeft() const;
|
williamr@2
|
476 |
inline TInt BurstRight() const;
|
williamr@2
|
477 |
inline TBool IsHorizontalGridLines() const;
|
williamr@2
|
478 |
inline TBool IsVerticalGridLines() const;
|
williamr@2
|
479 |
inline void SetGridColors(const TGridColors& aGridColors);
|
williamr@2
|
480 |
protected:
|
williamr@2
|
481 |
IMPORT_C CGridCellImg();
|
williamr@2
|
482 |
private:
|
williamr@2
|
483 |
/** Draws the contents of the specified cell.
|
williamr@2
|
484 |
|
williamr@2
|
485 |
@publishedAll
|
williamr@2
|
486 |
@released
|
williamr@2
|
487 |
@param aGc The graphics context to be used.
|
williamr@2
|
488 |
@param aCell The cell whose contents are to be drawn.
|
williamr@2
|
489 |
@param aDrawRect The rectangle in which the cell is to be drawn.
|
williamr@2
|
490 |
@param aClipRect The rectangle to which drawing is clipped. */
|
williamr@2
|
491 |
virtual void DrawL(CGraphicsContext* aGc,const TCellRef& aCell,const TRect& aDrawRect,
|
williamr@2
|
492 |
const TRect& aClipRect) const=0;
|
williamr@2
|
493 |
IMPORT_C virtual TInt DataWidthInPixelsL(const TCellRef& aCell) const;
|
williamr@2
|
494 |
IMPORT_C virtual TBool DoesCellContainDataL(const TCellRef& aCell) const;
|
williamr@2
|
495 |
// reserved virtual function
|
williamr@2
|
496 |
IMPORT_C virtual void Reserved_1();
|
williamr@2
|
497 |
private:
|
williamr@2
|
498 |
void SetBurstingData(TInt aBurstColOffset=0,TInt aBurstLeft=0,TInt aBurstRight=0);
|
williamr@2
|
499 |
private:
|
williamr@2
|
500 |
enum { EIsHorizontalGridLines = 0x1, EIsVerticalGridLines = 0x2 };
|
williamr@2
|
501 |
protected:
|
williamr@2
|
502 |
/** The grid colour specification. */
|
williamr@2
|
503 |
TGridColors iGridColors;
|
williamr@2
|
504 |
private:
|
williamr@2
|
505 |
TInt iBurstColOffset;
|
williamr@2
|
506 |
TInt iBurstLeft;
|
williamr@2
|
507 |
TInt iBurstRight;
|
williamr@2
|
508 |
TUint32 iGridLineFlags;
|
williamr@2
|
509 |
};
|
williamr@2
|
510 |
|
williamr@2
|
511 |
|
williamr@2
|
512 |
class MGridCursorMoveCallBack
|
williamr@2
|
513 |
/** An interface to a callback function that is intended to be called whenever
|
williamr@2
|
514 |
there is a change to the cursor position.
|
williamr@2
|
515 |
|
williamr@2
|
516 |
If such a callback is needed, a concrete implementation is defined, instantiated
|
williamr@2
|
517 |
and passed to CGridImg::SetCursorMoveCallBack().
|
williamr@2
|
518 |
|
williamr@2
|
519 |
@publishedAll
|
williamr@2
|
520 |
@released */
|
williamr@2
|
521 |
{
|
williamr@2
|
522 |
public:
|
williamr@2
|
523 |
/** Deals with the change to the cursor position.
|
williamr@2
|
524 |
|
williamr@2
|
525 |
This function is called immediately before exiting the following functions:
|
williamr@2
|
526 |
CGridImg::SetCursorPosL(), CGridImg::SetAnchorPosL(), CGridImg::MoveCursorL(),CGridImg::ResetSelectedL(),
|
williamr@2
|
527 |
CGridImg::AddRangeToSelectedL(), CGridImg::AddRegionToSelectedL(), CGridImg::AddRowToSelectedL(),
|
williamr@2
|
528 |
CGridImg::AddColToSelectedL().
|
williamr@2
|
529 |
|
williamr@2
|
530 |
The function is commonly used to do any necessary redrawing. */
|
williamr@2
|
531 |
virtual void HandleCursorMoveL()=0;
|
williamr@2
|
532 |
};
|
williamr@2
|
533 |
|
williamr@2
|
534 |
class RWindow;
|
williamr@2
|
535 |
class CWindowGc;
|
williamr@2
|
536 |
|
williamr@2
|
537 |
|
williamr@2
|
538 |
class CGridImg : public CBase
|
williamr@2
|
539 |
/** Draws the contents of the grid.
|
williamr@2
|
540 |
|
williamr@2
|
541 |
@publishedAll
|
williamr@2
|
542 |
@released
|
williamr@2
|
543 |
*/
|
williamr@2
|
544 |
{
|
williamr@2
|
545 |
friend class CGridLay;
|
williamr@2
|
546 |
public:
|
williamr@2
|
547 |
enum
|
williamr@2
|
548 |
{
|
williamr@2
|
549 |
/** Indicates that the selection state is to be maintained.
|
williamr@2
|
550 |
|
williamr@2
|
551 |
If a region of cells is selected, then this selection is to be kept.
|
williamr@2
|
552 |
|
williamr@2
|
553 |
Typically, this is set by a control when a drag operation is in
|
williamr@2
|
554 |
progress and the shift modifier key is also pressed. */
|
williamr@2
|
555 |
EIsWithSelect=0x0001,
|
williamr@2
|
556 |
/** Indicates that the control modifier key has been pressed. */
|
williamr@2
|
557 |
EIsWithControl=0x0002,
|
williamr@2
|
558 |
/** Indicates that a drag operation is in progress. */
|
williamr@2
|
559 |
EIsWithDrag=0x0004,
|
williamr@2
|
560 |
/** Indicates that the cursor is the edge of the grid. */
|
williamr@2
|
561 |
EIsAtBoundary=0x0008,
|
williamr@2
|
562 |
/** Indicates that a new cell is being selected, without dragging. */
|
williamr@2
|
563 |
EIsAbsoluteMove=0x0010,
|
williamr@2
|
564 |
/** Indicates that a whole row is selected. */
|
williamr@2
|
565 |
EIsRowSelected=0x0020,
|
williamr@2
|
566 |
/** Indicates that a whole column is selected.
|
williamr@2
|
567 |
|
williamr@2
|
568 |
This also means that the label cell for the column is included in the selection. */
|
williamr@2
|
569 |
EIsColumnSelected=0x0040
|
williamr@2
|
570 |
};
|
williamr@2
|
571 |
enum
|
williamr@2
|
572 |
{
|
williamr@2
|
573 |
/** Defines a scale value of 100.
|
williamr@2
|
574 |
|
williamr@2
|
575 |
Scale factor values are divided into this value to calculate
|
williamr@2
|
576 |
drawing points, rectangles etc. */
|
williamr@2
|
577 |
EScaleOneToOne=100
|
williamr@2
|
578 |
};
|
williamr@2
|
579 |
|
williamr@2
|
580 |
enum TSelectType
|
williamr@2
|
581 |
{
|
williamr@2
|
582 |
/** Indicates that an existing selected region is to be reset (i.e. emptied) before
|
williamr@2
|
583 |
adding a new region. */
|
williamr@2
|
584 |
ESelectOverwrite,
|
williamr@2
|
585 |
/** Indicates that a new region is to be appended to any existing selected region. */
|
williamr@2
|
586 |
ESelectAppend
|
williamr@2
|
587 |
};
|
williamr@2
|
588 |
public:
|
williamr@2
|
589 |
IMPORT_C virtual ~CGridImg();
|
williamr@2
|
590 |
IMPORT_C static CGridImg* NewL(CGraphicsDevice* aGraphicsDevice,CGridCellImg* aGridCellImg,CGridLay* aGridLay);
|
williamr@2
|
591 |
IMPORT_C static CGridImg* NewL(CGridCellImg* aGridCellImg,CGridLay* aGridLay); //Creates Partial GridImg
|
williamr@2
|
592 |
inline void SetGridLay(CGridLay* aGridLay);
|
williamr@2
|
593 |
inline void SetWindow(RWindow* aWin);
|
williamr@2
|
594 |
////////////////////////->
|
williamr@2
|
595 |
IMPORT_C void SetGridLabelImg(CGridLabelImg* aGridLabelImg);
|
williamr@2
|
596 |
////////////////////////->
|
williamr@2
|
597 |
inline void SetCursorMoveCallBack(MGridCursorMoveCallBack* aCursorMoveCallBack);
|
williamr@2
|
598 |
inline const CGridCellRegion* Selected() const;
|
williamr@2
|
599 |
inline const CGridLabelImg* GridLabelImg() const;
|
williamr@2
|
600 |
|
williamr@2
|
601 |
IMPORT_C void ScrollL(const TPoint &aOffset);
|
williamr@2
|
602 |
IMPORT_C void MoveCursorL(TMoveDirectionAndAmount aCursorMove,TUint aSelectState);
|
williamr@2
|
603 |
IMPORT_C void SetCursorWithPointerL(const TPoint& aPoint,TUint aFlagList);
|
williamr@2
|
604 |
IMPORT_C void ResetSelectedL();
|
williamr@2
|
605 |
IMPORT_C void AddRangeToSelectedL(const TRangeRef& aRange,TSelectType aType=ESelectOverwrite);
|
williamr@2
|
606 |
IMPORT_C void AddRegionToSelectedL(const CArrayFix<TRangeRef>* aCellRegion,TSelectType aType=ESelectOverwrite);
|
williamr@2
|
607 |
IMPORT_C void AddRowToSelectedL(TInt aRow,TSelectType aType=ESelectOverwrite);
|
williamr@2
|
608 |
IMPORT_C void AddColToSelectedL(TInt aCol,TSelectType aType=ESelectOverwrite);
|
williamr@2
|
609 |
IMPORT_C void DrawL(CGraphicsContext* aGc) const;
|
williamr@2
|
610 |
IMPORT_C void DrawL(CGraphicsContext* aGc,const TRect& aRect) const;
|
williamr@2
|
611 |
IMPORT_C void DrawCellL(const TCellRef& aCell) const;
|
williamr@2
|
612 |
IMPORT_C void DrawRangeL(const TRangeRef& aRange) const;
|
williamr@2
|
613 |
IMPORT_C void DrawSelectedL() const;
|
williamr@2
|
614 |
IMPORT_C void DrawTitleLines() const;
|
williamr@2
|
615 |
IMPORT_C void ClearTitleLineRegionL(const TPoint& aCrossPoint) const;
|
williamr@2
|
616 |
IMPORT_C void PrintGridLinesAndCellsInRangeL(CGraphicsContext* aPrinterGc,const TRangeRef& aRange,
|
williamr@2
|
617 |
TInt aScaleFactor) const;
|
williamr@2
|
618 |
|
williamr@2
|
619 |
inline TCellRef CursorPos() const;
|
williamr@2
|
620 |
IMPORT_C void SetCursorPosL(const TCellRef& aCursorPos);
|
williamr@2
|
621 |
inline TCellRef NewCursorPos() const;
|
williamr@2
|
622 |
inline TCellRef AnchorPos() const;
|
williamr@2
|
623 |
IMPORT_C void SetAnchorPosL(const TCellRef& aAnchorPos);
|
williamr@2
|
624 |
inline TRect GridRect() const;
|
williamr@2
|
625 |
IMPORT_C void SetGridRect(const TRect& aNewRect);
|
williamr@2
|
626 |
IMPORT_C void SetPrintGridRect(const TRect& aPrintRect);
|
williamr@2
|
627 |
inline TPoint TitlePoint() const;
|
williamr@2
|
628 |
inline TPoint MainPoint() const;
|
williamr@2
|
629 |
inline TRect MainRect() const;
|
williamr@2
|
630 |
IMPORT_C void ResetReferencePoints();
|
williamr@2
|
631 |
IMPORT_C void NotifyGridRangeResize();
|
williamr@2
|
632 |
|
williamr@2
|
633 |
IMPORT_C void CheckSideLabelWidthAndScrollL();
|
williamr@2
|
634 |
IMPORT_C TInt CheckSideLabelWidth();
|
williamr@2
|
635 |
IMPORT_C TInt SideLabelWidthInPixels() const;
|
williamr@2
|
636 |
IMPORT_C TInt MaxSideLabelWidthInPixels() const;
|
williamr@2
|
637 |
IMPORT_C TInt TopLabelHeightInPixels() const;
|
williamr@2
|
638 |
IMPORT_C void FinishLabelDragL();
|
williamr@2
|
639 |
IMPORT_C TBool StartLabelDrag(const TPoint &aPoint);
|
williamr@2
|
640 |
IMPORT_C TBool UpdateLabelDrag(const TPoint &aPoint);
|
williamr@2
|
641 |
IMPORT_C TBool StartLabelResize(TBool aIsColumnLabel, TInt aIndex);
|
williamr@2
|
642 |
IMPORT_C TBool UpdateLabelResize(TInt aDelta);
|
williamr@2
|
643 |
IMPORT_C void FinishLabelResizeL(TBool aResize);
|
williamr@2
|
644 |
private:
|
williamr@2
|
645 |
enum TDragDim {EXDrag,EYDrag,ENoDrag};
|
williamr@2
|
646 |
enum TRefPoint {ETitleRef,EMainRef};
|
williamr@2
|
647 |
enum TDragDraw {EDragDrawWithBitmap,EDragDrawWithoutBitmap};
|
williamr@2
|
648 |
enum TArrows {EBothArrows,ESecondArrowOnly};
|
williamr@2
|
649 |
enum
|
williamr@2
|
650 |
{
|
williamr@2
|
651 |
EIsLabelDraggingIgnored = 0x1,
|
williamr@2
|
652 |
EIsSidewaysScrollIgnored = 0x2
|
williamr@2
|
653 |
};
|
williamr@2
|
654 |
private:
|
williamr@2
|
655 |
void DrawResizingDragHiglights(const TRect& aRect);
|
williamr@2
|
656 |
void DrawAllGridLabelsL() const;
|
williamr@2
|
657 |
void DrawTopLeftGridLabelL() const;
|
williamr@2
|
658 |
void DrawTopGridLabelsL(TInt aStartCol,TInt aEndCol,TRefPoint aXRef=EMainRef) const;
|
williamr@2
|
659 |
void DrawSideGridLabelsL(TInt aStartRow,TInt aEndRow,TRefPoint aYRef=EMainRef) const;
|
williamr@2
|
660 |
void DrawSideGridLabelIfOnScreenL(TInt aRow) const;
|
williamr@2
|
661 |
void DrawAllGridLinesAndCellsL() const;
|
williamr@2
|
662 |
void DrawGridLinesAndCellsInRangeL(const TRangeRef& aRange,const TRect& aClipRect,
|
williamr@2
|
663 |
TRefPoint aXRef=EMainRef,TRefPoint aYRef=EMainRef) const;
|
williamr@2
|
664 |
void DrawCellsToGcL(CGraphicsContext* aGc,const TRangeRef& aRange,const TRect& aClipRect,
|
williamr@2
|
665 |
const TPoint& aStartPoint,TInt aScaleFactor=EScaleOneToOne) const;
|
williamr@2
|
666 |
void DrawBurstingCellL(CGraphicsContext* aGc,const TCellRef& aCell,const TRect& aRect,const TRect& aClipRect,
|
williamr@2
|
667 |
TInt aScaleFactor,TInt aBurstLeft,const TCellRef& aBurstCell) const;
|
williamr@2
|
668 |
TInt CalcBurstLeftL(TCellRef& aBurstCell,TInt aScaleFactor) const;
|
williamr@2
|
669 |
TInt CalcBurstRightL(const TCellRef& aCell,TInt aExcessRight,TInt aScaleFactor) const;
|
williamr@2
|
670 |
void DrawVerticalTitleLine() const;
|
williamr@2
|
671 |
void DrawHorizontalTitleLine() const;
|
williamr@2
|
672 |
void BeginRedrawAndDrawL() const;
|
williamr@2
|
673 |
void BeginRedrawAndDrawL(const TRect& aRect) const;
|
williamr@2
|
674 |
|
williamr@2
|
675 |
void AppendTotalHighlightRegionL(TRegion& aRegion) const;
|
williamr@2
|
676 |
void AppendPartialHighlightRegionL(TRegion& aRegion,const TRect& aClipRect,
|
williamr@2
|
677 |
TRefPoint aXRef=EMainRef,TRefPoint aYRef=EMainRef) const;
|
williamr@2
|
678 |
void RemoveRowLabelFromRegionL(TInt aRow,TRegion& aRegion) const;
|
williamr@2
|
679 |
void HighlightMinRegionL(const TRegion &aOldRegion,const TRegion &aNewRegion);
|
williamr@2
|
680 |
void HighlightRegion(const TRegion &aRegion) const;
|
williamr@2
|
681 |
void HighlightNewRegionFromOldL(const TRegion& aOldRegion);
|
williamr@2
|
682 |
void DrawCursorOrRegionL(TUint aMoveFlags);
|
williamr@2
|
683 |
void UpdateSelectedRegion(TInt aSelectCount,TUint aMoveFlags);
|
williamr@2
|
684 |
void AddLabelToRegionL(TUint aMoveFlags);
|
williamr@2
|
685 |
void StartSelectedRegionL(TUint aMoveFlags);
|
williamr@2
|
686 |
TBool ScanColumnsForDrag(TInt aFromColumn,TInt aToColumn,TInt aPointerPos,TInt& aPrevious,TInt& aCurrent);
|
williamr@2
|
687 |
TBool ScanRowsForDrag(TInt aFromRow,TInt aToRow,TInt aPointerPos,TInt& aPrevious,TInt& aCurrent);
|
williamr@2
|
688 |
void DrawDraggingHighlight(const TRect aLine,TDragDraw aDragDraw);
|
williamr@2
|
689 |
void DrawArrowsToInMemoryBitmap(TArrows aArrows);
|
williamr@2
|
690 |
TPoint RelativeCellToPoint(const TCellRef& aCell,TRefPoint aXRef=EMainRef,
|
williamr@2
|
691 |
TRefPoint aYRef=EMainRef) const;
|
williamr@2
|
692 |
TCellRef RelativePointToCell(const TPoint& aPoint,TRefPoint aXRef=EMainRef,
|
williamr@2
|
693 |
TRefPoint aYRef=EMainRef) const;
|
williamr@2
|
694 |
TRect PartialCellRectL(const TCellRef& aCell,const TRect& aClipRect,
|
williamr@2
|
695 |
TRefPoint aXRef=EMainRef,TRefPoint aYRef=EMainRef) const;
|
williamr@2
|
696 |
TRect PartialRangeRect(const TRangeRef& aRange,const TRect& aClipRect,
|
williamr@2
|
697 |
TRefPoint aXRef=EMainRef,TRefPoint aYRef=EMainRef) const;
|
williamr@2
|
698 |
void CreateGc(CGraphicsContext* aGc);
|
williamr@2
|
699 |
void DeleteGc();
|
williamr@2
|
700 |
static void CleanupGc(TAny* aObject);
|
williamr@2
|
701 |
void ResetGcToDefault(CGraphicsContext* aGc) const;
|
williamr@2
|
702 |
void ScaleDown(TPoint& aPoint,TInt aScaleFactor) const;
|
williamr@2
|
703 |
void ConstructSelectedL(const TRangeRef& aGridRange);
|
williamr@2
|
704 |
|
williamr@2
|
705 |
CGridImg(CGraphicsDevice* aGraphicsDevice,CGridCellImg* aGridCellImg,CGridLay* aGridLay);
|
williamr@2
|
706 |
CGridImg(CGridCellImg* aGridCellImg,CGridLay* aGridLay);
|
williamr@2
|
707 |
void ConstructL();
|
williamr@2
|
708 |
|
williamr@2
|
709 |
////////////////////////->
|
williamr@2
|
710 |
void SetGridColors(const TGridColors& aGridColors);
|
williamr@2
|
711 |
////////////////////////->
|
williamr@2
|
712 |
private:
|
williamr@2
|
713 |
TRect iGridRect;
|
williamr@2
|
714 |
TPoint iTitlePoint;
|
williamr@2
|
715 |
TPoint iMainPoint;
|
williamr@2
|
716 |
TCellRef iCursorPos; // Persisted
|
williamr@2
|
717 |
TCellRef iNewCursorPos;
|
williamr@2
|
718 |
TCellRef iAnchorPos;
|
williamr@2
|
719 |
|
williamr@2
|
720 |
CGraphicsDevice* iGraphicsDevice;
|
williamr@2
|
721 |
CGraphicsContext* iGcPtr;
|
williamr@2
|
722 |
CWindowGc* iGc;
|
williamr@2
|
723 |
RWindow* iWin;
|
williamr@2
|
724 |
CGridCellImg* iGridCellImg; //*
|
williamr@2
|
725 |
CGridLabelImg* iGridLabelImg; //*
|
williamr@2
|
726 |
CGridLay* iGridLay; //* Starred items are used in printing
|
williamr@2
|
727 |
CGridCellRegion* iSelected;
|
williamr@2
|
728 |
MGridCursorMoveCallBack* iCursorMoveCallBack;
|
williamr@2
|
729 |
TBool iDrawResizeLines;
|
williamr@2
|
730 |
TInt iDragLabel;
|
williamr@2
|
731 |
TInt iCurrentDragPos;
|
williamr@2
|
732 |
TInt iDragDiff;
|
williamr@2
|
733 |
TInt iDragFlags;
|
williamr@2
|
734 |
TDragDim iDragDim;
|
williamr@2
|
735 |
CFbsBitmap* iDragBmp;
|
williamr@2
|
736 |
TRefPoint iXRefPoint;
|
williamr@2
|
737 |
TRefPoint iYRefPoint;
|
williamr@2
|
738 |
};
|
williamr@2
|
739 |
|
williamr@2
|
740 |
|
williamr@2
|
741 |
class TGridUtils
|
williamr@2
|
742 |
/** A collection of Grid utilities.
|
williamr@2
|
743 |
|
williamr@2
|
744 |
@publishedAll
|
williamr@2
|
745 |
@released */
|
williamr@2
|
746 |
{
|
williamr@2
|
747 |
public:
|
williamr@2
|
748 |
IMPORT_C static void FillRect(CGraphicsContext* aGc,TRgb aColor,const TRect &aRect);
|
williamr@2
|
749 |
};
|
williamr@2
|
750 |
|
williamr@2
|
751 |
|
williamr@2
|
752 |
#include <grdstd.inl>
|
williamr@2
|
753 |
#endif
|