IStyleHandler
Interfaces
IStyleHandler
Handler for performing simple operations with paragraph and character styles.
Properties
styleChangeEvent
styleChangeEvent: EventObject<void>;
Character or paragraph style change event.
Methods
clearFormatForCurrentPosition()
clearFormatForCurrentPosition(): void;
Clears the character style for the current cursor position.
Returns
void
clearFormatForRange()
clearFormatForRange(range): void;
Clears the character style for the text range.
Parameters
| Parameter | Type | Description |
|---|---|---|
range | ITextRange | text range. |
Returns
void
getCharStyleForCurrentPosition()
getCharStyleForCurrentPosition(): ICharStyle;
Returns the character style for the current cursor position.
Returns
getCharStyleForPosition()
getCharStyleForPosition(position): ICharStyle;
Returns the character style by position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | position in text. |
Returns
getCharStyleForRange()
getCharStyleForRange(range): ICharStyle;
Returns the character style for a text range.
Parameters
| Parameter | Type | Description |
|---|---|---|
range | ITextRange | text range. |
Returns
getDefaultCharStyle()
getDefaultCharStyle(): ICharStyle;
Returns the default character style.
Returns
getDefaultParagraphStyle()
getDefaultParagraphStyle(): IParagraphStyle;
Returns the default paragraph style.
Returns
getParagraphStyleByIndex()
getParagraphStyleByIndex(index): IParagraphStyle;
Returns the paragraph style by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | paragraph index (from 0). |
Returns
getParagraphStyleForCurrentPosition()
getParagraphStyleForCurrentPosition(): IParagraphStyle;
Returns the paragraph style for the current cursor position.
Returns
getParagraphStyleForRange()
getParagraphStyleForRange(range): IParagraphStyle;
Returns the paragraph style for a text range.
Parameters
| Parameter | Type | Description |
|---|---|---|
range | ITextRange | text range. |
Returns
setCharStyleForCurrentPosition()
setCharStyleForCurrentPosition(style): void;
Sets the character style for the current cursor position (patch).
Parameters
| Parameter | Type | Description |
|---|---|---|
style | ICharStyle | expected character style. |
Returns
void
Remarks
Only those properties that are specified in expected style are set.
setCharStyleForPosition()
setCharStyleForPosition(position, style): void;
Sets the character style by position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | position in text. |
style | ICharStyle | character style. |
Returns
void
Remarks
Only those properties that are specified in expected style are set.
setCharStyleForRange()
setCharStyleForRange(style, range): void;
Sets the character style for a text range (patch).
Parameters
| Parameter | Type | Description |
|---|---|---|
style | ICharStyle | character style. |
range | ITextRange | text range. |
Returns
void
Remarks
Only those properties that are specified in expected style are set.
setDefaultCharStyle()
setDefaultCharStyle(style): void;
Sets the default character style.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | ICharStyle | character style. |
Returns
void
setDefaultParagraphStyle()
setDefaultParagraphStyle(style): void;
Sets the default paragraph style.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | IParagraphStyle | paragraph style. |
Returns
void
setParagraphStyleByIndex()
setParagraphStyleByIndex(index, style): void;
Sets the paragraph style for the current cursor position (patch).
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | paragraph index (from 0). |
style | IParagraphStyle | expected paragraph style. |
Returns
void
setParagraphStyleForCurrentPosition()
setParagraphStyleForCurrentPosition(style): void;
Sets the paragraph style for the current cursor position (patch).
Parameters
| Parameter | Type | Description |
|---|---|---|
style | IParagraphStyle | expected paragraph style. |
Returns
void
Remarks
Only those properties that are specified in expected style are set.
setParagraphStyleForRange()
setParagraphStyleForRange(style, range): void;
Sets the paragraph style for a text range (patch).
Parameters
| Parameter | Type | Description |
|---|---|---|
style | IParagraphStyle | paragraph style. |
range | ITextRange | text range. |
Returns
void
Remarks
Only those properties that are specified in expected style are set.