logo

mixin

fwt::RichTextModel

sys::Obj
  fwt::RichTextModel

RichTextModel models the document and styling of a RichText document.

Slots

charCount

abstract Int charCount()

Return the number of characters in the content.

Source

line

abstract Str line(Int lineIndex)

Return the line at the given zero based line index without delimiters.

Source

lineAtOffset

abstract Int lineAtOffset(Int offset)

Return the zero based line index at the given character offset.

Source

lineCount

abstract Int lineCount()

Return the number of lines.

Source

lineDelimiter

virtual Str lineDelimiter()

Return the line delimiter that should be used when inserting new lines. The default is "\n".

Source

lineStyles

virtual Obj[] lineStyles(Int lineIndex)

Return the styled segments for the given zero based line index. The result is a list of Int/RichTextStyle pairs where the Int specifies a zero based char offset of the line.

Source

offsetAtLine

abstract Int offsetAtLine(Int lineIndex)

Return the character offset of the first character of the given zero based line index.

Source

replaceTextRange

abstract Void replaceTextRange(Int start, Int replaceLen, Str newText)

Replace the text with newText starting at position start for a length of replaceLen.

Source

text

abstract Str text

Get or set the entire text document.

Source

textRange

abstract Str textRange(Int start, Int len)

Returns a string representing the content at the given range.

Source