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