RichTextKit v0.4

TextDocument Class

Assembly: Topten.RichTextKit.dll
Namespace: Topten.RichTextKit.Editor

Represents a the document part of a Document/View editor

public class TextDocument

Inheritance

TextDocument → object

Constructors

TextDocument()

Constructs a new TextDocument

Properties

DefaultAlignment

Gets the default alignment for paragraphs in this document

DefaultStyle

Specifies the style to be used in plain text mode

ImeCompositionOffset

Get the code point offset position of the current IME composition

IsImeComposing

Indicates if an IME composition is currently in progress

Length

Gets the total length of the document in code points

LineWrap

Indicates if text should be wrapped

MarginBottom

The document's bottom margin

MarginLeft

The document's left margin

MarginRight

The document's right margin

MarginTop

The document's top margin

MeasuredContentWidth

The total width of the content of the document

MeasuredHeight

The total height of the document

MeasuredOverhang

Gets the actual measured overhang in each direction based on the fonts used, and the supplied text.

MeasuredWidth

The total width of the document

PageWidth

Specifies the page width of the document

PlainTextMode

Specifies if the document is in plain text mode

SingleLineMode

Specifies if the document is in single line mode

Text

Get/set the entire document text

UndoManager

Get the undo manager for this document

Methods

Extract(Topten.RichTextKit.TextRange)

Get the text for a part of the document

FinishImeComposition(ITextDocumentView)

Complete an IME composition

GetCaretInfo(Topten.RichTextKit.CaretPosition)

Calculates useful information for displaying a caret

GetOvertypeRange(Topten.RichTextKit.TextRange)

Gets the range of text that will be overwritten by overtype mode at a particular location in the document

GetSelectionRange(Topten.RichTextKit.CaretPosition, SelectionKind)

Given a caret position, find an enclosing selection range for the current word, line, paragraph or document

GetStyleAtOffset(int)

Get the style of the text at a specified code point index

GetText(Topten.RichTextKit.TextRange)

Get the text for a part of the document

HitTest(float, float)

Hit test this string

Navigate(Topten.RichTextKit.CaretPosition, NavigationKind, float, ref Nullable<float>)

Handles keyboard navigation events

Paint(SkiaSharp.SKCanvas, float, float, Topten.RichTextKit.TextPaintOptions)

Paint this text block

Redo(ITextDocumentView)

Redo the undone edit operations

RegisterView(ITextDocumentView)

Registers a new view to receive notifications of changes to the document

ReplaceText(ITextDocumentView, Topten.RichTextKit.TextRange, Topten.RichTextKit.StyledText, EditSemantics)

Replaces a range of text with the specified text

ReplaceText(ITextDocumentView, Topten.RichTextKit.TextRange, string, EditSemantics, Topten.RichTextKit.IStyle)

Replaces a range of text with the specified text

ReplaceText(ITextDocumentView, Topten.RichTextKit.TextRange, Topten.RichTextKit.Utils.Slice<int>, EditSemantics, Topten.RichTextKit.IStyle)

Replaces a range of text with the specified text

RevokeView(ITextDocumentView)

Revokes a previously registered view

SetMargins(float, float, float, float)

Set the document margins

StartImeComposition(ITextDocumentView, Topten.RichTextKit.TextRange)

Starts and IME composition action

Undo(ITextDocumentView)

Undo the last editor operation

UpdateImeComposition(ITextDocumentView, Topten.RichTextKit.StyledText, int)

Update a pending IME composition