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 ()
void CancelHighlight ()
TTmPosInfo2 & ChoosePosition ( TTmPosInfo2 &, TTmPosInfo2 &)
TInt DocPos ()
void DontDrawOldPictureFrame ()
TBool DrawHighlight ()
TBool DrawNewPictureFrame ()
TBool DrawOldPictureFrame ()
TBool GetCursor ( TTmCursorPlacement , TPoint &, TInt &, TInt &, TInt &)
void GetOldSelection ( TCursorSelection &)
void GetSelection ( TCursorSelection &)
TBool IsNewPictureFrame ()
TBool IsPictureFrame ()
TBool IsSelection ()
TBool IsSelectionToDraw ()
TInt MoveL ( TBool , TMovementType &, TBool )
TPosHint PositioningHint ()
void SetDocPos (const TTmDocPos &)
TInt SetDocPosL ( TBool , const TTmDocPos &)
void SetLayout ( CTextLayout *)
void SetPendingSelection (const TCursorSelection &)
void SetPositioningHint ( TPosHint )
TInt SetSelectionL (const TCursorSelection &)
void SetToCurrentHighlight ()
void SetToPreviousHighlight ()
TInt SetXyPosL ( TBool , TPoint , TBool )
void TextMoveVertically ()
const TTmDocPos & TmDocPos ()
void UpdateLatentPosition ()
void UpdateLatentX ( TInt )
const TTmDocPos & VisualEndOfRunL (const TTmDocPos &, const TTmDocPos &, TVisualEnd )
Private Member Functions
TBool CalculateCursorPos ( TPoint &)
TInt CheckCursorOnScreenL ( TInt &)
void CheckNullSelection ()
void CheckSelection ( TBool )
TInt DoSetDocPosL (const TTmDocPos &)
TInt DoSetVisibleDocPosL (const TTmDocPos &)
void DoSetXyPos ( TPoint &)
TBool LeftRightL ( TTmPosInfo2 &, TTmLineInfo &, TMovementType &)
TInt PageScrollL ( TMovementType &)
void SetPictureFrame (const TTmDocPos &, TInt , const TRect &)
void StartEnd ( TTmPosInfo2 &, TTmLineInfo &, TMovementType &)
void UpDownL ( TTmPosInfo2 &, TTmLineInfo &, TMovementType &)
void UpdateLatentY ( TInt )
TInt ViewTopOfLineL (const TTmDocPos &, TInt &)
Public Member Enumerations
enum TMovementType {
EFNoMovement , EFLeft , EFRight , EFLineUp , EFLineDown , EFPageUp , EFPageDown , EFLineBeg , EFLineEnd
}
enum TPosHint { EPosHintUndefined  = 0, EInsertStrongL2R  = 1, EInsertStrongR2L  = 2, EPosHintLast }
enum TVisualEnd { EVisualLeft , EVisualRight }
Private Member Enumerations
enum anonymous { EFAbove  = -1, EFInside  = 0, EFBelow  = 1 }
enum anonymous { 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

Parameters

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

CancelHighlight()

void CancelHighlight ( ) [inline]

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

CheckCursorOnScreenL(TInt &)

TInt CheckCursorOnScreenL ( TInt & aY ) [private]

Parameters

TInt & aY

CheckNullSelection()

void CheckNullSelection ( ) [private]

CheckSelection(TBool)

void CheckSelection ( TBool aSelect ) [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 &)

void DoSetXyPos ( TPoint & aXy ) [private]

Parameters

TPoint & aXy

DocPos()

TInt DocPos ( ) const [inline]

Gets the edge position in the document.

DontDrawOldPictureFrame()

void DontDrawOldPictureFrame ( ) [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

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

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

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

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

Parameters

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

GetOldSelection(TCursorSelection &)

void GetOldSelection ( TCursorSelection & aSelection ) const

Parameters

TCursorSelection & aSelection

GetSelection(TCursorSelection &)

void GetSelection ( 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.

IsSelectionToDraw()

TBool IsSelectionToDraw ( ) const [inline]

Tests whether there is currently a highlighted region being drawn.

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 ( TBool aDragSelectOn,
TMovementType & aMovement,
TBool aAllowPictureFrame
)

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 &)

void SetDocPos ( 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 & aDocPos the document position

SetDocPosL(TBool, const TTmDocPos &)

TInt SetDocPosL ( TBool aDragSelectOn,
const TTmDocPos & aDocPos
)

Parameters

TBool aDragSelectOn
const TTmDocPos & aDocPos

SetLayout(CTextLayout *)

void SetLayout ( CTextLayout * aLayout ) [inline]

Sets the text layout which TCursorPosition is related.

Parameters

CTextLayout * aLayout The text layout.

SetPendingSelection(const TCursorSelection &)

void SetPendingSelection ( const TCursorSelection & aSelection )

Parameters

const TCursorSelection & aSelection

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

void SetPictureFrame ( const TTmDocPos & aDocPos,
TInt aAnchor,
const TRect & aPictureRect
) [private]

Parameters

const TTmDocPos & aDocPos
TInt aAnchor
const TRect & aPictureRect

SetPositioningHint(TPosHint)

void SetPositioningHint ( TPosHint aHint ) [inline]

Parameters

TPosHint aHint

SetSelectionL(const TCursorSelection &)

TInt SetSelectionL ( const TCursorSelection & aSelection )

Parameters

const TCursorSelection & aSelection

SetToCurrentHighlight()

void SetToCurrentHighlight ( ) [inline]

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

SetToPreviousHighlight()

void SetToPreviousHighlight ( ) [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 ( TBool aDragSelectOn,
TPoint aPos,
TBool aAllowPictureFrame
)

Parameters

TBool aDragSelectOn
TPoint aPos
TBool aAllowPictureFrame

StartEnd(TTmPosInfo2 &, TTmLineInfo &, TMovementType &)

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

Parameters

TTmPosInfo2 & aPos
TTmLineInfo & aLine
TMovementType & aMove

TextMoveVertically()

void TextMoveVertically ( )

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.

UpDownL(TTmPosInfo2 &, TTmLineInfo &, TMovementType &)

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

Parameters

TTmPosInfo2 & aPos
TTmLineInfo & aLine
TMovementType & aMove

UpdateLatentPosition()

void UpdateLatentPosition ( )

UpdateLatentX(TInt)

void UpdateLatentX ( TInt aX ) [inline]

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

Parameters

TInt aX The horizontal coordinate to which the text cursor should be moved

UpdateLatentY(TInt)

void UpdateLatentY ( TInt aY ) [private, inline]

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

Parameters

TInt aY The 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,
TVisualEnd aDirection
)

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]