TCursorPosition Class Reference

#include <frmtlay.h>

Link against: form.lib

class TCursorPosition

Detailed Description

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.

Member Enumeration Documentation

Enum TMovementType

Direction of cursor movement.

EnumeratorValueDescription
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

EnumeratorValueDescription
EPosHintUndefined0
EInsertStrongL2R1

Left to right typing expected.

EInsertStrongR2L2

Right to left typing expected.

EPosHintLast

Enum TVisualEnd

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

EnumeratorValueDescription
EVisualLeft

Leftmost end.

EVisualRight

Rightmost end.

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 Function Documentation

CancelHighlight ( )

voidCancelHighlight()[inline]

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

ChoosePosition ( TTmPosInfo2 &, TTmPosInfo2 & )

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

Returns a reference to the more suitable of the positions, taking the cursor positioning hint into account.

Parameters
aPreferredThe candidate returned if the positioning hint does not decide it.
aBackupThe alternative candidate; only returned if the positioning hint makes it more desirable than aPreferred.
Return Value
either aPreferred or aBackup.

DocPos ( )

TInt DocPos()const [inline]

Gets the edge position in the document.

Return Value
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

Return Value
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

Return Value
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

Return Value
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

GetOldSelection ( TCursorSelection & )

voidGetOldSelection(TCursorSelection &aSelection)const

GetSelection ( TCursorSelection & )

voidGetSelection(TCursorSelection &aSelection)const

IsNewPictureFrame ( )

TBool IsNewPictureFrame()const

IsPictureFrame ( )

TBool IsPictureFrame()const

IsSelection ( )

TBool IsSelection()const [inline]

Tests whether there is currently a selected region.

Return Value
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.

Return Value
True if there is a selected region. False if not.

MoveL ( TBool, TMovementType &, TBool )

TInt MoveL(TBoolaDragSelectOn,
TMovementType &aMovement,
TBoolaAllowPictureFrame
)

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
aDocPosthe document position

SetDocPosL ( TBool, const TTmDocPos & )

TInt SetDocPosL(TBoolaDragSelectOn,
const TTmDocPos &aDocPos
)

SetLayout ( CTextLayout * )

voidSetLayout(CTextLayout *aLayout)[inline]

Sets the text layout which TCursorPosition is related.

Parameters
aLayoutThe text layout.

SetPendingSelection ( const TCursorSelection & )

voidSetPendingSelection(const TCursorSelection &aSelection)

SetPositioningHint ( TPosHint )

voidSetPositioningHint(TPosHintaHint)[inline]

SetSelectionL ( const TCursorSelection & )

TInt SetSelectionL(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
)

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.

Return Value
the document position

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
aXThe horizontal coordinate to which the text cursor should be moved

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

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

Selection of the left end or right end of a run of text. If both ends are in one line, the logical end that is visually in the direction specified will be chosen. If aStart and aEnd are in different lines, then we look at whether aEnd is choosing the end that is furthest forwards or furthest back by comparing it against the directionality of the paragraph containing aStart.

Return Value
Reference to aStart or aEnd.