williamr@4
|
1 |
/*
|
williamr@4
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
3 |
* All rights reserved.
|
williamr@4
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
8 |
*
|
williamr@4
|
9 |
* Initial Contributors:
|
williamr@4
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@4
|
11 |
*
|
williamr@4
|
12 |
* Contributors:
|
williamr@4
|
13 |
*
|
williamr@4
|
14 |
* Description:
|
williamr@4
|
15 |
*
|
williamr@4
|
16 |
*/
|
williamr@4
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef __FRMTVIEW_H__
|
williamr@2
|
20 |
#define __FRMTVIEW_H__
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <e32std.h>
|
williamr@2
|
23 |
#include <e32base.h>
|
williamr@2
|
24 |
#include <w32std.h>
|
williamr@2
|
25 |
#include <frmtlay.h>
|
williamr@2
|
26 |
#include <frmframe.h>
|
williamr@2
|
27 |
|
williamr@2
|
28 |
/**
|
williamr@2
|
29 |
Internal class - not part of interface
|
williamr@2
|
30 |
@internalComponent
|
williamr@2
|
31 |
*/
|
williamr@2
|
32 |
class RScreenDisplay
|
williamr@2
|
33 |
|
williamr@2
|
34 |
{
|
williamr@2
|
35 |
public:
|
williamr@2
|
36 |
enum TClippingRects
|
williamr@2
|
37 |
{
|
williamr@2
|
38 |
EFClipTextArea = 0x0001,
|
williamr@2
|
39 |
EFClipLineCursor = 0x0002,
|
williamr@2
|
40 |
EFClipExtendedTextArea = 0x0004,
|
williamr@2
|
41 |
EFClipViewRect = 0x0008,
|
williamr@2
|
42 |
EFClipExtendedViewRect = 0x0010,
|
williamr@2
|
43 |
EFClipInvalid = 0x0200,
|
williamr@2
|
44 |
EFClipAllFlags = 0xFFFF
|
williamr@2
|
45 |
};
|
williamr@2
|
46 |
public:
|
williamr@2
|
47 |
RScreenDisplay(TDrawTextLayoutContext* const aDrawTextLayoutContext);
|
williamr@2
|
48 |
void Close();
|
williamr@2
|
49 |
void Destroy();
|
williamr@2
|
50 |
void SetWindowsServer(RWsSession *aSession) { iSession = aSession; }
|
williamr@2
|
51 |
void SetWindowGroup(RWindowGroup *aWin) { iGroupWin = aWin; }
|
williamr@2
|
52 |
|
williamr@2
|
53 |
void SetWindow(RWindow *aWin);
|
williamr@2
|
54 |
RWindow* Window() const { return iWin; }
|
williamr@2
|
55 |
void SetBitmapContext(CBitmapContext* aGc) { iGc = aGc; }
|
williamr@2
|
56 |
CBitmapContext* BitmapContext() const { return iGc; }
|
williamr@2
|
57 |
RWsSession* WindowServerSession() { return iSession; }
|
williamr@2
|
58 |
void SetGraphicsDeviceL(CBitmapDevice *aGd);
|
williamr@2
|
59 |
CBitmapDevice* BitmapDevice() const {return iGd; }
|
williamr@2
|
60 |
void CreateContextL(CBitmapDevice *aGd);
|
williamr@2
|
61 |
void CreateContextL();
|
williamr@2
|
62 |
void SetInvalidRect(const TRect& aRect);
|
williamr@2
|
63 |
void SetInvalidRect(TInt aHeight);
|
williamr@2
|
64 |
void SetInvalidRectHorizontal(TInt aWidth);
|
williamr@2
|
65 |
void SetRects(TUint aRects);
|
williamr@2
|
66 |
TRect LineCursorMargin() const;
|
williamr@2
|
67 |
TPoint TopLeftTextArea() const;
|
williamr@2
|
68 |
TBool IsLineCursor() const;
|
williamr@2
|
69 |
|
williamr@2
|
70 |
void AddRects(TUint aRects);
|
williamr@2
|
71 |
void SubRects(TUint aRects);
|
williamr@2
|
72 |
TRect ClippingRect();
|
williamr@2
|
73 |
void ResetClippingRect();
|
williamr@2
|
74 |
void Scroll(TRect aRect,const TPoint& aBy,TBool aScrollBackground);
|
williamr@2
|
75 |
void Flush();
|
williamr@2
|
76 |
void ClearRect(const TRect& aRect);
|
williamr@2
|
77 |
void InvertRect(TRect aRect,const TRgb aInvertColor);
|
williamr@2
|
78 |
void SetTextCursor(TPoint aPos, const TTextCursor &aCursor);
|
williamr@2
|
79 |
void RemoveTextCursor();
|
williamr@2
|
80 |
void BlastBitmap(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aRect);
|
williamr@2
|
81 |
void DrawPictureFrame(TFrameOverlay* aPictureFrame,const TRect& aLineRect);
|
williamr@2
|
82 |
void Invalidate(TRect aRect);
|
williamr@2
|
83 |
void ActivateContext();
|
williamr@2
|
84 |
void ActivateContext(CGraphicsContext *aGc);
|
williamr@2
|
85 |
void DeactivateContext();
|
williamr@2
|
86 |
void DeactivateContext(CGraphicsContext *aGc);
|
williamr@2
|
87 |
void SetLayout(CTextLayout* aLayout);
|
williamr@2
|
88 |
CTextLayout* Layout();
|
williamr@2
|
89 |
TBool UseWindowGc() const;
|
williamr@2
|
90 |
|
williamr@2
|
91 |
private:
|
williamr@2
|
92 |
void DestroyContexts();
|
williamr@2
|
93 |
private:
|
williamr@2
|
94 |
RWsSession *iSession;
|
williamr@2
|
95 |
RWindowGroup *iGroupWin;
|
williamr@2
|
96 |
RWindow *iWin;
|
williamr@2
|
97 |
CBitmapContext *iGc;
|
williamr@2
|
98 |
CBitmapDevice *iGd;
|
williamr@2
|
99 |
TDrawTextLayoutContext* const iDrawTextLayoutContext;
|
williamr@2
|
100 |
TUint iRects;
|
williamr@2
|
101 |
TRect iInvalidRect;
|
williamr@2
|
102 |
TLogicalRgb iBackground;
|
williamr@2
|
103 |
CTextLayout* iTextLayout;
|
williamr@2
|
104 |
};
|
williamr@2
|
105 |
|
williamr@2
|
106 |
/** Visibility of line and text cursor.
|
williamr@2
|
107 |
|
williamr@2
|
108 |
The TVisibility enumeration defined in this class is used in calls to CTextView::SetCursorVisibilityL().
|
williamr@2
|
109 |
The remainder of this class does not form part of the API.
|
williamr@2
|
110 |
@internalComponent
|
williamr@2
|
111 |
*/
|
williamr@2
|
112 |
class TCursor
|
williamr@2
|
113 |
{
|
williamr@2
|
114 |
public:
|
williamr@2
|
115 |
enum TCursors
|
williamr@2
|
116 |
{
|
williamr@2
|
117 |
EFNeitherCursor = 0,
|
williamr@2
|
118 |
EFTextCursor = 1,
|
williamr@2
|
119 |
EFLineCursor = 2,
|
williamr@2
|
120 |
EFBothCursors = EFTextCursor | EFLineCursor
|
williamr@2
|
121 |
};
|
williamr@2
|
122 |
|
williamr@2
|
123 |
/** Cursor visibility */
|
williamr@2
|
124 |
enum TVisibility
|
williamr@2
|
125 |
{
|
williamr@2
|
126 |
/** Indicates that the cursor should be invisible. */
|
williamr@2
|
127 |
EFCursorInvisible = 0,
|
williamr@2
|
128 |
/** Indicates that the cursor should be visible. */
|
williamr@2
|
129 |
EFCursorVisible,
|
williamr@2
|
130 |
/** Indicates a flashing text cursor. When specified for the line
|
williamr@2
|
131 |
cursor, is equivalent to EFCursorVisible, as the line cursor cannot
|
williamr@2
|
132 |
flash. Note that a non-flashing text cursor should only be used when
|
williamr@2
|
133 |
there is to be no editing, reformatting, scrolling or cursor movement.
|
williamr@2
|
134 |
*/
|
williamr@2
|
135 |
EFCursorFlashing
|
williamr@2
|
136 |
};
|
williamr@2
|
137 |
|
williamr@2
|
138 |
TCursor(TCursorPosition& aCursorPos,RScreenDisplay& aDisplay);
|
williamr@2
|
139 |
void SetLineCursorBitmap(const CFbsBitmap* aLineCursorBitmap);
|
williamr@2
|
140 |
inline TUint LineCursorVisibility();
|
williamr@2
|
141 |
inline TUint TextCursorVisibility();
|
williamr@2
|
142 |
void Draw(TUint aCursors);
|
williamr@2
|
143 |
|
williamr@2
|
144 |
void SetVisibility(TVisibility aLineCursor,TVisibility aTextCursor);
|
williamr@2
|
145 |
void SetType(TTextCursor::EType aType);
|
williamr@2
|
146 |
void SetPlacement(TTmCursorPlacement aPlacement);
|
williamr@2
|
147 |
void SetAscentAndDescent(TInt aAscent,TInt aDescent);
|
williamr@2
|
148 |
void SetWeight(TInt aWeight);
|
williamr@2
|
149 |
void SetFlash(TBool aEnabled);
|
williamr@2
|
150 |
void SetXorColor(TRgb aColor);
|
williamr@2
|
151 |
void MatchCursorHeightToAdjacentChar();
|
williamr@2
|
152 |
void SetExtensions(TInt aFirstExtension, TInt aSecondExtension);
|
williamr@2
|
153 |
private:
|
williamr@2
|
154 |
enum
|
williamr@2
|
155 |
{
|
williamr@2
|
156 |
ELineCursorToLabelGap = 2,
|
williamr@2
|
157 |
ETextCursorWeight = 3,
|
williamr@2
|
158 |
ETextCursorInvertColor = 0xFFFFFF
|
williamr@2
|
159 |
};
|
williamr@2
|
160 |
|
williamr@2
|
161 |
void DrawLineCursor(TInt aHeight);
|
williamr@2
|
162 |
void RemoveLineCursor();
|
williamr@2
|
163 |
void DrawTextCursor(TPoint aOrigin,TInt aWidth,TInt aAscent,TInt aDescent);
|
williamr@2
|
164 |
void RemoveTextCursor();
|
williamr@2
|
165 |
|
williamr@2
|
166 |
RScreenDisplay& iDisplay; // a reference to the object controlling drawing
|
williamr@2
|
167 |
TCursorPosition& iCursorPos; // a reference to the object holding the cursor's document position
|
williamr@2
|
168 |
TBool iVisible; // TRUE if the text cursor is currently visible in the displayed text
|
williamr@2
|
169 |
TBool iFlash; // TRUE if the text cursor should flash
|
williamr@2
|
170 |
TVisibility iLineCursor; // line cursor state
|
williamr@2
|
171 |
TVisibility iTextCursor; // text cursor state
|
williamr@2
|
172 |
const CFbsBitmap* iLineCursorBitmap; // if non-null, points to a non-owned bitmap representing the line cursor
|
williamr@2
|
173 |
TInt iAscent; // if non-negative, ascent used for vertical cursors
|
williamr@2
|
174 |
TInt iDescent; // if non-negative, descent used for vertical cursors
|
williamr@2
|
175 |
TInt iWeight; // width of vertical cursors, height of horizontal ones
|
williamr@2
|
176 |
TTextCursor::EType iType; // filled or hollow rectangle, etc.
|
williamr@2
|
177 |
TRgb iXorColor; // colour XORed with the background when the cursor is drawn
|
williamr@2
|
178 |
TTmCursorPlacement iPlacement; // vertical, underline, etc.
|
williamr@2
|
179 |
TInt iFirstExtension; // customise the cursor, extends vertical cursors upwards, horizontal cursors leftwards
|
williamr@2
|
180 |
TInt iSecondExtension; // customise the cursor, extends vertical cursors downwards, horizontal cursors rightwards
|
williamr@2
|
181 |
TInt iReserved[2];
|
williamr@2
|
182 |
};
|
williamr@2
|
183 |
|
williamr@2
|
184 |
/**
|
williamr@2
|
185 |
Lays out formatted text for display.
|
williamr@2
|
186 |
|
williamr@2
|
187 |
The class provides functions to:
|
williamr@2
|
188 |
|
williamr@2
|
189 |
convert between document positions and x,y coordinates
|
williamr@2
|
190 |
|
williamr@2
|
191 |
set the dimensions of the rectangle in which text can be viewed (the view
|
williamr@2
|
192 |
rectangle)
|
williamr@2
|
193 |
|
williamr@2
|
194 |
set margin widths
|
williamr@2
|
195 |
|
williamr@2
|
196 |
do horizontal and vertical scrolling
|
williamr@2
|
197 |
|
williamr@2
|
198 |
do text selection
|
williamr@2
|
199 |
|
williamr@2
|
200 |
set the cursor position and appearance
|
williamr@2
|
201 |
|
williamr@2
|
202 |
After a change has been made to the text layout, a reformat and redraw should
|
williamr@2
|
203 |
normally take place. CTextView provides functions which are optimised to reformat
|
williamr@2
|
204 |
the minimum amount necessary. For example, when a global formatting parameter
|
williamr@2
|
205 |
is changed (e.g. the wrap width), the whole document's layout needs to be
|
williamr@2
|
206 |
recalculated, so HandleGlobalChangeL() should be called. If the change involves
|
williamr@2
|
207 |
the insertion or deletion of a single character, only a single line may be
|
williamr@2
|
208 |
affected; for this, HandleCharEditL() is appropriate. Most CTextView reformatting
|
williamr@2
|
209 |
functions do scrolling (using block transfer), if necessary, and a redraw.
|
williamr@2
|
210 |
|
williamr@2
|
211 |
For maximum responsiveness, CTextView uses an active object to carry out
|
williamr@2
|
212 |
reformatting as a background task, so that the application can continue to
|
williamr@2
|
213 |
receive user input. Many CTextView functions force background formatting to
|
williamr@2
|
214 |
complete before they take effect.
|
williamr@2
|
215 |
|
williamr@2
|
216 |
When scrolling vertically, positive numbers of pixels, lines, paragraphs,
|
williamr@2
|
217 |
pages, etc., mean that the text moves down, and vice versa. When scrolling
|
williamr@2
|
218 |
horizontally, positive numbers of pixels mean that the text moves left and
|
williamr@2
|
219 |
vice versa.
|
williamr@2
|
220 |
|
williamr@2
|
221 |
A text view can display up to two cursors and up to three margins. The cursors
|
williamr@2
|
222 |
are the text cursor and the line cursor. The purpose of the line cursor is
|
williamr@2
|
223 |
to make it easier to see which line the text cursor (or the selection extension
|
williamr@2
|
224 |
point) is on. The three margins are the label margin (for paragraph labels),
|
williamr@2
|
225 |
the line cursor margin (for the line cursor) and the left text margin (the
|
williamr@2
|
226 |
gap between the edge of the page and the text). All are optional, but if present,
|
williamr@2
|
227 |
they appear in that order, starting at the left edge of the view rectangle.
|
williamr@2
|
228 |
|
williamr@2
|
229 |
An object of class CTextLayout is used by the text view to calculate changes
|
williamr@2
|
230 |
to the layout. This object must be specified when constructing the text view.
|
williamr@2
|
231 |
It is also used to set layout attributes, including the wrap width, the height
|
williamr@2
|
232 |
of the visible portion of the document (the "band"), whether formatting is
|
williamr@2
|
233 |
set to the band or to the whole document and the text object which is the
|
williamr@2
|
234 |
source of the text and formatting information.
|
williamr@2
|
235 |
|
williamr@2
|
236 |
The x-y pixel coordinates used by CTextView are called window coordinates.
|
williamr@2
|
237 |
Window coordinates have their origin at the top left corner of the view window
|
williamr@2
|
238 |
(unlike class CTextLayout whose coordinates have their origin at the top left
|
williamr@2
|
239 |
corner of the area within the view rectangle in which text can appear). As
|
williamr@2
|
240 |
in most bitmap graphics systems, x coordinates increase rightwards and y coordinates
|
williamr@2
|
241 |
increase downwards.
|
williamr@2
|
242 |
@publishedAll
|
williamr@2
|
243 |
@released
|
williamr@2
|
244 |
*/
|
williamr@2
|
245 |
class CTextView : public CBase
|
williamr@2
|
246 |
|
williamr@2
|
247 |
{
|
williamr@2
|
248 |
friend class CTestTextView;
|
williamr@2
|
249 |
public:
|
williamr@2
|
250 |
enum TPriorities
|
williamr@2
|
251 |
{
|
williamr@2
|
252 |
EFBackgroundFormattingPriority = (CActive::EPriorityIdle + CActive::EPriorityLow) / 2
|
williamr@2
|
253 |
};
|
williamr@2
|
254 |
|
williamr@2
|
255 |
/** deprecated 8.0 */
|
williamr@2
|
256 |
enum
|
williamr@2
|
257 |
{
|
williamr@2
|
258 |
EFFirstCharOnLine = -1000000,
|
williamr@2
|
259 |
EFLastCharOnLine = 1000000
|
williamr@2
|
260 |
};
|
williamr@2
|
261 |
|
williamr@2
|
262 |
/** Cursor height matching.
|
williamr@2
|
263 |
|
williamr@2
|
264 |
Passed as an argument to MatchCursorHeightToAdjacentChar(). */
|
williamr@2
|
265 |
enum TBeforeAfter
|
williamr@2
|
266 |
{
|
williamr@2
|
267 |
/** Text cursor height is matched to preceding character. */
|
williamr@2
|
268 |
EFCharacterBefore = ETrue,
|
williamr@2
|
269 |
/** Text cursor height is matched to following character. */
|
williamr@2
|
270 |
EFCharacterAfter = EFalse
|
williamr@2
|
271 |
};
|
williamr@2
|
272 |
|
williamr@2
|
273 |
|
williamr@2
|
274 |
|
williamr@2
|
275 |
/** Whether to reformat and redraw. Argument to SetViewL(). */
|
williamr@2
|
276 |
enum TDiscard
|
williamr@2
|
277 |
{
|
williamr@2
|
278 |
/** Discard all formatting; redraw. */
|
williamr@2
|
279 |
EFViewDiscardAllFormat,
|
williamr@2
|
280 |
/** Do not discard all formatting; redraw. */
|
williamr@2
|
281 |
EFViewDontDiscardFormat,
|
williamr@2
|
282 |
/** Discard all formatting; no redraw. */
|
williamr@2
|
283 |
EFViewDiscardAllNoRedraw,
|
williamr@2
|
284 |
/** Do not discard all formatting; redraw. */
|
williamr@2
|
285 |
EFViewDontDiscardFullRedraw
|
williamr@2
|
286 |
};
|
williamr@2
|
287 |
|
williamr@2
|
288 |
/**
|
williamr@2
|
289 |
Provides notification to the owner of the text view object of changes to the
|
williamr@2
|
290 |
formatting.
|
williamr@2
|
291 |
|
williamr@2
|
292 |
Its OnReformatL() function is called after reformatting but before redisplay,
|
williamr@2
|
293 |
so that edit windows etc. can be resized.
|
williamr@2
|
294 |
@publishedAll
|
williamr@2
|
295 |
@released
|
williamr@2
|
296 |
*/
|
williamr@2
|
297 |
class MObserver
|
williamr@2
|
298 |
|
williamr@2
|
299 |
{
|
williamr@2
|
300 |
public:
|
williamr@2
|
301 |
|
williamr@4
|
302 |
/** Called after reformatting but before redisplay, so that the height of edit windows, etc.,
|
williamr@4
|
303 |
can be adjusted. There is no need to adjust the width of displaying components as formatting
|
williamr@4
|
304 |
is always done to fit the specified width.
|
williamr@4
|
305 |
Implementers are not allowed to call any formatting functions while handling reformatting
|
williamr@4
|
306 |
notifications as it may cause recursive loops leading to unexpected consequences.
|
williamr@2
|
307 |
@param aTextView A pointer to the current text view object. */
|
williamr@2
|
308 |
virtual void OnReformatL(const CTextView* aTextView) = 0;
|
williamr@2
|
309 |
};
|
williamr@2
|
310 |
|
williamr@2
|
311 |
// argument to SetViewL
|
williamr@2
|
312 |
enum TDoHorizontalScroll
|
williamr@2
|
313 |
{
|
williamr@2
|
314 |
EFNoHorizontalScroll = EFalse,
|
williamr@2
|
315 |
EFCheckForHorizontalScroll = ETrue
|
williamr@2
|
316 |
};
|
williamr@2
|
317 |
|
williamr@2
|
318 |
|
williamr@2
|
319 |
/**
|
williamr@2
|
320 |
A standard inquiry interface for the text formatting engine, built on
|
williamr@2
|
321 |
top of a CTextView object.
|
williamr@2
|
322 |
|
williamr@2
|
323 |
To use it, construct a TTagmaForwarder object, then call InitL(), which
|
williamr@2
|
324 |
finishes background formatting, then call the MTmTextLayoutForwarder
|
williamr@2
|
325 |
functions.
|
williamr@4
|
326 |
|
williamr@4
|
327 |
The class should only be used internally by FORM component.
|
williamr@2
|
328 |
@publishedAll
|
williamr@2
|
329 |
@released
|
williamr@2
|
330 |
*/
|
williamr@2
|
331 |
class TTagmaForwarder: public MTmTextLayoutForwarder
|
williamr@2
|
332 |
|
williamr@2
|
333 |
{
|
williamr@2
|
334 |
public:
|
williamr@2
|
335 |
inline TTagmaForwarder();
|
williamr@2
|
336 |
inline void InitL(CTextView* aView);
|
williamr@2
|
337 |
|
williamr@2
|
338 |
private:
|
williamr@2
|
339 |
// from MTmTextLayoutForwarder
|
williamr@2
|
340 |
inline const CTmTextLayout& TextLayout() const;
|
williamr@2
|
341 |
inline void GetOrigin(TPoint& aPoint) const;
|
williamr@2
|
342 |
|
williamr@2
|
343 |
CTextView* iView;
|
williamr@2
|
344 |
};
|
williamr@2
|
345 |
|
williamr@2
|
346 |
private:
|
williamr@2
|
347 |
enum TDrawParameters
|
williamr@2
|
348 |
{
|
williamr@2
|
349 |
EFDrawAllWindow = CLayoutData::EFLargeNumber // must be larger than the pixel height of any window.
|
williamr@2
|
350 |
};
|
williamr@2
|
351 |
|
williamr@2
|
352 |
// bit values used in iFlags
|
williamr@2
|
353 |
enum
|
williamr@2
|
354 |
{
|
williamr@2
|
355 |
EFSelectionVisible = 1,
|
williamr@2
|
356 |
EFPictureFrameEnabled = 2,
|
williamr@2
|
357 |
EFEverythingVisible = 3,
|
williamr@2
|
358 |
EFFlickerFreeRedraw = 4,
|
williamr@2
|
359 |
EFTextVisible = 8
|
williamr@2
|
360 |
};
|
williamr@2
|
361 |
|
williamr@2
|
362 |
// horizontal scroll jump in pixels
|
williamr@2
|
363 |
enum THorizontalScrollJump
|
williamr@2
|
364 |
{
|
williamr@2
|
365 |
EFDefaultHorizontalScrollJump = 20
|
williamr@2
|
366 |
#ifdef _DEBUG
|
williamr@2
|
367 |
,EFUnreasonablyLargeHorizontalScrollJump = 10000
|
williamr@2
|
368 |
#endif
|
williamr@2
|
369 |
};
|
williamr@2
|
370 |
|
williamr@2
|
371 |
// picture frame blob widths in pixels
|
williamr@2
|
372 |
enum TPictureFrameBlobWidths
|
williamr@2
|
373 |
{
|
williamr@2
|
374 |
EFFrameVisibleBlobWidth = 10,
|
williamr@2
|
375 |
EFFrameActiveBlobWidth = 20
|
williamr@2
|
376 |
};
|
williamr@2
|
377 |
|
williamr@2
|
378 |
enum THorizontalScroll
|
williamr@2
|
379 |
{
|
williamr@2
|
380 |
EFNoPreviousHorizontalScroll = 0,
|
williamr@2
|
381 |
EFPreviousHorizontalScroll
|
williamr@2
|
382 |
};
|
williamr@2
|
383 |
|
williamr@2
|
384 |
enum TMemoryStatus
|
williamr@2
|
385 |
{
|
williamr@2
|
386 |
EFMemoryOK,
|
williamr@2
|
387 |
EFOutOfMemory,
|
williamr@2
|
388 |
EFRecovering
|
williamr@2
|
389 |
};
|
williamr@2
|
390 |
|
williamr@2
|
391 |
enum TExtendedHighlightRedraw
|
williamr@2
|
392 |
{
|
williamr@2
|
393 |
EFTopEdge = 0x0001,
|
williamr@2
|
394 |
EFBottomEdge = 0x0002
|
williamr@2
|
395 |
};
|
williamr@2
|
396 |
|
williamr@2
|
397 |
|
williamr@2
|
398 |
public:
|
williamr@2
|
399 |
IMPORT_C static CTextView *NewL(CTextLayout* aLayout,const TRect &aDisplay,CBitmapDevice* aGd,
|
williamr@2
|
400 |
MGraphicsDeviceMap* aDeviceMap,RWindow* aWin,RWindowGroup* aGroupWin,
|
williamr@2
|
401 |
RWsSession* aSession);
|
williamr@2
|
402 |
IMPORT_C ~CTextView();
|
williamr@2
|
403 |
IMPORT_C void SetDisplayContextL(CBitmapDevice* aGd,RWindow* aWin,RWindowGroup* aGroupWin,RWsSession* aSession);
|
williamr@2
|
404 |
IMPORT_C void SetLayout(CTextLayout* aLayout);
|
williamr@2
|
405 |
inline const CTextLayout* Layout() const;
|
williamr@2
|
406 |
IMPORT_C void SetViewRect(const TRect& aDisplay);
|
williamr@2
|
407 |
IMPORT_C void AlterViewRect(const TRect &aViewRect);
|
williamr@2
|
408 |
IMPORT_C void SetMarginWidths(TInt aLabels,TInt aLineCursor);
|
williamr@2
|
409 |
IMPORT_C void SetHorizontalScrollJump(TInt aScrollJump);
|
williamr@2
|
410 |
IMPORT_C void SetLineCursorBitmap(const CFbsBitmap* aLineCursorBitmap);
|
williamr@2
|
411 |
IMPORT_C void SetHighlightExtensions(TInt aLeftExtension, TInt aRightExtension, TInt aTopExtension, TInt aBottomExtension);
|
williamr@2
|
412 |
IMPORT_C void SetExcessHeightRequired(TInt aExcessHeightRequired);
|
williamr@2
|
413 |
IMPORT_C void SetBackgroundColor(TRgb aColor);
|
williamr@2
|
414 |
IMPORT_C void SetTextColorOverride(const TRgb* aOverrideColor = NULL);
|
williamr@2
|
415 |
IMPORT_C void SetCursorVisibilityL(TUint aLineCursor,TUint aTextCursor);
|
williamr@2
|
416 |
IMPORT_C void SetSelectionVisibilityL(TBool aSelectionVisible);
|
williamr@2
|
417 |
IMPORT_C TBool SelectionVisible() const;
|
williamr@2
|
418 |
IMPORT_C void EnablePictureFrameL(TBool aEnabled);
|
williamr@2
|
419 |
IMPORT_C const TRect& ViewRect() const;
|
williamr@2
|
420 |
IMPORT_C const TRect& AlteredViewRect() const;
|
williamr@2
|
421 |
IMPORT_C void MarginWidths(TInt& aLabels,TInt& aLineCursor) const;
|
williamr@2
|
422 |
IMPORT_C TInt HorizontalScrollJump() const;
|
williamr@2
|
423 |
IMPORT_C TInt LeftTextMargin() const;
|
williamr@2
|
424 |
IMPORT_C void SetLatentXPosition(TInt aLatentX);
|
williamr@2
|
425 |
// deprecated 7.0
|
williamr@2
|
426 |
IMPORT_C void SetParagraphFillTextOnly(TBool aFillTextOnly);
|
williamr@2
|
427 |
IMPORT_C void SetCursorWidthTypeL(TTextCursor::EType aType,TInt aWidth = 0);
|
williamr@2
|
428 |
IMPORT_C void SetCursorPlacement(TTmCursorPlacement aPlacement);
|
williamr@2
|
429 |
IMPORT_C void SetCursorWeight(TInt aWeight);
|
williamr@2
|
430 |
IMPORT_C void SetCursorFlash(TBool aEnabled);
|
williamr@2
|
431 |
IMPORT_C void SetCursorXorColor(TRgb aColor);
|
williamr@2
|
432 |
IMPORT_C void SetCursorExtensions(TInt aFirstExtension, TInt aSecondExtension);
|
williamr@2
|
433 |
IMPORT_C TCursorSelection Selection() const;
|
williamr@2
|
434 |
IMPORT_C TBool IsPictureFrameSelected(TRect& aPictureFrameRect,TInt& aDocPos) const;
|
williamr@2
|
435 |
IMPORT_C TBool GetPictureRectangleL(TInt aDocPos,TRect& aPictureRect,TBool* aCanScaleOrCrop = NULL) const;
|
williamr@2
|
436 |
IMPORT_C TBool GetPictureRectangleL(TPoint aXyPos,TRect& aPictureRect,TBool* aCanScaleOrCrop = NULL);
|
williamr@2
|
437 |
IMPORT_C TBool FindXyPosL(const TPoint& aXyPos,TTmPosInfo2& aPosInfo,TTmLineInfo* aLineInfo = NULL);
|
williamr@2
|
438 |
IMPORT_C TInt XyPosToDocPosL(TPoint& aPoint);
|
williamr@2
|
439 |
IMPORT_C TBool FindDocPosL(const TTmDocPosSpec& aDocPos,TTmPosInfo2& aPosInfo,TTmLineInfo* aLineInfo = NULL);
|
williamr@2
|
440 |
IMPORT_C TBool DocPosToXyPosL(TInt aDocPos,TPoint& aPoint);
|
williamr@2
|
441 |
IMPORT_C TRect ParagraphRectL(TInt aDocPos) const;
|
williamr@2
|
442 |
IMPORT_C void CalculateHorizontalExtremesL(TInt& aLeftX,TInt& aRightX,TBool aOnlyVisibleLines);
|
williamr@2
|
443 |
IMPORT_C void MatchCursorHeightL(const TFontSpec& aFontSpec);
|
williamr@2
|
444 |
IMPORT_C void MatchCursorHeightToAdjacentChar(TBeforeAfter aBasedOn = EFCharacterBefore);
|
williamr@2
|
445 |
IMPORT_C TPoint SetSelectionL(const TCursorSelection& aSelection);
|
williamr@2
|
446 |
IMPORT_C void CancelSelectionL();
|
williamr@2
|
447 |
IMPORT_C void ClearSelectionL();
|
williamr@2
|
448 |
IMPORT_C TPoint SetDocPosL(const TTmDocPosSpec& aDocPos,TBool aDragSelectOn = EFalse);
|
williamr@2
|
449 |
IMPORT_C TPoint SetDocPosL(TInt aDocPos,TBool aDragSelectOn = EFalse);
|
williamr@2
|
450 |
IMPORT_C TPoint SetXyPosL(TPoint aPos,TBool aDragSelectOn,TRect*& aPictureRect,TInt& aPictureFrameEdges);
|
williamr@2
|
451 |
IMPORT_C TPoint MoveCursorL(TCursorPosition::TMovementType& aMovement,TBool aDragSelectOn);
|
williamr@2
|
452 |
IMPORT_C TInt ScrollDisplayL(TCursorPosition::TMovementType aMovement,
|
williamr@2
|
453 |
CTextLayout::TAllowDisallow aScrollBlankSpace=CTextLayout::EFDisallowScrollingBlankSpace);
|
williamr@2
|
454 |
IMPORT_C TPoint SetViewLineAtTopL(TInt aLineNo);
|
williamr@4
|
455 |
IMPORT_C void ScrollDisplayPixelsL(TInt& aDeltaY);
|
williamr@4
|
456 |
IMPORT_C void ScrollDisplayPixelsNoLimitBorderL(TInt aDeltaY);
|
williamr@2
|
457 |
IMPORT_C TInt ScrollDisplayLinesL(TInt& aDeltaLines,
|
williamr@2
|
458 |
CTextLayout::TAllowDisallow aScrollBlankSpace = CTextLayout::EFDisallowScrollingBlankSpace);
|
williamr@2
|
459 |
IMPORT_C TInt ScrollDisplayParagraphsL(TInt& aDeltaParas,
|
williamr@2
|
460 |
CTextLayout::TAllowDisallow aScrollBlankSpace = CTextLayout::EFDisallowScrollingBlankSpace);
|
williamr@2
|
461 |
IMPORT_C TPoint SetViewL(TInt aDocPos,TInt& aYPos,TViewYPosQualifier aYPosQualifier = TViewYPosQualifier(),
|
williamr@2
|
462 |
TDiscard aDiscardFormat = EFViewDontDiscardFormat,
|
williamr@2
|
463 |
TDoHorizontalScroll aDoHorizontalScroll = EFCheckForHorizontalScroll);
|
williamr@2
|
464 |
IMPORT_C void SetLeftTextMargin(TInt aLeftMargin);
|
williamr@2
|
465 |
IMPORT_C void DrawL(TRect aRect);
|
williamr@2
|
466 |
IMPORT_C void DrawL(TRect aRect,CBitmapContext& aGc);
|
williamr@2
|
467 |
inline void SetObserver(MObserver* aObserver);
|
williamr@2
|
468 |
IMPORT_C void SetPendingSelection(const TCursorSelection& aSelection);
|
williamr@2
|
469 |
inline void EnableFlickerFreeRedraw();
|
williamr@2
|
470 |
inline void DisableFlickerFreeRedraw();
|
williamr@2
|
471 |
inline TBool FlickerFreeRedraw() const;
|
williamr@2
|
472 |
inline void GetOrigin(TPoint& aPoint) const;
|
williamr@2
|
473 |
IMPORT_C TCursorSelection GetForwardDeletePositionL();
|
williamr@2
|
474 |
IMPORT_C TCursorSelection GetBackwardDeletePositionL();
|
williamr@2
|
475 |
|
williamr@2
|
476 |
// reformatting after changes to the content
|
williamr@2
|
477 |
IMPORT_C void FormatTextL();
|
williamr@2
|
478 |
IMPORT_C TInt HandleCharEditL(TUint aType = CTextLayout::EFCharacterInsert,TBool aFormatChanged = EFalse);
|
williamr@2
|
479 |
IMPORT_C TPoint HandleRangeFormatChangeL(TCursorSelection aSelection,TBool aFormatChanged = EFalse);
|
williamr@2
|
480 |
IMPORT_C TPoint HandleInsertDeleteL(TCursorSelection aSelection,TInt aDeletedChars,TBool aFormatChanged = EFalse);
|
williamr@2
|
481 |
IMPORT_C void HandleGlobalChangeL(TViewYPosQualifier aYPosQualifier = TViewYPosQualifier());
|
williamr@2
|
482 |
IMPORT_C void HandleGlobalChangeNoRedrawL(TViewYPosQualifier aYPosQualifier = TViewYPosQualifier());
|
williamr@2
|
483 |
IMPORT_C void HandleAdditionalCharactersAtEndL();
|
williamr@2
|
484 |
IMPORT_C void FinishBackgroundFormattingL();
|
williamr@2
|
485 |
|
williamr@2
|
486 |
IMPORT_C CBitmapContext* BitmapContext();
|
williamr@2
|
487 |
IMPORT_C const TTmDocPos& VisualEndOfRunL(
|
williamr@2
|
488 |
const TTmDocPos& aStart, const TTmDocPos& aEnd,
|
williamr@2
|
489 |
TCursorPosition::TVisualEnd aDirection);
|
williamr@2
|
490 |
IMPORT_C void GetCursorPos(TTmDocPos& aPos) const;
|
williamr@2
|
491 |
|
williamr@2
|
492 |
IMPORT_C TPoint SetDocPosL(const TTmDocPos& aDocPos,TBool aDragSelectOn = EFalse);
|
williamr@2
|
493 |
|
williamr@2
|
494 |
IMPORT_C void SetCursorPositioningHintL(TCursorPosition::TPosHint aHint);
|
williamr@2
|
495 |
|
williamr@2
|
496 |
IMPORT_C void SetOpaque(TBool aDrawOpaque);
|
williamr@2
|
497 |
IMPORT_C void MakeVisible(TBool aVisible);
|
williamr@2
|
498 |
|
williamr@2
|
499 |
private:
|
williamr@2
|
500 |
IMPORT_C static TInt IdleL(TAny *aSelf);
|
williamr@2
|
501 |
IMPORT_C CTextView();
|
williamr@2
|
502 |
IMPORT_C void ConstructL(CTextLayout* aLayout,const TRect &aDisplay,CBitmapDevice* aGd,MGraphicsDeviceMap* aDeviceMap,
|
williamr@2
|
503 |
RWindow* aWin,RWindowGroup* aGroupWin,RWsSession* aSession);
|
williamr@2
|
504 |
inline TInt TopViewRect() const;
|
williamr@2
|
505 |
inline TBool IsFormatting() const;
|
williamr@2
|
506 |
TBool NoMemoryCheckL();
|
williamr@2
|
507 |
void StartIdleObject();
|
williamr@2
|
508 |
inline void DrawWithPreviousHighlight();
|
williamr@2
|
509 |
inline void DrawWithCurrentHighlight();
|
williamr@2
|
510 |
TInt CalculateBaseLinePos(TTmDocPos& aDocPos);
|
williamr@2
|
511 |
TInt DrawAfterCursorMoveL(TInt aVerticalScrollBy);
|
williamr@2
|
512 |
TBool NextLineL();
|
williamr@2
|
513 |
void ClearRectAtBottom(TInt aHeight);
|
williamr@2
|
514 |
void DrawTextL(TInt aFromHeight = 0,TInt aToHeight = EFDrawAllWindow);
|
williamr@2
|
515 |
void DisplayNewLinesL(TInt aFrom,TInt aTo);
|
williamr@2
|
516 |
void DrawCursor(TUint aCursors = TCursor::EFBothCursors);
|
williamr@2
|
517 |
TPoint DoMoveCursorL(TBool aDragSelectOn,TCursorPosition::TMovementType& aMovement,TBool aAllowPictureFrame);
|
williamr@2
|
518 |
void ScrollTextL(TInt aScrollY,TInt aFrom,TInt aScrollX,TBool aScrollBackground);
|
williamr@2
|
519 |
void ScrollRect(TRect& aRect,TInt aScrollY,TInt aFrom,TInt aScrollX,TBool aScrollBackground);
|
williamr@2
|
520 |
void ScrollRect(TInt aScrollY,TInt& aFrom,TInt& aTo);
|
williamr@2
|
521 |
TPoint HandleBlockChangeL(TCursorSelection aSelection,TInt aOldCharsChanged,TBool aFormatChanged);
|
williamr@2
|
522 |
void CheckScrollUpL();
|
williamr@2
|
523 |
TInt CheckHorizontalScroll(const TTmDocPos& aDocPos);
|
williamr@2
|
524 |
TInt DoHorizontalScrollDisplayL(TCursorPosition::TMovementType aMovement,
|
williamr@2
|
525 |
CTextLayout::TAllowDisallow aScrollBlankSpace);
|
williamr@2
|
526 |
TInt DoScrollDisplayL(TCursorPosition::TMovementType aMovement,CTextLayout::TAllowDisallow aScrollBlankSpace);
|
williamr@2
|
527 |
void ScrollDisplayL();
|
williamr@2
|
528 |
TPoint ViewTopOfLineL(const TTmDocPos& aDocPos,TInt& aYPos,
|
williamr@2
|
529 |
CTextView::TDiscard aDiscardFormat = EFViewDontDiscardFormat,
|
williamr@2
|
530 |
TDoHorizontalScroll aHorizontalScroll = EFCheckForHorizontalScroll);
|
williamr@2
|
531 |
TPoint ViewL(const TTmDocPos& aDocPos,TInt& aYPos,TViewYPosQualifier aYPosQualifier = TViewYPosQualifier(),
|
williamr@2
|
532 |
CTextView::TDiscard aDiscardFormat = EFViewDontDiscardFormat,
|
williamr@2
|
533 |
TDoHorizontalScroll aHorizontalScroll = EFCheckForHorizontalScroll);
|
williamr@2
|
534 |
TPoint DoHandleGlobalChangeL(TViewYPosQualifier aYPosQualifier,CTextView::TDiscard aDiscard);
|
williamr@2
|
535 |
void UpdateHighlightL();
|
williamr@2
|
536 |
void HighlightUsingExtensions(CTextLayout::TRangeChange aOptimizedRange, CTextLayout::TRangeChange aOriginalRange);
|
williamr@2
|
537 |
void UpdatePictureFrameL();
|
williamr@2
|
538 |
void RedrawPictureFrameRectL(TInt aPos);
|
williamr@2
|
539 |
void DrawPictureFrameL(TRect& aClipRect);
|
williamr@2
|
540 |
void DestroyWindowServerObjects();
|
williamr@2
|
541 |
void NoMemoryL(TInt aErr);
|
williamr@2
|
542 |
void RecoverNoMemoryL();
|
williamr@2
|
543 |
void RecreateWindowServerObjectsL();
|
williamr@2
|
544 |
void DrawTextSupportL(const TRect& aRect,const TCursorSelection* aHighlight);
|
williamr@2
|
545 |
void DoDrawTextSupportL(const TRect& aRect,const TCursorSelection* aHighlight);
|
williamr@2
|
546 |
void DoDrawTextSupportOpaqueL(const TRect& aRect,const TCursorSelection* aHighlight);
|
williamr@2
|
547 |
void DisplayLineRangeL(TInt aFrom,TInt aTo);
|
williamr@2
|
548 |
inline void NotifyReformatL();
|
williamr@2
|
549 |
void CalculateHorizontalExtremes(TInt& aLeftX,TInt& aRightX,TBool aOnlyVisibleLines);
|
williamr@2
|
550 |
TBool ExtendedHighlightExists() const;
|
williamr@2
|
551 |
void DoClearSelectionL(const TCursorSelection& aSelection, TBool aIsPictureFrame);
|
williamr@2
|
552 |
void AdjustRectForScrolling(TRect &aRect, TInt aScrollY, TInt aScrollX) const;
|
williamr@2
|
553 |
static void ResetOffScreenBitmapContext(TAny* aTextView);
|
williamr@2
|
554 |
static void ResetExternalDraw(TAny* aTextView);
|
williamr@2
|
555 |
|
williamr@2
|
556 |
private:
|
williamr@2
|
557 |
CIdle* iWrap;
|
williamr@2
|
558 |
RScreenDisplay iDisplay;
|
williamr@2
|
559 |
CTextLayout* iLayout; // must not be moved
|
williamr@2
|
560 |
TDrawTextLayoutContext iDrawTextLayoutContext; // must not be moved
|
williamr@2
|
561 |
TCursor iCursor;
|
williamr@2
|
562 |
TCursorPosition iCursorPos; // must not be moved
|
williamr@2
|
563 |
TFrameOverlay* iPictureFrame;
|
williamr@2
|
564 |
TMemoryStatus iNoMemory;
|
williamr@2
|
565 |
TUint iFlags; // must not be moved
|
williamr@2
|
566 |
TUint iHorizontalScroll;
|
williamr@2
|
567 |
TInt iGood;
|
williamr@2
|
568 |
TInt iFormattedUpTo;
|
williamr@2
|
569 |
TInt iHorizontalScrollJump;
|
williamr@2
|
570 |
TInt iHeightNotDrawn;
|
williamr@2
|
571 |
MObserver* iObserver; // must not be moved
|
williamr@4
|
572 |
CBitmapContext* iOffScreenContext; //Explicit off-screen bitmap to draw to.
|
williamr@2
|
573 |
TRect iReducedDrawingAreaRect;
|
williamr@2
|
574 |
TUint iDummy;// was iRedrawExtendedHighlight;
|
williamr@2
|
575 |
TBool iContextIsNavigation;
|
williamr@2
|
576 |
TBool iDrawOpaque;
|
williamr@2
|
577 |
};
|
williamr@2
|
578 |
|
williamr@2
|
579 |
inline TUint TCursor::LineCursorVisibility()
|
williamr@2
|
580 |
{
|
williamr@2
|
581 |
return iLineCursor;
|
williamr@2
|
582 |
}
|
williamr@2
|
583 |
|
williamr@2
|
584 |
inline TUint TCursor::TextCursorVisibility()
|
williamr@2
|
585 |
{
|
williamr@2
|
586 |
return iTextCursor;
|
williamr@2
|
587 |
}
|
williamr@2
|
588 |
|
williamr@2
|
589 |
/** Returns a pointer to the text layout object used by the text view.
|
williamr@2
|
590 |
@return A pointer to the text layout object used by the text view. */
|
williamr@2
|
591 |
inline const CTextLayout* CTextView::Layout() const
|
williamr@2
|
592 |
{
|
williamr@2
|
593 |
return iLayout;
|
williamr@2
|
594 |
}
|
williamr@2
|
595 |
|
williamr@2
|
596 |
/** Sets a text view observer. This provides notification to the owner of the
|
williamr@2
|
597 |
text view object of changes to the formatting. Its OnReformatL() function is
|
williamr@2
|
598 |
called after reformatting but before redisplay, so that edit windows etc. can
|
williamr@2
|
599 |
be resized.
|
williamr@2
|
600 |
|
williamr@2
|
601 |
@param aObserver Pointer to text view observer object. */
|
williamr@2
|
602 |
inline void CTextView::SetObserver(MObserver* aObserver)
|
williamr@2
|
603 |
{
|
williamr@2
|
604 |
iObserver = aObserver;
|
williamr@2
|
605 |
}
|
williamr@2
|
606 |
|
williamr@2
|
607 |
inline void CTextView::EnableFlickerFreeRedraw()
|
williamr@2
|
608 |
{
|
williamr@2
|
609 |
iFlags |= EFFlickerFreeRedraw;
|
williamr@2
|
610 |
}
|
williamr@2
|
611 |
|
williamr@2
|
612 |
inline void CTextView::DisableFlickerFreeRedraw()
|
williamr@2
|
613 |
{
|
williamr@2
|
614 |
iFlags &= ~EFFlickerFreeRedraw;
|
williamr@2
|
615 |
}
|
williamr@2
|
616 |
|
williamr@2
|
617 |
inline TBool CTextView::FlickerFreeRedraw() const
|
williamr@2
|
618 |
{
|
williamr@2
|
619 |
return iFlags & EFFlickerFreeRedraw;
|
williamr@2
|
620 |
}
|
williamr@2
|
621 |
|
williamr@2
|
622 |
inline void CTextView::NotifyReformatL()
|
williamr@2
|
623 |
{
|
williamr@2
|
624 |
if (iObserver)
|
williamr@2
|
625 |
iObserver->OnReformatL(this);
|
williamr@2
|
626 |
}
|
williamr@2
|
627 |
|
williamr@2
|
628 |
inline TBool CTextView::IsFormatting() const
|
williamr@2
|
629 |
{
|
williamr@2
|
630 |
return iLayout->IsBackgroundFormatting();
|
williamr@2
|
631 |
}
|
williamr@2
|
632 |
|
williamr@2
|
633 |
inline TInt CTextView::TopViewRect() const
|
williamr@2
|
634 |
{
|
williamr@2
|
635 |
return iDrawTextLayoutContext.iViewRect.iTl.iY;
|
williamr@2
|
636 |
}
|
williamr@2
|
637 |
|
williamr@2
|
638 |
inline void CTextView::DrawWithPreviousHighlight()
|
williamr@2
|
639 |
{
|
williamr@2
|
640 |
iCursorPos.SetToPreviousHighlight();
|
williamr@2
|
641 |
}
|
williamr@2
|
642 |
|
williamr@2
|
643 |
inline void CTextView::DrawWithCurrentHighlight()
|
williamr@2
|
644 |
{
|
williamr@2
|
645 |
iCursorPos.SetToCurrentHighlight();
|
williamr@2
|
646 |
}
|
williamr@2
|
647 |
|
williamr@2
|
648 |
/** Gets the origin of the cursor.
|
williamr@2
|
649 |
@param aPoint On return, the cursor origin. */
|
williamr@2
|
650 |
inline void CTextView::GetOrigin(TPoint& aPoint) const
|
williamr@2
|
651 |
{
|
williamr@2
|
652 |
iLayout->GetOrigin(aPoint);
|
williamr@2
|
653 |
aPoint += iDrawTextLayoutContext.TopLeftText();
|
williamr@2
|
654 |
}
|
williamr@2
|
655 |
|
williamr@2
|
656 |
/** This constructor deliberately does not take a pointer or reference to
|
williamr@2
|
657 |
CTextView, to prevent the class from being used unless InitL() is called. */
|
williamr@2
|
658 |
inline CTextView::TTagmaForwarder::TTagmaForwarder():
|
williamr@2
|
659 |
iView(NULL)
|
williamr@2
|
660 |
{
|
williamr@2
|
661 |
}
|
williamr@2
|
662 |
|
williamr@2
|
663 |
/** Called after construction, to complete background reformatting.
|
williamr@2
|
664 |
@param aView A pointer to the text view object. */
|
williamr@2
|
665 |
inline void CTextView::TTagmaForwarder::InitL(CTextView* aView)
|
williamr@2
|
666 |
{
|
williamr@2
|
667 |
iView = aView;
|
williamr@2
|
668 |
iView->FinishBackgroundFormattingL();
|
williamr@2
|
669 |
}
|
williamr@2
|
670 |
|
williamr@2
|
671 |
inline const CTmTextLayout& CTextView::TTagmaForwarder::TextLayout() const
|
williamr@2
|
672 |
{
|
williamr@2
|
673 |
return iView->Layout()->TagmaTextLayout();
|
williamr@2
|
674 |
}
|
williamr@2
|
675 |
|
williamr@2
|
676 |
inline void CTextView::TTagmaForwarder::GetOrigin(TPoint& aPoint) const
|
williamr@2
|
677 |
{
|
williamr@2
|
678 |
iView->GetOrigin(aPoint);
|
williamr@2
|
679 |
}
|
williamr@2
|
680 |
|
williamr@2
|
681 |
#endif
|