ICursorHandler
Interfaces
ICursorHandler
Handler for performing simple operations with the cursor.
Properties
cursorChangeEvent
cursorChangeEvent: EventObject<IPositionInText>;
Cursor change event.
Remarks
Reports the current cursor position.
Methods
getCurrentParagraphIndex()
getCurrentParagraphIndex(): number;
Returns the current index of the paragraph.
Returns
number
getCurrentPosition()
getCurrentPosition(): IPositionInText;
Returns the current cursor position.
Returns
getCurrentWord()
getCurrentWord(): ITextRange;
Returns the text range of the word the cursor is on.
Returns
Remarks
not only the current word is selected, but also the gap to the next word.
getFirstPosition()
getFirstPosition(): IPositionInText;
Returns the first position in the text.
Returns
getPositionByPoint()
getPositionByPoint(point): IPositionInText;
Returns the position in the text by point.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | IPoint | point coordinates |
Returns
Remarks
the cursor does not move.
moveToDirection()
moveToDirection(direction): boolean;
Moves the current cursor position in the specified direction.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | MoveDirectionType | direction of cursor movement. |
Returns
boolean
setToPoint()
setToPoint(point): void;
Sets the cursor to a point in the text.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | IPoint | the expected point. |
Returns
void
setToPosition()
setToPosition(position): void;
Sets the cursor at a position in the text.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | the expected position in the text. |
Returns
void