ITextHandler
Interfaces
ITextHandler
Handler for performing simple operations with text content.
Properties
textChangeEvent
textChangeEvent: EventObject<void>;
Text content change event.
Methods
deleteAllText()
deleteAllText(): IPositionInText;
Deletes all text.
Returns
deleteTextByRange()
deleteTextByRange(textRange): IPositionInText;
Deletes text by range
Parameters
| Parameter | Type | Description |
|---|---|---|
textRange | ITextRange | text range. |
Returns
deleteTextToDirection()
deleteTextToDirection(direction): IPositionInText;
Deletes the selected text or character relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | MoveDirectionType | direction of text deletion. |
Returns
getAllText()
getAllText(): ITextRange;
Returns all text.
Returns
getFormattedText()
getFormattedText(): string;
Returns formatted text.
Returns
string
getParagraphCount()
getParagraphCount(): number;
Returns paragraph count.
Returns
number
getParagraphText()
getParagraphText(paragraphIndex): ITextRange;
Returns the text range of a paragraph by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | any | paragraph index (from 0). |
Returns
getTextModel()
getTextModel(): Text;
Returns the text model.
Returns
getTextRangeByPositions()
getTextRangeByPositions(startPosition, endPosition): ITextRange;
Returns the range of text by starting and ending position.
Parameters
| Parameter | Type | Description |
|---|---|---|
startPosition | IPositionInText | starting position. |
endPosition | IPositionInText | ending position. |
Returns
insertFormattedText()
insertFormattedText(text): void;
Inserts formatted text relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | text to insert. |
Returns
void
insertNewLine()
insertNewLine(): void;
Inserts a new line relative to the current cursor position.
Returns
void
insertPlainText()
insertPlainText(text): void;
Inserts plain text relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | text to insert. |
Returns
void
setTextFrames()
setTextFrames(data, isMeasureFrame): void;
Sets the frame of text.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | ITextFrameData | text frame data. |
isMeasureFrame | boolean | indicates if the frame is needed for further measurement. |
Returns
void
setTextModel()
setTextModel(model): void;
Sets the text model.
Parameters
| Parameter | Type | Description |
|---|---|---|
model | Text | text model. |
Returns
void
setWrappingPath()
setWrappingPath(data): void;
Sets the wrapping path.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | IWrappingPathData | wrapping path data. |
Returns
void