Trait LocalUndo
pub trait LocalUndo {
// Required method
fn handle_local_undo_request(&mut self, request: UndoRequest) -> bool;
// Provided methods
fn local_undo_status(&self) -> Option<LocalUndoStatus> { ... }
fn local_undo_is_deferred(&self) -> bool { ... }
fn start_local_undo_operation(
&mut self,
_invocation: InvocationId,
_request: UndoRequest,
) -> Result<bool, String> { ... }
fn poll_local_undo_operation(
&mut self,
_invocation: InvocationId,
_cancellation_requested: bool,
) -> Option<InvocationUpdate> { ... }
}Expand description
A component with its own editing history, offered the host’s keyboard undo/redo shortcut before the application document consumes it.
Required Methods§
fn handle_local_undo_request(&mut self, request: UndoRequest) -> bool
fn handle_local_undo_request(&mut self, request: UndoRequest) -> bool
true only while focus is inside the component and it consumed the
request.
Provided Methods§
fn local_undo_status(&self) -> Option<LocalUndoStatus>
fn local_undo_status(&self) -> Option<LocalUndoStatus>
None means this component does not own the focused history. Pending means it owns it, but cannot currently advertise an available entry.
fn local_undo_is_deferred(&self) -> bool
fn local_undo_is_deferred(&self) -> bool
True when exported Edit operations complete through Widget’s existing asynchronous operation receipts rather than on shortcut dispatch.
fn start_local_undo_operation(
&mut self,
_invocation: InvocationId,
_request: UndoRequest,
) -> Result<bool, String>
fn start_local_undo_operation( &mut self, _invocation: InvocationId, _request: UndoRequest, ) -> Result<bool, String>
Admit a deferred system Edit request without exposing the host’s raw
operation protocol to apps. True means queued, never already succeeded.
The component retains this invocation and reports its actual native ACK
through poll_local_undo_operation. Required hosted custody continues to
be declined by the generic adapter; this interface supplies no grant.
§Errors
Returns the original field’s admission refusal.
fn poll_local_undo_operation(
&mut self,
_invocation: InvocationId,
_cancellation_requested: bool,
) -> Option<InvocationUpdate>
fn poll_local_undo_operation( &mut self, _invocation: InvocationId, _cancellation_requested: bool, ) -> Option<InvocationUpdate>
Complete only this component’s previously admitted native Edit request. A lost ACK must fail explicitly; it must not become document Undo.