NativeCommandManager

Properties

Link copied to clipboard
open override val state: UndoState

Functions

Link copied to clipboard
open override fun beginGesture(description: String, origin: MutationOrigin = MutationOrigin.User, batching: StepEventBatching = StepEventBatching.PerCommand): UndoResult

A gesture is a step that coalesces adjacent commands sharing a command id: intermediate values are applied, but history keeps only the first and the last.

Link copied to clipboard
open override fun beginStep(description: String, origin: MutationOrigin = MutationOrigin.User, batching: StepEventBatching = StepEventBatching.PerCommand): UndoResult

Opens one named history step spanning several commands. Commands performed while it is open are applied immediately but enter history as one entry only when endStep succeeds. Nested steps are deliberately rejected.

Link copied to clipboard
open override fun cancelGesture(completion: (UndoResult) -> Unit? = null)
Link copied to clipboard
open override fun cancelStep(completion: (UndoResult) -> Unit? = null)

Reverts every child that already ran, in reverse order.

Link copied to clipboard
open override fun clear(markCurrentStateSaved: Boolean = true): Boolean

Releases every retained revert and makes the current document a new history root. Fails while a command is pending or a step is open.

Link copied to clipboard
open override fun endGesture(completion: (UndoResult) -> Unit? = null)
Link copied to clipboard
open override fun endStep(completion: (UndoResult) -> Unit? = null)
Link copied to clipboard
open override fun markSaved(): Boolean

Save points and retention. What "dirty" means belongs to the history, not to whoever writes the file: a numeric cursor cannot tell an undo followed by a fresh edit from the state that was saved.

Link copied to clipboard
open override fun markStateSaved(stateId: Long): Boolean
Link copied to clipboard
open override fun redo(completion: (UndoResult) -> Unit? = null)
Link copied to clipboard
open override fun setMaximumHistorySizeInBytes(bytes: Long): Boolean
Link copied to clipboard
open override fun shutdown()

Refuses new work and completes pending notification as Cancelled.

Link copied to clipboard
open override fun undo(completion: (UndoResult) -> Unit? = null)