ITextManager
Interfaces
ITextManager
Manager for performing basic operations with text.
Extends
Properties
canRedo
canRedo: boolean;
Indicates if the action can be redone.
Inherited from
canUndo
canUndo: boolean;
Indicates if the action can be undone.
Inherited from
cursorChangedEvent
cursorChangedEvent: EventObject<IPositionInText>;
Cursor change event.
Remarks
Reports the current cursor position.
Inherited from
ICursorService.cursorChangedEvent
selectionChangedEvent
selectionChangedEvent: EventObject<ITextRange>;
Text selection change event.
Remarks
reports the currently selected text.
Inherited from
ISelectionService.selectionChangedEvent
styleChangedEvent
styleChangedEvent: EventObject<void>;
Character or paragraph style change event.
Inherited from
IStyleService.styleChangedEvent
textChangedEvent
textChangedEvent: EventObject<void>;
Text content change event.
Inherited from
Methods
actualizeStyleManager()
actualizeStyleManager(): void;
Actualize all list styles (by name) in the style sheet manager.
Returns
void
Remarks
The actual list styles are the styles in TextWhizz.
Inherited from
IListService.actualizeStyleManager
addListItem()
addListItem(newListItemIndex, existingListItemIndex): void;
Adds a new list item to an existing list by the paragraph index.
Parameters
| Parameter | Type | Description |
|---|---|---|
newListItemIndex | number | index of the new list item. |
existingListItemIndex | number | the index of the existing (previous) list item. |
Returns
void
Remarks
there must be no other items of the same list between the current index and the index of the previous list item.
Inherited from
applyListType()
applyListType(paragraphIndexes, listType): void;
Applies a list type to paragraphs by their indexes.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndexes | number[] | paragraph indexes. |
listType | ListType | list type. |
Returns
void
Inherited from
clearCurrentFormatting()
clearCurrentFormatting(): void;
Clears formatting (character style) for the current cursor position or selected text.
Returns
void
Inherited from
IStyleService.clearCurrentFormatting
createBulletedListItem()
createBulletedListItem(paragraphIndex, bulletCharCode): void;
Creates a new top-level bulleted list item.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | paragraph index. |
bulletCharCode | number | character code used as 'bullet' (e.g., code 8225 used for “‡“). |
Returns
void
Inherited from
IListService.createBulletedListItem
createNumberedListItem()
createNumberedListItem(paragraphIndex, format): void;
Creates a new top-level numbered list item.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | paragraph index. |
format | NumberingFormatType | numbering format. |
Returns
void
Inherited from
IListService.createNumberedListItem
decreaseListItemIndent()
decreaseListItemIndent(paragraphIndex): void;
Decreases the nesting level of the list item by the paragraph index.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | paragraph index. |
Returns
void
Inherited from
IListService.decreaseListItemIndent
deleteAllText()
deleteAllText(): void;
Deletes all text.
Returns
void
Inherited from
deleteListItem()
deleteListItem(paragraphIndex): void;
Removes the existing list item by the paragraph index.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | the paragraph index of the list item to remove. |
Returns
void
Remarks
only list item is removed, paragraph text is not removed.
Inherited from
deleteTextByRange()
deleteTextByRange(textRange): IPositionInText;
Deletes text by range
Parameters
| Parameter | Type | Description |
|---|---|---|
textRange | ITextRange | text range. |
Returns
Inherited from
ITextService.deleteTextByRange
deleteTextToDirection()
deleteTextToDirection(direction): void;
Deletes the selected text or character relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | MoveDirectionType | direction of text deletion. |
Returns
void
Inherited from
ITextService.deleteTextToDirection
findItemToContinueBulletedList()
findItemToContinueBulletedList(paragraphIndex, bulletCharCode): number;
Finds the previous list item to continue bulleted list.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | index of the current paragraph. |
bulletCharCode | number | character code used as 'bullet' (e.g., code 8225 used for “‡“). |
Returns
number
the paragraph index of the found list item (if it was found).
Inherited from
IListService.findItemToContinueBulletedList
findItemToContinueNumberedList()
findItemToContinueNumberedList(
paragraphIndex,
format,
itemNumber): number;
Finds the previous list item to continue bulleted list.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | index of the current paragraph. |
format | NumberingFormatType | numbering format. |
itemNumber | number | list item number (from 1). |
Returns
number
the paragraph index of the found list item (if it was found).
Inherited from
IListService.findItemToContinueNumberedList
getCharStyleForPosition()
getCharStyleForPosition(position): ICharStyle;
Returns the character style by position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | position in text. |
Returns
Inherited from
IStyleService.getCharStyleForPosition
getCurrentCharStyle()
getCurrentCharStyle(): ICharStyle;
Returns the character style for the current cursor position or the starting position of the selected text.
Returns
Inherited from
IStyleService.getCurrentCharStyle
getCurrentParagraphIndex()
getCurrentParagraphIndex(): number;
Returns the current index of the paragraph (from 0).
Returns
number
Inherited from
ICursorService.getCurrentParagraphIndex
getCurrentParagraphStyle()
getCurrentParagraphStyle(): IParagraphStyle;
Returns the paragraph style for the current cursor position or the first paragraph of the selected text.
Returns
Inherited from
IStyleService.getCurrentParagraphStyle
getCurrentPosition()
getCurrentPosition(): IPositionInText;
Returns the current cursor position.
Returns
Inherited from
ICursorService.getCurrentPosition
getFirstPosition()
getFirstPosition(): IPositionInText;
Returns the first position in the text.
Returns
Inherited from
ICursorService.getFirstPosition
getFormattedText()
getFormattedText(): string;
Returns formatted text.
Returns
string
Inherited from
getListItemStyle()
getListItemStyle(paragraphIndex): IListStyle;
Returns the style of the list item by the paragraph index.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | paragraph index. |
Returns
Remarks
if the list item is not found, null is returned.
Inherited from
getParagraphCount()
getParagraphCount(): number;
Returns paragraph count.
Returns
number
Inherited from
ITextService.getParagraphCount
getParagraphStyleByIndex()
getParagraphStyleByIndex(index): IParagraphStyle;
Returns the paragraph style by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | paragraph index (from 0). |
Returns
Inherited from
IStyleService.getParagraphStyleByIndex
getParagraphText()
getParagraphText(paragraphIndex): ITextRange;
Returns the text range of a paragraph by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | any | paragraph index (from 0). |
Returns
Inherited from
getSelectedParagraphIndexes()
getSelectedParagraphIndexes(): number[];
Returns the currently selected paragraphs indexes (by selection or cursor position).
Returns
number[]
Inherited from
ISelectionService.getSelectedParagraphIndexes
getSelectedTextRange()
getSelectedTextRange(): ITextRange;
Returns the currently selected text range.
Returns
Inherited from
ISelectionService.getSelectedTextRange
getTextModel()
getTextModel(): Text;
Returns the text model.
Returns
Inherited from
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
Inherited from
ITextService.getTextRangeByPositions
increaseListItemIndent()
increaseListItemIndent(paragraphIndex): void;
Increases the nesting level of the list item by the paragraph index.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | paragraph index. |
Returns
void
Inherited from
IListService.increaseListItemIndent
insertFormattedText()
insertFormattedText(text): void;
Inserts formatted text relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | text to insert. |
Returns
void
Inherited from
ITextService.insertFormattedText
insertNewLine()
insertNewLine(): void;
Inserts a new line relative to the current cursor position.
Returns
void
Inherited from
insertPlainText()
insertPlainText(text): void;
Inserts plain text relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | text to insert. |
Returns
void
Inherited from
isParagraphAListItem()
isParagraphAListItem(paragraphIndex): boolean;
Indicates if a paragraph is a list item.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | number | paragraph index. |
Returns
boolean
returns true if the paragraph is a list item, false otherwise.
Inherited from
IListService.isParagraphAListItem
isParagraphsTheSameList()
isParagraphsTheSameList(paragraphIndexes): boolean;
Indicates if the paragraphs are the same list.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndexes | number[] | paragraph indexes. |
Returns
boolean
Inherited from
IListService.isParagraphsTheSameList
measureText()
measureText(scale, isExtendToBlackBox?): RectangleF;
Measures text.
Parameters
| Parameter | Type | Description |
|---|---|---|
scale | number | scale. |
isExtendToBlackBox? | boolean | indicates if extend to black box. |
Returns
RectangleF
Inherited from
measureTextFrames()
measureTextFrames(useActiveText): RectangleF;
Measures the text frame.
Parameters
| Parameter | Type | Description |
|---|---|---|
useActiveText | boolean | true if you want to use the currently active text, false if the item's original text. |
Returns
RectangleF
Inherited from
ITextService.measureTextFrames
moveCursorToDirection()
moveCursorToDirection(direction, withSelection?): void;
Moves the current cursor position in the specified direction.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | MoveDirectionType | direction of cursor movement. |
withSelection? | boolean | indicates whether the cursor moves with text selection (the default value is false). |
Returns
void
Inherited from
ICursorService.moveCursorToDirection
pauseUndoRedo()
pauseUndoRedo(): void;
Pauses saving actions.
Returns
void
Remarks
can be used to combine multiple actions into one.
Inherited from
IUndoRedoService.pauseUndoRedo
redo()
redo(): void;
Redoes an action.
Returns
void
Inherited from
resetSelection()
resetSelection(): void;
Resets text selection.
Returns
void
Inherited from
ISelectionService.resetSelection
resumeUndoRedo()
resumeUndoRedo(): void;
Resumes saving actions.
Returns
void
Remarks
can be used to combine multiple actions into one.
Inherited from
IUndoRedoService.resumeUndoRedo
selectAllText()
selectAllText(): void;
Selects all text.
Returns
void
Inherited from
ISelectionService.selectAllText
selectCurrentParagraph()
selectCurrentParagraph(): void;
Selects a paragraph relative to the current cursor position.
Returns
void
Inherited from
ISelectionService.selectCurrentParagraph
selectCurrentWord()
selectCurrentWord(): void;
Selects a word relative to the current cursor position.
Returns
void
Inherited from
ISelectionService.selectCurrentWord
setCharStyleForPosition()
setCharStyleForPosition(position, style): void;
Sets the character style by position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | position in text. |
style | ICharStyle | expected character style. |
Returns
void
Inherited from
IStyleService.setCharStyleForPosition
setCurrentCharStyle()
setCurrentCharStyle(style): void;
Sets the character style for the current cursor position or selected text.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | ICharStyle | expected character style. |
Returns
void
Remarks
only properties specified in the expected style are set.
Inherited from
IStyleService.setCurrentCharStyle
setCurrentParagraphStyle()
setCurrentParagraphStyle(style): void;
Sets the paragraph style for the current cursor position or selected text.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | IParagraphStyle | expected paragraph style. |
Returns
void
Remarks
only properties specified in the expected style are set.
Inherited from
IStyleService.setCurrentParagraphStyle
setCursorToPoint()
setCursorToPoint(point): void;
Sets the cursor to a point in the text.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | IPoint | the expected point. |
Returns
void
Inherited from
ICursorService.setCursorToPoint
setCursorToPosition()
setCursorToPosition(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
Inherited from
ICursorService.setCursorToPosition
setParagraphStyleByIndex()
setParagraphStyleByIndex(index, style): void;
Sets the paragraph style by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | paragraph index (from 0). |
style | IParagraphStyle | expected paragraph style. |
Returns
void
Remarks
only properties specified in the expected style are set.
Inherited from
IStyleService.setParagraphStyleByIndex
setSelection()
setSelection(startPoint, endPoint): void;
Sets the selection of text by starting and ending points.
Parameters
| Parameter | Type | Description |
|---|---|---|
startPoint | IPoint | starting point. |
endPoint | IPoint | ending point. |
Returns
void
Inherited from
ISelectionService.setSelection
setTextModel()
setTextModel(model): void;
Sets the text model.
Parameters
| Parameter | Type | Description |
|---|---|---|
model | Text | text model. |
Returns
void
Inherited from
setWrappingPath()
setWrappingPath(data): void;
Sets the wrapping path.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | IWrappingPathData | wrapping path data. |
Returns
void
Inherited from
undo()
undo(): void;
Undoes an action.
Returns
void