TCursorPosition Class Reference

class TCursorPosition

Cursor position.

The TMovementType enum defined in this class is used to indicate the direction of a scroll or cursor movement. The remainder of this class does not form part of the API.

Public Member Functions
TCursorPosition()
voidCancelHighlight()
TTmPosInfo2 &ChoosePosition(TTmPosInfo2 &, TTmPosInfo2 &)
TInt DocPos()
voidDontDrawOldPictureFrame()
TBool DrawHighlight()
TBool DrawNewPictureFrame()
TBool DrawOldPictureFrame()
TBool GetCursor(TTmCursorPlacement, TPoint &, TInt &, TInt &, TInt &)
voidGetOldSelection(TCursorSelection &)
voidGetSelection(TCursorSelection &)
TBool IsNewPictureFrame()
TBool IsPictureFrame()
TBool IsSelection()
TBool IsSelectionToDraw()
TInt MoveL(TBool, TMovementType &, TBool)
TPosHint PositioningHint()
voidSetDocPos(const TTmDocPos &)
TInt SetDocPosL(TBool, const TTmDocPos &)
voidSetLayout(CTextLayout *)
voidSetPendingSelection(const TCursorSelection &)
voidSetPositioningHint(TPosHint)
TInt SetSelectionL(const TCursorSelection &)
voidSetToCurrentHighlight()
voidSetToPreviousHighlight()
TInt SetXyPosL(TBool, TPoint, TBool)
voidTextMoveVertically()
const TTmDocPos &TmDocPos()
voidUpdateLatentPosition()
voidUpdateLatentX(TInt)
const TTmDocPos &VisualEndOfRunL(const TTmDocPos &, const TTmDocPos &, TVisualEnd)
Private Member Functions
TBool CalculateCursorPos(TPoint &)
TInt CheckCursorOnScreenL(TInt &)
voidCheckNullSelection()
voidCheckSelection(TBool)
TInt DoSetDocPosL(const TTmDocPos &)
TInt DoSetVisibleDocPosL(const TTmDocPos &)
voidDoSetXyPos(TPoint &)
TBool LeftRightL(TTmPosInfo2 &, TTmLineInfo &, TMovementType &)
TInt PageScrollL(TMovementType &)
voidSetPictureFrame(const TTmDocPos &, TInt, const TRect &)
voidStartEnd(TTmPosInfo2 &, TTmLineInfo &, TMovementType &)
voidUpDownL(TTmPosInfo2 &, TTmLineInfo &, TMovementType &)
voidUpdateLatentY(TInt)
TInt ViewTopOfLineL(const TTmDocPos &, TInt &)
Public Member Enumerations
enumTMovementType {
EFNoMovement, EFLeft, EFRight, EFLineUp, EFLineDown, EFPageUp, EFPageDown, EFLineBeg, EFLineEnd
}
enumTPosHint { EPosHintUndefined = 0, EInsertStrongL2R = 1, EInsertStrongR2L = 2, EPosHintLast }
enumTVisualEnd { EVisualLeft, EVisualRight }
Private Member Enumerations
enumanonymous { EFAbove = -1, EFInside = 0, EFBelow = 1 }
enumanonymous { EDrawHighlight = 1, EDrawOldPictureFrame = 2, EDrawNewPictureFrame = 4, EReturnPreviousHighlight = 8, ESelected = 16 }
Private Attributes
TInt iAnchor
TTmDocPos iDocPos
TUint iFlags
TInt iLatentX
TInt iLatentY
CTextLayout *iLayout
TInt iOldAnchor
TInt iOldDocPos
TPosHint iPositioningHint

Constructor & Destructor Documentation

TCursorPosition()

TCursorPosition()[inline]

Constructs the TCursorPosition object, initializing its members iAnchor, iOldDocPos, iOldAnchor, iFlags, iLatentX, iLatentY to zero, iLayout to NULL, and iPositioningHint to undefined.

Member Functions Documentation

CalculateCursorPos(TPoint &)

TBool CalculateCursorPos(TPoint &aCurPos)[private, inline]

Caculate x-y position of the cursor If ETrue is returned, places the position of the intersection of the character edge with the baseline in aPos ETrue if the document is in the formatted text, otherwise EFalse.

Parameters

TPoint & aCurPosOn return, stores the position of the intersection of the character edge with the baseline

CancelHighlight()

voidCancelHighlight()[inline]

Removes the selection, and redraws the affected part of the screen.

CheckCursorOnScreenL(TInt &)

TInt CheckCursorOnScreenL(TInt &aY)[private]

Parameters

TInt & aY

CheckNullSelection()

voidCheckNullSelection()[private]

CheckSelection(TBool)

voidCheckSelection(TBoolaSelect)[private]

Parameters

TBool aSelect

ChoosePosition(TTmPosInfo2 &, TTmPosInfo2 &)

TTmPosInfo2 &ChoosePosition(TTmPosInfo2 &aPreferred,
TTmPosInfo2 &aBackup
)

Parameters

TTmPosInfo2 & aPreferred
TTmPosInfo2 & aBackup

DoSetDocPosL(const TTmDocPos &)

TInt DoSetDocPosL(const TTmDocPos &aDocPos)[private]

Parameters

const TTmDocPos & aDocPos

DoSetVisibleDocPosL(const TTmDocPos &)

TInt DoSetVisibleDocPosL(const TTmDocPos &aDocPos)[private]

Parameters

const TTmDocPos & aDocPos

DoSetXyPos(TPoint &)

voidDoSetXyPos(TPoint &aXy)[private]

Parameters

TPoint & aXy

DocPos()

TInt DocPos()const [inline]

Gets the edge position in the document. the edge position in the document.

DontDrawOldPictureFrame()

voidDontDrawOldPictureFrame()[inline]

Sets to not draw the previous picture frame

DrawHighlight()

TBool DrawHighlight()const [inline]

Tests whether the highlighted region needs to be drawn. The function will be called by CTextView::UpdateHighlightL() to correct the highlight after a cursor movement True if the highlighted region needs to be drawn. False if not.

DrawNewPictureFrame()

TBool DrawNewPictureFrame()const [inline]

Tests whether there is a new picture frame that needs to be drawn. The function will be called by CTextView::UpdateHighlightL() to correct the highlight after a cursor movement True if there is a new picture frame that needs to be drawn. False if not.

DrawOldPictureFrame()

TBool DrawOldPictureFrame()const [inline]

Tests whether there is a previous picture frame that needs to be drawn. The function will be called by CTextView::UpdateHighlightL() to correct the highlight after a cursor movement True if there is a previous picture frame that needs to be drawn. False if not.

GetCursor(TTmCursorPlacement, TPoint &, TInt &, TInt &, TInt &)

TBool GetCursor(TTmCursorPlacementaPlacement,
TPoint &aOrigin,
TInt &aWidth,
TInt &aAscent,
TInt &aDescent
)const

Parameters

TTmCursorPlacement aPlacement
TPoint & aOrigin
TInt & aWidth
TInt & aAscent
TInt & aDescent

GetOldSelection(TCursorSelection &)

voidGetOldSelection(TCursorSelection &aSelection)const

Parameters

TCursorSelection & aSelection

GetSelection(TCursorSelection &)

voidGetSelection(TCursorSelection &aSelection)const

Parameters

TCursorSelection & aSelection

IsNewPictureFrame()

TBool IsNewPictureFrame()const

IsPictureFrame()

TBool IsPictureFrame()const

IsSelection()

TBool IsSelection()const [inline]

Tests whether there is currently a selected region. True if there is a selected region. False if not.

IsSelectionToDraw()

TBool IsSelectionToDraw()const [inline]

Tests whether there is currently a highlighted region being drawn. True if there is a selected region. False if not.

LeftRightL(TTmPosInfo2 &, TTmLineInfo &, TMovementType &)

TBool LeftRightL(TTmPosInfo2 &aPos,
TTmLineInfo &aLine,
TMovementType &aMove
)[private]

Parameters

TTmPosInfo2 & aPos
TTmLineInfo & aLine
TMovementType & aMove

MoveL(TBool, TMovementType &, TBool)

TInt MoveL(TBoolaDragSelectOn,
TMovementType &aMovement,
TBoolaAllowPictureFrame
)

Parameters

TBool aDragSelectOn
TMovementType & aMovement
TBool aAllowPictureFrame

PageScrollL(TMovementType &)

TInt PageScrollL(TMovementType &aMove)[private]

Parameters

TMovementType & aMove

PositioningHint()

TPosHint PositioningHint()const [inline]

SetDocPos(const TTmDocPos &)

voidSetDocPos(const TTmDocPos &aDocPos)[inline]

Sets the document position, the structure for holding a raw document position that can be converted to or from an x-y position and compared ordinally, which cannot be done with the more abstract TTmDocPosSpec class.

Parameters

const TTmDocPos & aDocPosthe document position

SetDocPosL(TBool, const TTmDocPos &)

TInt SetDocPosL(TBoolaDragSelectOn,
const TTmDocPos &aDocPos
)

Parameters

TBool aDragSelectOn
const TTmDocPos & aDocPos

SetLayout(CTextLayout *)

voidSetLayout(CTextLayout *aLayout)[inline]

Sets the text layout which TCursorPosition is related.

Parameters

CTextLayout * aLayoutThe text layout.

SetPendingSelection(const TCursorSelection &)

voidSetPendingSelection(const TCursorSelection &aSelection)

Parameters

const TCursorSelection & aSelection

SetPictureFrame(const TTmDocPos &, TInt, const TRect &)

voidSetPictureFrame(const TTmDocPos &aDocPos,
TIntaAnchor,
const TRect &aPictureRect
)[private]

Parameters

const TTmDocPos & aDocPos
TInt aAnchor
const TRect & aPictureRect

SetPositioningHint(TPosHint)

voidSetPositioningHint(TPosHintaHint)[inline]

Parameters

TPosHint aHint

SetSelectionL(const TCursorSelection &)

TInt SetSelectionL(const TCursorSelection &aSelection)

Parameters

const TCursorSelection & aSelection

SetToCurrentHighlight()

voidSetToCurrentHighlight()[inline]

Clears the special flag set in SetToPreviousHighlight() so that GetSelection() and IsPictureFrame() will operate on the current highlight.

SetToPreviousHighlight()

voidSetToPreviousHighlight()[inline]

Sets the flag which directs GetSelection() and IsPictureFrame() to operate on the previous highlight instead of the current highlight.

SetXyPosL(TBool, TPoint, TBool)

TInt SetXyPosL(TBoolaDragSelectOn,
TPointaPos,
TBoolaAllowPictureFrame
)

Parameters

TBool aDragSelectOn
TPoint aPos
TBool aAllowPictureFrame

StartEnd(TTmPosInfo2 &, TTmLineInfo &, TMovementType &)

voidStartEnd(TTmPosInfo2 &aPos,
TTmLineInfo &aLine,
TMovementType &aMove
)[private]

Parameters

TTmPosInfo2 & aPos
TTmLineInfo & aLine
TMovementType & aMove

TextMoveVertically()

voidTextMoveVertically()

TmDocPos()

const TTmDocPos &TmDocPos()const [inline]

Gets the document position, the structure for holding a raw document position that can be converted to or from an x-y position and compared ordinally, which cannot be done with the more abstract TTmDocPosSpec class. the document position

UpDownL(TTmPosInfo2 &, TTmLineInfo &, TMovementType &)

voidUpDownL(TTmPosInfo2 &aPos,
TTmLineInfo &aLine,
TMovementType &aMove
)[private]

Parameters

TTmPosInfo2 & aPos
TTmLineInfo & aLine
TMovementType & aMove

UpdateLatentPosition()

voidUpdateLatentPosition()

UpdateLatentX(TInt)

voidUpdateLatentX(TIntaX)[inline]

Sets the latent horizontal text cursor position. This is the horizontal coordinate to which the text cursor will be moved.

Parameters

TInt aXThe horizontal coordinate to which the text cursor should be moved

UpdateLatentY(TInt)

voidUpdateLatentY(TIntaY)[private, inline]

Sets the latent vertical text cursor position. This is the vertical coordinate to which the text cursor will be moved.

Parameters

TInt aYThe vertical coordinate to which the text cursor should be moved

ViewTopOfLineL(const TTmDocPos &, TInt &)

TInt ViewTopOfLineL(const TTmDocPos &aDocPos,
TInt &aYPos
)[private]

Parameters

const TTmDocPos & aDocPos
TInt & aYPos

VisualEndOfRunL(const TTmDocPos &, const TTmDocPos &, TVisualEnd)

const TTmDocPos &VisualEndOfRunL(const TTmDocPos &aStart,
const TTmDocPos &aEnd,
TVisualEndaDirection
)

Parameters

const TTmDocPos & aStart
const TTmDocPos & aEnd
TVisualEnd aDirection

Member Enumerations Documentation

Enum anonymous

Enumerators

EFAbove = -1
EFInside = 0
EFBelow = 1

Enum anonymous

Enumerators

EDrawHighlight = 1
EDrawOldPictureFrame = 2
EDrawNewPictureFrame = 4
EReturnPreviousHighlight = 8
ESelected = 16

Enum TMovementType

Direction of cursor movement.

Enumerators

EFNoMovement

No cursor movement

EFLeft

Single character cursor movement to the left

EFRight

Single character cursor movement to the right

EFLineUp

Line up cursor movement

EFLineDown

Line down cursor movement

EFPageUp

Page up cursor movement

EFPageDown

Page down cursor movement

EFLineBeg

Cursor movement to line start

EFLineEnd

Cursor movement to line end

Enum TPosHint

Enumerators

EPosHintUndefined = 0
EInsertStrongL2R = 1

Left to right typing expected.

EInsertStrongR2L = 2

Right to left typing expected.

EPosHintLast

Enum TVisualEnd

Selection of the left end or right end of a run of text.

Enumerators

EVisualLeft

Leftmost end.

EVisualRight

Rightmost end.

Member Data Documentation

TInt iAnchor

TInt iAnchor[private]

TTmDocPos iDocPos

TTmDocPos iDocPos[private]

TUint iFlags

TUint iFlags[private]

TInt iLatentX

TInt iLatentX[private]

TInt iLatentY

TInt iLatentY[private]

CTextLayout * iLayout

CTextLayout *iLayout[private]

TInt iOldAnchor

TInt iOldAnchor[private]

TInt iOldDocPos

TInt iOldDocPos[private]

TPosHint iPositioningHint

TPosHint iPositioningHint[private]