Skip to main content

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​
ParameterTypeDescription
rangeITextRangetext range.
Returns​

void

getCharStyleForCurrentPosition()​
getCharStyleForCurrentPosition(): ICharStyle;

Returns the character style for the current cursor position.

Returns​

ICharStyle

getCharStyleForPosition()​
getCharStyleForPosition(position): ICharStyle;

Returns the character style by position.

Parameters​
ParameterTypeDescription
positionIPositionInTextposition in text.
Returns​

ICharStyle

getCharStyleForRange()​
getCharStyleForRange(range): ICharStyle;

Returns the character style for a text range.

Parameters​
ParameterTypeDescription
rangeITextRangetext range.
Returns​

ICharStyle

getDefaultCharStyle()​
getDefaultCharStyle(): ICharStyle;

Returns the default character style.

Returns​

ICharStyle

getDefaultParagraphStyle()​
getDefaultParagraphStyle(): IParagraphStyle;

Returns the default paragraph style.

Returns​

IParagraphStyle

getParagraphStyleByIndex()​
getParagraphStyleByIndex(index): IParagraphStyle;

Returns the paragraph style by index.

Parameters​
ParameterTypeDescription
indexnumberparagraph index (from 0).
Returns​

IParagraphStyle

getParagraphStyleForCurrentPosition()​
getParagraphStyleForCurrentPosition(): IParagraphStyle;

Returns the paragraph style for the current cursor position.

Returns​

IParagraphStyle

getParagraphStyleForRange()​
getParagraphStyleForRange(range): IParagraphStyle;

Returns the paragraph style for a text range.

Parameters​
ParameterTypeDescription
rangeITextRangetext range.
Returns​

IParagraphStyle

setCharStyleForCurrentPosition()​
setCharStyleForCurrentPosition(style): void;

Sets the character style for the current cursor position (patch).

Parameters​
ParameterTypeDescription
styleICharStyleexpected 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​
ParameterTypeDescription
positionIPositionInTextposition in text.
styleICharStylecharacter 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​
ParameterTypeDescription
styleICharStylecharacter style.
rangeITextRangetext 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​
ParameterTypeDescription
styleICharStylecharacter style.
Returns​

void

setDefaultParagraphStyle()​
setDefaultParagraphStyle(style): void;

Sets the default paragraph style.

Parameters​
ParameterTypeDescription
styleIParagraphStyleparagraph style.
Returns​

void

setParagraphStyleByIndex()​
setParagraphStyleByIndex(index, style): void;

Sets the paragraph style for the current cursor position (patch).

Parameters​
ParameterTypeDescription
indexnumberparagraph index (from 0).
styleIParagraphStyleexpected paragraph style.
Returns​

void

setParagraphStyleForCurrentPosition()​
setParagraphStyleForCurrentPosition(style): void;

Sets the paragraph style for the current cursor position (patch).

Parameters​
ParameterTypeDescription
styleIParagraphStyleexpected 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​
ParameterTypeDescription
styleIParagraphStyleparagraph style.
rangeITextRangetext range.
Returns​

void

Remarks​

Only those properties that are specified in expected style are set.

Was this page helpful?