
RichTextModel models the document and styling of a RichText
document.
Slots
- charCount
-
abstract Int charCount()
Return the number of characters in the content.
- line
-
abstract Str line(Int lineIndex)
Return the line at the given zero based line index without delimiters.
- lineAtOffset
-
abstract Int lineAtOffset(Int offset)
Return the zero based line index at the given character offset.
- lineCount
-
abstract Int lineCount()
Return the number of lines.
- lineDelimiter
-
virtual Str lineDelimiter()
Return the line delimiter that should be used when inserting new lines. The default is "\n".
- 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.
- offsetAtLine
-
abstract Int offsetAtLine(Int lineIndex)
Return the character offset of the first character of the given zero based line index.
- replaceTextRange
-
abstract Void replaceTextRange(Int start, Int replaceLen, Str newText)
Replace the text with
newText
starting at positionstart
for a length ofreplaceLen
. - text
-
abstract Str text
Get or set the entire text document.
- textRange
-
abstract Str textRange(Int start, Int len)
Returns a string representing the content at the given range.