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