Skip to main content

UndoManagerClient

Trait UndoManagerClient 

Source
pub trait UndoManagerClient: Sized + 'static {
    // Required methods
    fn handle_platform_undo(
        self: Handle<Self>,
        app: &mut App,
        direction: UndoDirection,
    );
    fn undo(self: Handle<Self>, app: &mut App);
    fn redo(self: Handle<Self>, app: &mut App);
    fn can_undo(self: Handle<Self>, app: &App) -> bool;
    fn can_redo(self: Handle<Self>, app: &App) -> bool;

    // Provided method
    fn as_undo_manager_client(self: Handle<Self>) -> AnyUndoManagerClient { ... }
}
Expand description

An interface to receive events from a native UndoManager.

Dart’s mixin UndoManagerClient.

Required Methods§

Source

fn handle_platform_undo( self: Handle<Self>, app: &mut App, direction: UndoDirection, )

Requests that the client perform an undo or redo operation.

Currently only used on iOS 9+ when the undo or redo methods are invoked by the platform. For example, when using three-finger swipe gestures, the iPad keyboard, or voice control.

Source

fn undo(self: Handle<Self>, app: &mut App)

Reverts the value on the stack to the previous value.

Source

fn redo(self: Handle<Self>, app: &mut App)

Updates the value on the stack to the next value.

Source

fn can_undo(self: Handle<Self>, app: &App) -> bool

Will be true if there are past values on the stack.

Source

fn can_redo(self: Handle<Self>, app: &App) -> bool

Will be true if there are future values on the stack.

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§