Back to Website
Show / Hide Table of Contents

Class StyleHandler

Handler for performing simple operations with paragraph and character styles.

Package: @aurigma/design-atoms-text
Remarks

the TextWhizz is used as a text engine.

Constructors

(constructor)(tw, colorPreviewService)

Constructs a new instance of the StyleHandler class

Declaration
constructor(tw: ITextWhizzHolder, colorPreviewService: IColorPreviewService);
Parameters
Type Name Description
ITextWhizzHolder tw
IColorPreviewService colorPreviewService

Properties

colorPalette

Declaration
get colorPalette(): IColorPalette;
Property Value
Type Description
IColorPalette

isInitialized

Declaration
get isInitialized(): boolean;
Property Value
Type Description
boolean

styleChangeEvent

Character or paragraph style change event.

Declaration
get styleChangeEvent(): EventObject<void>;
Property Value
Type Description
EventObject<void>

Character or paragraph style change event.

Methods

clearFormatForCurrentPosition()

Declaration
clearFormatForCurrentPosition(): void;
Returns
Type Description
void

clearFormatForRange(textRange)

Declaration
clearFormatForRange(textRange: ITextRange): void;
Parameters
Type Name Description
ITextRange textRange
Returns
Type Description
void

getCharStyleForCurrentPosition()

Declaration
getCharStyleForCurrentPosition(): ICharStyle;
Returns
Type Description
ICharStyle

getCharStyleForPosition(position)

Declaration
getCharStyleForPosition(position: IPositionInText): ICharStyle;
Parameters
Type Name Description
IPositionInText position
Returns
Type Description
ICharStyle

getCharStyleForRange(range)

Declaration
getCharStyleForRange(range: ITextRange): ICharStyle | null;
Parameters
Type Name Description
ITextRange range
Returns
Type Description
ICharStyle | null

getDefaultCharStyle()

Declaration
getDefaultCharStyle(): ICharStyle;
Returns
Type Description
ICharStyle

getDefaultParagraphStyle()

Declaration
getDefaultParagraphStyle(): IParagraphStyle;
Returns
Type Description
IParagraphStyle

getParagraphStyleByIndex(index)

Declaration
getParagraphStyleByIndex(index: number): IParagraphStyle;
Parameters
Type Name Description
number index
Returns
Type Description
IParagraphStyle

getParagraphStyleForCurrentPosition()

Declaration
getParagraphStyleForCurrentPosition(): IParagraphStyle;
Returns
Type Description
IParagraphStyle

getParagraphStyleForRange(range)

Declaration
getParagraphStyleForRange(range: ITextRange): IParagraphStyle;
Parameters
Type Name Description
ITextRange range
Returns
Type Description
IParagraphStyle

initialize(colorPalette)

Declaration
initialize(colorPalette: Collection<IColorData>): void;
Parameters
Type Name Description
Collection<IColorData> colorPalette
Returns
Type Description
void

setCharStyleForCurrentPosition(style)

Declaration
setCharStyleForCurrentPosition(style: ICharStyle): void;
Parameters
Type Name Description
ICharStyle style
Returns
Type Description
void

setCharStyleForPosition(position, style)

Declaration
setCharStyleForPosition(position: IPositionInText, style: ICharStyle): void;
Parameters
Type Name Description
IPositionInText position
ICharStyle style
Returns
Type Description
void

setCharStyleForRange(style, range)

Declaration
setCharStyleForRange(style: ICharStyle, range: ITextRange): void;
Parameters
Type Name Description
ICharStyle style
ITextRange range
Returns
Type Description
void

setDefaultCharStyle(style)

Declaration
setDefaultCharStyle(style: ICharStyle): void;
Parameters
Type Name Description
ICharStyle style
Returns
Type Description
void

setDefaultParagraphStyle(style)

Declaration
setDefaultParagraphStyle(style: IParagraphStyle): void;
Parameters
Type Name Description
IParagraphStyle style
Returns
Type Description
void

setParagraphStyleByIndex(index, style)

Declaration
setParagraphStyleByIndex(index: number, style: IParagraphStyle): void;
Parameters
Type Name Description
number index
IParagraphStyle style
Returns
Type Description
void

setParagraphStyleForCurrentPosition(style)

Declaration
setParagraphStyleForCurrentPosition(style: IParagraphStyle): void;
Parameters
Type Name Description
IParagraphStyle style
Returns
Type Description
void

setParagraphStyleForRange(style, range)

Declaration
setParagraphStyleForRange(style: IParagraphStyle, range: ITextRange): void;
Parameters
Type Name Description
IParagraphStyle style
ITextRange range
Returns
Type Description
void
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2024 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback