ITextEditor
Interfaces
IListConfiguration
A structure defining layout settings and format of lists in text elements.
Properties
bulletChar
bulletChar: string;
The bulleted list marker that will be used when creating lists through the Top toolbar. The default value is "•" (0x8226).
firstLineIndent
firstLineIndent: number;
The distance between the bullet and text in the first line of a list item, in points. The default value is -20.
levelIndent
levelIndent: number;
The offset of each next level of the list relative to the previous level, in points. The default value is 30.
listIndent
listIndent: number;
The distance between the left edge of the text element and the leftmost line of list items in this text element, in points. The default value is 30.
maxLevel
maxLevel: number;
The maximum number of levels in multilevel lists. The default value is 3.
numberingFormat
numberingFormat: NumberingFormatType;
The numbered list marker format, one of "none", "number", "lowerLetter", "upperLetter", "lowerRoman", or "upperRoman". If "none", then list items will represent paragraphs without numbers. This marker format will be used when creating lists through the Top toolbar. The default value is "number".
tabOffset
tabOffset: number;
The offset that will appear before text on the first line if this text may overlap the bullet, in points. If this value is not enough to create an indent, it will be added again. The default value is 30.
ITextEditor
Executes a command of the specified type.
Extends
Properties
canRedo
canRedo: boolean;
Indicates if the action can be redone.
canUndo
canUndo: boolean;
Indicates if the action can be undone.
disableDrawBaseline
disableDrawBaseline: boolean;
editorInitialized
editorInitialized: EventObject<void>;
Editor initialization event.
frameChanged
frameChanged: EventObject<RectangleF>;
Text frame change event.
Remarks
Reports the currently text frame.
highlightInEditingModeEnabled
highlightInEditingModeEnabled: boolean;
Indicates if the editor has to be highlighted when in editing mode.
invalidCharEntered
invalidCharEntered: EventObject<void>;
Invalid character input event.
isActive
isActive: boolean;
Indicates if the editor is in editing mode.
isReady
isReady: boolean;
Indicates if the editor is initialized and ready to work.
redrawActiveTextInEditMode
redrawActiveTextInEditMode: boolean;
Indicates if the editor needs to redraw ActiveText when it is edited.
styleChanged
styleChanged: EventObject<void>;
Character or paragraph style change event.
textLimits
textLimits: ITextLimits;
Get current text limits.
textLimitsViolationEvent
textLimitsViolationEvent: EventObject<ILimitsViolationEventData>;
textMetrics
textMetrics: ITextMetrics;
Get current text data: characters count, paragraphs count, current paragraph characters count.
textMetricsChangedEvent
textMetricsChangedEvent: EventObject<ITextMetrics>;
Methods
dispose()
dispose(): void;
Disposes text editor when its no longer needed.
Returns
void
enterEditMode()
enterEditMode(point): void;
Enters the editing mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | IPoint | cursor point. |
Returns
void
executeCommand()
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | undo |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | redo |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | setCursor |
data | SetCursorCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | moveCursor |
data | MoveCursorCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | setSelection |
data | SetSelectionCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | selectWord |
data | SelectWordCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | selectParagraph |
data | SelectParagraphCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | selectAllText |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | insertNewLine |
data | InsertNewLineCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | insertLineBrake |
data | InsertLineBrakeCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | insertTab |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | insertText |
data | InsertTextCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | deleteText |
data | DeleteTextCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | copyToClipboard |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | clearFormatting |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | setCharStyle |
data | SetCharStyleCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | setParagraphStyle |
data | SetParagraphStyleCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | setCapitalLetters |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | setFontBold |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | setFontItalic |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | setSuperscriptLetters |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | setSubscriptLetters |
Returns
void
Inherited from
Call Signature
executeCommand(type): void;
Parameters
| Parameter | Type |
|---|---|
type | setFontUnderline |
Returns
void
Inherited from
Call Signature
executeCommand(type, data?): void;
Parameters
| Parameter | Type |
|---|---|
type | increaseFontSize |
data? | IncreaseFontSizeCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data?): void;
Parameters
| Parameter | Type |
|---|---|
type | decreaseFontSize |
data? | DecreaseFontSizeCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | setAlignment |
data | SetAlignmentCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | addListItem |
data | AddListItemCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | creteBulletedListItem |
data | CreateBulletedListItemCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | creteBulletedListItem |
data | CreateNumberedListItemCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data?): void;
Parameters
| Parameter | Type |
|---|---|
type | deleteListItem |
data? | DeleteListItemCmdData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data?): void;
Parameters
| Parameter | Type |
|---|---|
type | increaseListItemIndent |
data? | IncreaseListItemIndentData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data?): void;
Parameters
| Parameter | Type |
|---|---|
type | decreaseListItemIndent |
data? | DecreaseListItemIndentData |
Returns
void
Inherited from
Call Signature
executeCommand(type, data): void;
Parameters
| Parameter | Type |
|---|---|
type | applyListItem |
data | ApplyListTypeCmdData |
Returns
void
Inherited from
exitEditMode()
exitEditMode(): void;
Exits editing mode.
Returns
void
getFormattedText()
getFormattedText(): Promise<string>;
Returns formatted text.
Returns
Promise<string>
getInlineStyle()
getInlineStyle(): ICharStyle;
Returns the character style for the current cursor position or the starting position of the selected text.
Returns
getParagraphStyle()
getParagraphStyle(): IParagraphStyle;
Returns the paragraph style for the current cursor position or the first paragraph of the selected text.
Returns
getTextModel()
getTextModel(): Text;
Returns the text model.
Returns
isApplyingListsEnabled()
isApplyingListsEnabled(): boolean;
Indicates if applying lists is allowed.
Returns
boolean
isBulletedList()
isBulletedList(): boolean;
Indicates if the current paragraph or selected paragraphs are bulleted list.
Returns
boolean
isIndentationEnabled()
isIndentationEnabled(): boolean;
Indicates if indentation is allowed.
Returns
boolean
isIndentationHidden()
isIndentationHidden(): boolean;
Indicates if indentation is applyable.
Returns
boolean
isNumberedList()
isNumberedList(): boolean;
Indicates if the current paragraph or selected paragraphs are numbered list.
Returns
boolean
processKeyEvent()
processKeyEvent(e): Promise<boolean>;
Handles keyboard input events.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | IKeyboardEvent | keyboard event. |
Returns
Promise<boolean>
true if changes were made, false otherwise.
processMouseEvent()
processMouseEvent(e): void;
Handles mouse input events.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | IMouseEvent | mouse event. |
Returns
void
processZoomChangedEvent()
processZoomChangedEvent(): Promise<boolean>;
Handles canvas zoom changed event.
Returns
Promise<boolean>
true if event was processed, false if the text editor is not ready yet.
redo()
redo(): void;
Redoes an action.
Returns
void
redraw()
redraw(): void;
Returns
void
setFontRegistry()
setFontRegistry(fontRegistry): any;
Parameters
| Parameter | Type |
|---|---|
fontRegistry | IFontRegistry |
Returns
any
setInlineStyle()
setInlineStyle(style): Promise<void>;
Sets the character style for the current cursor position or selected text.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | ICharStyle | expected character style. |
Returns
Promise<void>
Remarks
only properties specified in the expected style are set.
setParagraphStyle()
setParagraphStyle(style): Promise<void>;
Sets the paragraph style for the current cursor position or selected text.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | IParagraphStyle | expected paragraph style. |
Returns
Promise<void>
Remarks
only properties specified in the expected style are set.
undo()
undo(): void;
Undoes an action.
Returns
void
ITextEditorElementHandler
Properties
textEditorDiv
textEditorDiv: HTMLElement;
textEditorInnerDiv
textEditorInnerDiv: HTMLElement;
Methods
addTextEditorStyles()
addTextEditorStyles(css): void;
Parameters
| Parameter | Type |
|---|---|
css | string |
Returns
void
getTextEditorFormattedText()
getTextEditorFormattedText(): string;
Returns
string
hideTextEditor()
hideTextEditor(): any;
Returns
any
showTextEditor()
showTextEditor(
rectangle,
textAlignment,
html,
borderWidth,
borderColor,
fillColor,
opacity,
verticalAlignment,
isVertical): void;
Parameters
| Parameter | Type |
|---|---|
rectangle | RotatedRectangleF |
textAlignment | TextAlignment |
html | string |
borderWidth | number |
borderColor | string |
fillColor | string |
opacity | number |
verticalAlignment | TextVerticalAlignment |
isVertical | boolean |
Returns
void
Type Aliases
EditorInitData
type EditorInitData = object;
Properties
borderColor?
optional borderColor?: string;
borderWidth?
optional borderWidth?: number;
defaultInlineStyle?
optional defaultInlineStyle?: ICharStyle;
defaultParagraphStyle?
optional defaultParagraphStyle?: IParagraphStyle;
fillColor?
optional fillColor?: string;
isVertical?
optional isVertical?: boolean;
limits?
optional limits?: ITextLimits;
listSettings
listSettings: IListConfiguration;
newLineEnabled?
optional newLineEnabled?: boolean;
opacity?
optional opacity?: number;
point?
optional point?: IPoint;
previewScale?
optional previewScale?: number;
rectangle?
optional rectangle?: RotatedRectangleF;
text?
optional text?: string;
textAlignment?
optional textAlignment?: TextAlignment;
textFormattingEnabled?
optional textFormattingEnabled?: boolean;
textVerticalAlignment?
optional textVerticalAlignment?: TextVerticalAlignment;
transform?
optional transform?: Transform;