Back to API Reference
Interface
ITextDocument
abstract
Read-only view of a text document with codepoint-indexed access. Implemented by UniTextEditable; consumed by generic text-aware features (find / replace, validators, accessibility readers) that should not depend on the concrete editor type.
Implementations(2)
Types that implement ITextDocument.
CC
Rope
The document: a flat table of TextBlock leaves with indexes over chars, codepoints, paragraph separators, heights and line widths. Every position query — char↔codepoint, char↔paragraph, Y↔block, X↔block — is O(log blocks); an edit costs O(edited block) plus O(log blocks), or O(blocks) when it changes the block count. Blocks lent to workers through Lease are immutable for the lease's lifetime: an edit clones a shared block instead of mutating it.
UniTextEditable
Editing capability for UniTextSelectable: text storage (gap buffer), undo/redo, IME composition, validators, caret rendering, input intents, touch gesture pipeline, keyboard / clipboard handling, and the public mutation API (InsertText, Cut/Copy/Paste, Undo/Redo, etc.).
public abstract int CopyCodepointRange(int startCodepoint, int codepointCount, Span<char> destination)Copies codepointCount codepoints starting at startCodepoint into destination. Returns the number of UTF-16 chars written.
