pub struct CallbackInfo { /* private fields */ }Expand description
CallbackInfo is a lightweight wrapper around pointers to stack-local data. It can be safely copied because it only contains pointers - the underlying data lives on the stack and outlives the callback invocation. This allows callbacks to “consume” CallbackInfo by value while the caller retains access to the same underlying data.
The changes field uses a pointer to Arc<Mutex<…>> so that cloned CallbackInfo instances
(e.g., passed to timer callbacks) still push changes to the original collection,
while keeping CallbackInfo as Copy.
Implementations§
Source§impl CallbackInfo
impl CallbackInfo
pub fn new<'a>( ref_data: &'a CallbackInfoRefData<'a>, changes: &'a Arc<Mutex<Vec<CallbackChange>>>, hit_dom_node: DomNodeId, cursor_relative_to_item: OptionLogicalPosition, cursor_in_viewport: OptionLogicalPosition, ) -> Self
Sourcepub fn get_ctx(&self) -> OptionRefAny
pub fn get_ctx(&self) -> OptionRefAny
Get the callable for FFI language bindings (Python, etc.)
Returns the cloned OptionRefAny if a callable was set, or None if this is a native Rust callback.
Sourcepub fn get_gl_context(&self) -> OptionGlContextPtr
pub fn get_gl_context(&self) -> OptionGlContextPtr
Returns the OpenGL context if available
Sourcepub fn push_change(&mut self, change: CallbackChange)
pub fn push_change(&mut self, change: CallbackChange)
Push a change to be applied after the callback returns This is the primary method for modifying window state from callbacks
Sourcepub fn get_changes_ptr(&self) -> *const ()
pub fn get_changes_ptr(&self) -> *const ()
Debug helper to get the changes pointer for debugging
Sourcepub fn take_changes(&self) -> Vec<CallbackChange>
pub fn take_changes(&self) -> Vec<CallbackChange>
Get the collected changes (consumes them from the Arc
Sourcepub fn has_pending_relayout_change(&self) -> bool
pub fn has_pending_relayout_change(&self) -> bool
Check if pending changes require relayout before the next step.
Returns true for ModifyWindowState (resize) and ScrollTo (scroll),
which both need the event loop to re-run layout so that subsequent
operations (like take_screenshot) see updated content.
Used by the E2E test runner to detect when it needs to yield.
Sourcepub fn add_timer(&mut self, timer_id: TimerId, timer: Timer)
pub fn add_timer(&mut self, timer_id: TimerId, timer: Timer)
Add a timer to this window (applied after callback returns)
Sourcepub fn remove_timer(&mut self, timer_id: TimerId)
pub fn remove_timer(&mut self, timer_id: TimerId)
Remove a timer from this window (applied after callback returns)
Sourcepub fn add_thread(&mut self, thread_id: ThreadId, thread: Thread)
pub fn add_thread(&mut self, thread_id: ThreadId, thread: Thread)
Add a thread to this window (applied after callback returns)
Sourcepub fn remove_thread(&mut self, thread_id: ThreadId)
pub fn remove_thread(&mut self, thread_id: ThreadId)
Remove a thread from this window (applied after callback returns)
Sourcepub fn stop_propagation(&mut self)
pub fn stop_propagation(&mut self)
Stop event propagation (applied after callback returns)
W3C stopPropagation(): remaining handlers on the current node
still fire, but no handlers on ancestor/descendant nodes are called.
Sourcepub fn stop_immediate_propagation(&mut self)
pub fn stop_immediate_propagation(&mut self)
Stop event propagation immediately (applied after callback returns)
W3C stopImmediatePropagation(): no further handlers fire,
not even remaining handlers registered on the same node.
Sourcepub fn set_focus(&mut self, target: FocusTarget)
pub fn set_focus(&mut self, target: FocusTarget)
Set keyboard focus target (applied after callback returns)
Sourcepub fn create_window(&mut self, options: WindowCreateOptions)
pub fn create_window(&mut self, options: WindowCreateOptions)
Create a new window (applied after callback returns)
Sourcepub fn close_window(&mut self)
pub fn close_window(&mut self)
Close the current window (applied after callback returns)
Sourcepub fn switch_route(&mut self, pattern: AzString, params: StringPairVec)
pub fn switch_route(&mut self, pattern: AzString, params: StringPairVec)
Switch to a different route (applied after callback returns).
On desktop: swaps the layout callback and triggers RefreshDom.
On web: also calls history.pushState().
§C API
AzCallbackInfo_switchRoute(&info, AzString_fromConstStr("/user/:id"),
AzStringPairVec_fromConstSlice(&[AzStringPair { key: "id", value: "42" }]));Sourcepub fn get_route_pattern(&self) -> AzString
pub fn get_route_pattern(&self) -> AzString
Get the current active route pattern (e.g. "/user/:id").
Returns empty string if no route is active.
§C API
AzString pattern = AzCallbackInfo_getRoutePattern(&info);Sourcepub fn get_route_param(&self, key: AzString) -> AzString
pub fn get_route_param(&self, key: AzString) -> AzString
Get a route parameter by key (e.g. "id" from /user/:id).
Returns empty string if the parameter doesn’t exist or no route is active.
§C API
AzString id = AzCallbackInfo_getRouteParam(&info, AzString_fromConstStr("id"));Sourcepub fn set_route_param(&mut self, key: AzString, value: AzString)
pub fn set_route_param(&mut self, key: AzString, value: AzString)
Set a route parameter value and trigger re-render.
This modifies the active route’s params in-place and triggers a DOM refresh.
On web, this also updates the URL via history.replaceState().
§C API
AzCallbackInfo_setRouteParam(&info, AzString_fromConstStr("id"), AzString_fromConstStr("99"));Sourcepub fn modify_window_state(&mut self, state: FullWindowState)
pub fn modify_window_state(&mut self, state: FullWindowState)
Modify the window state (applied after callback returns)
Sourcepub fn begin_interactive_move(&mut self)
pub fn begin_interactive_move(&mut self)
Request the compositor to begin an interactive window move.
On Wayland: calls xdg_toplevel_move(toplevel, seat, serial) which lets
the compositor handle the move. This is the only way to move windows on Wayland.
On other platforms: this is a no-op; use modify_window_state() to set position.
Sourcepub fn queue_window_state_sequence(&mut self, states: Vec<FullWindowState>)
pub fn queue_window_state_sequence(&mut self, states: Vec<FullWindowState>)
Queue multiple window state changes to be applied in sequence. Each state triggers a separate event processing cycle, which is needed for simulating clicks where mouse down and mouse up must be separate events.
Sourcepub fn change_node_text(&mut self, node_id: DomNodeId, text: AzString)
pub fn change_node_text(&mut self, node_id: DomNodeId, text: AzString)
Change the text content of a node (applied after callback returns)
This method was previously called set_string_contents in older API versions.
§Arguments
node_id- The text node to modify (DomNodeId containing both DOM and node IDs)text- The new text content
Sourcepub fn change_node_image(
&mut self,
dom_id: DomId,
node_id: NodeId,
image: ImageRef,
update_type: UpdateImageType,
)
pub fn change_node_image( &mut self, dom_id: DomId, node_id: NodeId, image: ImageRef, update_type: UpdateImageType, )
Change the image of a node (applied after callback returns)
Sourcepub fn update_image_callback(&mut self, dom_id: DomId, node_id: NodeId)
pub fn update_image_callback(&mut self, dom_id: DomId, node_id: NodeId)
Re-render an image callback (for resize/animation updates)
This triggers re-invocation of the RenderImageCallback associated with the node. Useful for:
- Responding to window resize (image needs to match new size)
- Animation frames (update OpenGL texture each frame)
- Interactive content (user input changes rendering)
Sourcepub fn update_all_image_callbacks(&mut self)
pub fn update_all_image_callbacks(&mut self)
Re-render ALL image callbacks across all DOMs (applied after callback returns)
This is the most efficient way to update animated GL textures.
Unlike returning Update::RefreshDom, this triggers only:
- Re-invocation of all
RenderImageCallbackfunctions - GL texture swap in WebRender
It does NOT trigger:
- DOM rebuild (no
layout()callback) - Display list resubmission (WebRender reuses existing scene)
- Relayout
Ideal for timer callbacks that animate OpenGL content at 60fps.
Sourcepub fn trigger_virtual_view_rerender(&mut self, dom_id: DomId, node_id: NodeId)
pub fn trigger_virtual_view_rerender(&mut self, dom_id: DomId, node_id: NodeId)
Trigger re-rendering of a VirtualView (applied after callback returns)
This forces the VirtualView to call its layout callback with reason DomRecreated
and submit a new display list to WebRender. The VirtualView’s pipeline will be updated
without affecting other parts of the window.
Useful for:
- Live preview panes (update when source code changes)
- Dynamic content that needs manual refresh
- Editor previews (re-parse and display new DOM)
Sourcepub fn get_node_id_by_id_attribute(
&self,
dom_id: DomId,
id: &str,
) -> Option<NodeId>
pub fn get_node_id_by_id_attribute( &self, dom_id: DomId, id: &str, ) -> Option<NodeId>
Find a node by ID attribute in the layout tree
Returns the NodeId of the first node with the given ID attribute, or None if not found.
Sourcepub fn get_parent_node(&self, dom_id: DomId, node_id: NodeId) -> Option<NodeId>
pub fn get_parent_node(&self, dom_id: DomId, node_id: NodeId) -> Option<NodeId>
Get the parent node of the given node
Returns None if the node has no parent (i.e., it’s the root node)
Sourcepub fn get_next_sibling_node(
&self,
dom_id: DomId,
node_id: NodeId,
) -> Option<NodeId>
pub fn get_next_sibling_node( &self, dom_id: DomId, node_id: NodeId, ) -> Option<NodeId>
Get the next sibling of the given node
Returns None if the node has no next sibling
Sourcepub fn get_previous_sibling_node(
&self,
dom_id: DomId,
node_id: NodeId,
) -> Option<NodeId>
pub fn get_previous_sibling_node( &self, dom_id: DomId, node_id: NodeId, ) -> Option<NodeId>
Get the previous sibling of the given node
Returns None if the node has no previous sibling
Sourcepub fn get_first_child_node(
&self,
dom_id: DomId,
node_id: NodeId,
) -> Option<NodeId>
pub fn get_first_child_node( &self, dom_id: DomId, node_id: NodeId, ) -> Option<NodeId>
Get the first child of the given node
Returns None if the node has no children
Sourcepub fn get_last_child_node(
&self,
dom_id: DomId,
node_id: NodeId,
) -> Option<NodeId>
pub fn get_last_child_node( &self, dom_id: DomId, node_id: NodeId, ) -> Option<NodeId>
Get the last child of the given node
Returns None if the node has no children
Sourcepub fn get_all_children_nodes(
&self,
dom_id: DomId,
node_id: NodeId,
) -> NodeHierarchyItemIdVec
pub fn get_all_children_nodes( &self, dom_id: DomId, node_id: NodeId, ) -> NodeHierarchyItemIdVec
Get all direct children of the given node
Returns an empty vector if the node has no children. Uses the contiguous node layout for efficient iteration.
Sourcepub fn get_children_count(&self, dom_id: DomId, node_id: NodeId) -> usize
pub fn get_children_count(&self, dom_id: DomId, node_id: NodeId) -> usize
Get the number of direct children of the given node
Uses the contiguous node layout for efficient counting.
Sourcepub fn change_node_image_mask(
&mut self,
dom_id: DomId,
node_id: NodeId,
mask: ImageMask,
)
pub fn change_node_image_mask( &mut self, dom_id: DomId, node_id: NodeId, mask: ImageMask, )
Change the image mask of a node (applied after callback returns)
Sourcepub fn change_node_css_properties(
&mut self,
dom_id: DomId,
node_id: NodeId,
properties: CssPropertyVec,
)
pub fn change_node_css_properties( &mut self, dom_id: DomId, node_id: NodeId, properties: CssPropertyVec, )
Change CSS properties of a node (applied after callback returns)
Sourcepub fn set_css_property(&mut self, node_id: DomNodeId, property: CssProperty)
pub fn set_css_property(&mut self, node_id: DomNodeId, property: CssProperty)
Set a single CSS property on a node (convenience method for widgets)
This is a helper method that wraps change_node_css_properties for the common case
of setting a single property. It uses the hit node’s DOM ID automatically.
§Arguments
node_id- The node to set the property on (uses hit node’s DOM ID)property- The CSS property to set
Sourcepub fn override_node_css_properties(
&mut self,
dom_id: DomId,
node_id: NodeId,
properties: CssPropertyVec,
)
pub fn override_node_css_properties( &mut self, dom_id: DomId, node_id: NodeId, properties: CssPropertyVec, )
Quickly override CSS properties on a node for animation or other
transient visual changes. Writes go through
CssPropertyCache::user_overridden_properties, which is consulted at
higher priority than the static cascade, so this does not invalidate
the styled DOM’s CSS rules. Pass CssProperty::Initial for a given
property type to remove any prior override for that type.
Sourcepub fn override_css_property(
&mut self,
node_id: DomNodeId,
property: CssProperty,
)
pub fn override_css_property( &mut self, node_id: DomNodeId, property: CssProperty, )
Convenience wrapper for override_node_css_properties that targets a
single property on the hit node’s DOM (typical for animation callbacks).
Sourcepub fn scroll_to(
&mut self,
dom_id: DomId,
node_id: NodeHierarchyItemId,
position: LogicalPosition,
)
pub fn scroll_to( &mut self, dom_id: DomId, node_id: NodeHierarchyItemId, position: LogicalPosition, )
Scroll a node to a specific position (applied after callback returns)
Sourcepub fn scroll_to_unclamped(
&mut self,
dom_id: DomId,
node_id: NodeHierarchyItemId,
position: LogicalPosition,
)
pub fn scroll_to_unclamped( &mut self, dom_id: DomId, node_id: NodeHierarchyItemId, position: LogicalPosition, )
Scroll a node to a specific position without clamping. Used by the scroll physics timer for rubber-banding/overscroll.
Sourcepub fn scroll_node_into_view(
&mut self,
node_id: DomNodeId,
options: ScrollIntoViewOptions,
)
pub fn scroll_node_into_view( &mut self, node_id: DomNodeId, options: ScrollIntoViewOptions, )
Scroll a node into view (W3C scrollIntoView API)
Scrolls the element into the visible area of its scroll container. This is the recommended way to programmatically scroll elements into view.
§Arguments
node_id- The node to scroll into viewoptions- Scroll alignment and animation options
§Note
This uses the transactional change system - the scroll is queued and applied after the callback returns. The actual scroll adjustments are calculated during change processing.
Sourcepub fn add_image_to_cache(&mut self, id: AzString, image: ImageRef)
pub fn add_image_to_cache(&mut self, id: AzString, image: ImageRef)
Add an image to the image cache (applied after callback returns)
Sourcepub fn remove_image_from_cache(&mut self, id: AzString)
pub fn remove_image_from_cache(&mut self, id: AzString)
Remove an image from the image cache (applied after callback returns)
Sourcepub fn reload_system_fonts(&mut self)
pub fn reload_system_fonts(&mut self)
Reload system fonts (applied after callback returns)
Note: This is an expensive operation that rebuilds the entire font cache
Sourcepub fn get_text_changeset(&self) -> Option<&PendingTextEdit>
pub fn get_text_changeset(&self) -> Option<&PendingTextEdit>
Get the current text changeset being processed (if any)
This allows callbacks to inspect what text input is about to be applied. Returns None if no text input is currently being processed.
Use set_text_changeset() to modify the text that will be inserted,
and prevent_default() to block the text input entirely.
Sourcepub fn set_text_changeset(&mut self, changeset: PendingTextEdit)
pub fn set_text_changeset(&mut self, changeset: PendingTextEdit)
Set/override the text changeset for the current text input operation
This allows you to modify what text will be inserted during text input events.
Typically used in combination with prevent_default() to transform user input.
§Arguments
changeset- The modified text changeset to apply
Sourcepub fn create_text_input(&mut self, text: AzString)
pub fn create_text_input(&mut self, text: AzString)
Create a synthetic text input event
This simulates receiving text input from the OS. Use this to programmatically insert text into contenteditable elements, for example from the debug server or from accessibility APIs.
The text input flow will:
- Record the text in TextInputManager (creating a PendingTextEdit)
- Generate synthetic TextInput events
- Invoke user callbacks (which can intercept/reject via preventDefault)
- Apply the changeset if not rejected
- Mark dirty nodes for re-render
§Arguments
text- The text to insert at the current cursor position
Sourcepub fn insert_child_node(
&mut self,
dom_id: DomId,
parent_node_id: NodeId,
node_type_str: AzString,
position: Option<usize>,
classes: Vec<AzString>,
id: Option<AzString>,
)
pub fn insert_child_node( &mut self, dom_id: DomId, parent_node_id: NodeId, node_type_str: AzString, position: Option<usize>, classes: Vec<AzString>, id: Option<AzString>, )
Insert a new child node into the DOM tree (applied after callback returns)
Creates a new node with the given type string and appends it as a child of the specified parent node. The node_type_str can be:
- A tag name: “div”, “p”, “span”, “button”, etc.
- Text content: “text:Hello World”
§Arguments
dom_id- The DOM to modifyparent_node_id- The parent node to insert undernode_type_str- The node type (tag name or “text:content”)position- Optional child index (None = append at end)classes- CSS classes for the new nodeid- Optional ID for the new node
Sourcepub fn delete_node(&mut self, dom_id: DomId, node_id: NodeId)
pub fn delete_node(&mut self, dom_id: DomId, node_id: NodeId)
Delete a node from the DOM tree (applied after callback returns)
Tombstones the node by setting it to an empty anonymous Div and unlinking it from the hierarchy. This preserves node ID stability (other node IDs don’t shift).
§Arguments
dom_id- The DOM containing the nodenode_id- The node to delete
Sourcepub fn set_node_ids_and_classes(
&mut self,
dom_id: DomId,
node_id: NodeId,
ids_and_classes: IdOrClassVec,
)
pub fn set_node_ids_and_classes( &mut self, dom_id: DomId, node_id: NodeId, ids_and_classes: IdOrClassVec, )
Set the IDs and classes on an existing node (applied after callback returns)
Replaces the current IDs and classes of a node with the given set.
§Arguments
dom_id- The DOM containing the nodenode_id- The node to modifyids_and_classes- The new set of IDs and classes
Sourcepub fn prevent_default(&mut self)
pub fn prevent_default(&mut self)
Prevent the default text input from being applied
When called in a TextInput callback, prevents the typed text from being inserted. Useful for custom validation, filtering, or text transformation.
Sourcepub fn set_cursor_visibility(&mut self, visible: bool)
pub fn set_cursor_visibility(&mut self, visible: bool)
Set cursor visibility state
This is primarily used internally by the cursor blink timer callback. User code typically doesn’t need to call this directly.
Sourcepub fn reset_cursor_blink(&mut self)
pub fn reset_cursor_blink(&mut self)
Reset cursor blink state on user input
This makes the cursor visible and records the current time, so the blink timer knows to keep the cursor solid for a while before blinking. Called automatically on keyboard input, but can be called manually.
Sourcepub fn start_cursor_blink_timer(&mut self)
pub fn start_cursor_blink_timer(&mut self)
Start the cursor blink timer
Called automatically when focus lands on a contenteditable element. The timer will toggle cursor visibility at ~530ms intervals.
Sourcepub fn stop_cursor_blink_timer(&mut self)
pub fn stop_cursor_blink_timer(&mut self)
Stop the cursor blink timer
Called automatically when focus leaves a contenteditable element.
Sourcepub fn scroll_active_cursor_into_view(&mut self)
pub fn scroll_active_cursor_into_view(&mut self)
Scroll the active cursor into view
This scrolls the focused text element’s cursor into the visible area of any scrollable ancestor. Called automatically after text input.
Open a menu (context menu or dropdown)
The menu will be displayed either as a native menu or a fallback DOM-based menu
depending on the window’s use_native_context_menus flag.
Uses the position specified in the menu itself.
§Arguments
menu- The menu to display
Open a menu at a specific position
§Arguments
menu- The menu to displayposition- The position where the menu should appear (overrides menu’s position)
Sourcepub fn show_tooltip(&mut self, text: AzString)
pub fn show_tooltip(&mut self, text: AzString)
Show a tooltip at the current cursor position
Displays a simple text tooltip near the mouse cursor. The tooltip will be shown using platform-specific native APIs where available.
Platform implementations:
- Windows: Uses
TOOLTIPS_CLASSWin32 control - macOS: Uses
NSPopoveror customNSWindowwith tooltip styling - X11: Creates transient window with
_NET_WM_WINDOW_TYPE_TOOLTIP - Wayland: Uses
zwlr_layer_shell_v1with overlay layer
§Arguments
text- The tooltip text to display
Sourcepub fn show_tooltip_at(&mut self, text: AzString, position: LogicalPosition)
pub fn show_tooltip_at(&mut self, text: AzString, position: LogicalPosition)
Show a tooltip at a specific position
§Arguments
text- The tooltip text to displayposition- The position where the tooltip should appear (in window coordinates)
Sourcepub fn hide_tooltip(&mut self)
pub fn hide_tooltip(&mut self)
Hide the currently displayed tooltip
Sourcepub fn insert_text(&mut self, dom_id: DomId, node_id: NodeId, text: AzString)
pub fn insert_text(&mut self, dom_id: DomId, node_id: NodeId, text: AzString)
Insert text at the current cursor position in a text node
This operation is transactional - the text will be inserted after the callback returns. If there’s a selection, it will be replaced with the inserted text.
§Arguments
dom_id- The DOM containing the text nodenode_id- The node to insert text intotext- The text to insert
Sourcepub fn move_cursor(
&mut self,
dom_id: DomId,
node_id: NodeId,
cursor: TextCursor,
)
pub fn move_cursor( &mut self, dom_id: DomId, node_id: NodeId, cursor: TextCursor, )
Move the text cursor to a specific position
§Arguments
dom_id- The DOM containing the text nodenode_id- The node containing the cursorcursor- The new cursor position
Sourcepub fn set_selection(
&mut self,
dom_id: DomId,
node_id: NodeId,
selection: Selection,
)
pub fn set_selection( &mut self, dom_id: DomId, node_id: NodeId, selection: Selection, )
Set the text selection range
§Arguments
dom_id- The DOM containing the text nodenode_id- The node containing the selectionselection- The new selection (can be a cursor or range)
Sourcepub fn add_cursor(
&mut self,
dom_id: DomId,
node_id: NodeId,
cursor: TextCursor,
) -> SelectionId
pub fn add_cursor( &mut self, dom_id: DomId, node_id: NodeId, cursor: TextCursor, ) -> SelectionId
Add an additional cursor at the specified position (for multi-cursor editing).
If a MultiCursorState already exists, the cursor is added and overlapping selections are merged. If not, a new MultiCursorState is created.
Returns the SelectionId of the new cursor.
Sourcepub fn add_selection_range(
&mut self,
dom_id: DomId,
node_id: NodeId,
range: SelectionRange,
) -> SelectionId
pub fn add_selection_range( &mut self, dom_id: DomId, node_id: NodeId, range: SelectionRange, ) -> SelectionId
Add an additional selection range (for multi-cursor editing).
Returns the SelectionId of the new selection.
Sourcepub fn remove_selection_by_id(&mut self, selection_id: SelectionId) -> bool
pub fn remove_selection_by_id(&mut self, selection_id: SelectionId) -> bool
Remove a specific selection/cursor by its stable ID.
Returns true if a selection with that ID existed and was removed.
Sourcepub fn get_multi_cursor_selections(
&self,
dom_id: &DomId,
) -> Vec<IdentifiedSelection>
pub fn get_multi_cursor_selections( &self, dom_id: &DomId, ) -> Vec<IdentifiedSelection>
Get all selections for the given DOM (read-only).
Returns a Vec of IdentifiedSelection from the MultiCursorState, or empty if no multi-cursor state exists.
Sourcepub fn get_primary_selection(
&self,
dom_id: &DomId,
) -> Option<IdentifiedSelection>
pub fn get_primary_selection( &self, dom_id: &DomId, ) -> Option<IdentifiedSelection>
Get the primary (last-added) selection from the MultiCursorState.
Sourcepub fn get_selection_count(&self, dom_id: &DomId) -> usize
pub fn get_selection_count(&self, dom_id: &DomId) -> usize
Get the number of active cursors/selections.
Open a menu positioned relative to a specific DOM node
This is useful for dropdowns, combo boxes, and context menus that should appear near a specific UI element. The menu will be positioned below the node by default.
§Arguments
menu- The menu to displaynode_id- The DOM node to position the menu relative to
§Returns
trueif the menu was queued for openingfalseif the node doesn’t exist or has no layout information
Open a menu positioned relative to the currently hit node
Convenience method for opening a menu at the element that triggered the callback.
Equivalent to open_menu_for_node(menu, info.get_hit_node()).
§Arguments
menu- The menu to display
§Returns
trueif the menu was queued for openingfalseif no node is currently hit or it has no layout information
Sourcepub fn get_layout_window(&self) -> &LayoutWindow
pub fn get_layout_window(&self) -> &LayoutWindow
Get reference to the underlying LayoutWindow for queries
This provides read-only access to layout data, node hierarchies, managers, etc. All modifications should go through CallbackChange transactions via push_change().
Sourcepub fn get_node_size(&self, node_id: DomNodeId) -> Option<LogicalSize>
pub fn get_node_size(&self, node_id: DomNodeId) -> Option<LogicalSize>
Get the logical size of a node, or None if the node doesn’t exist
Sourcepub fn get_node_position(&self, node_id: DomNodeId) -> Option<LogicalPosition>
pub fn get_node_position(&self, node_id: DomNodeId) -> Option<LogicalPosition>
Get the logical position of a node, or None if the node doesn’t exist
Sourcepub fn get_node_hit_test_bounds(
&self,
node_id: DomNodeId,
) -> Option<LogicalRect>
pub fn get_node_hit_test_bounds( &self, node_id: DomNodeId, ) -> Option<LogicalRect>
Get the hit test bounds of a node from the display list
This is more reliable than get_node_rect because the display list always contains the correct final rendered positions.
Sourcepub fn get_node_rect(&self, node_id: DomNodeId) -> Option<LogicalRect>
pub fn get_node_rect(&self, node_id: DomNodeId) -> Option<LogicalRect>
Get the bounding rectangle of a node (position + size)
This is particularly useful for menu positioning, where you need to know where a UI element is to popup a menu relative to it.
Sourcepub fn get_hit_node_rect(&self) -> Option<LogicalRect>
pub fn get_hit_node_rect(&self) -> Option<LogicalRect>
Get the bounding rectangle of the hit node
Convenience method that combines get_hit_node() and get_node_rect(). Useful for menu positioning based on the clicked element.
Sourcepub fn get_timer_ids(&self) -> TimerIdVec
pub fn get_timer_ids(&self) -> TimerIdVec
Get all timer IDs
Sourcepub fn get_thread(&self, thread_id: &ThreadId) -> Option<&Thread>
pub fn get_thread(&self, thread_id: &ThreadId) -> Option<&Thread>
Get a reference to a thread
Sourcepub fn get_thread_ids(&self) -> ThreadIdVec
pub fn get_thread_ids(&self) -> ThreadIdVec
Get all thread IDs
Sourcepub fn get_gpu_cache(&self, dom_id: &DomId) -> Option<&GpuValueCache>
pub fn get_gpu_cache(&self, dom_id: &DomId) -> Option<&GpuValueCache>
Get the GPU value cache for a specific DOM
Sourcepub fn get_layout_result(&self, dom_id: &DomId) -> Option<&DomLayoutResult>
pub fn get_layout_result(&self, dom_id: &DomId) -> Option<&DomLayoutResult>
Get a layout result for a specific DOM
Sourcepub fn get_dom_ids(&self) -> DomIdVec
pub fn get_dom_ids(&self) -> DomIdVec
Get all DOM IDs that have layout results
Sourcepub fn get_hit_node(&self) -> DomNodeId
pub fn get_hit_node(&self) -> DomNodeId
Get the DOM node that was hit by the event that triggered this callback
Sourcepub fn get_parent(&self, node_id: DomNodeId) -> Option<DomNodeId>
pub fn get_parent(&self, node_id: DomNodeId) -> Option<DomNodeId>
Get the parent of a node, skipping anonymous (table-generated) nodes
Sourcepub fn get_previous_sibling(&self, node_id: DomNodeId) -> Option<DomNodeId>
pub fn get_previous_sibling(&self, node_id: DomNodeId) -> Option<DomNodeId>
Get the previous sibling of a node, skipping anonymous nodes
Sourcepub fn get_next_sibling(&self, node_id: DomNodeId) -> Option<DomNodeId>
pub fn get_next_sibling(&self, node_id: DomNodeId) -> Option<DomNodeId>
Get the next sibling of a node, skipping anonymous nodes
Sourcepub fn get_first_child(&self, node_id: DomNodeId) -> Option<DomNodeId>
pub fn get_first_child(&self, node_id: DomNodeId) -> Option<DomNodeId>
Get the first child of a node, skipping anonymous nodes
Sourcepub fn get_last_child(&self, node_id: DomNodeId) -> Option<DomNodeId>
pub fn get_last_child(&self, node_id: DomNodeId) -> Option<DomNodeId>
Get the last child of a node, skipping anonymous nodes
Sourcepub fn get_dataset(&mut self, node_id: DomNodeId) -> Option<RefAny>
pub fn get_dataset(&mut self, node_id: DomNodeId) -> Option<RefAny>
Get the dataset (user-attached RefAny) of a node, or None if unset
Sourcepub fn get_node_id_of_root_dataset(
&mut self,
search_key: RefAny,
) -> Option<DomNodeId>
pub fn get_node_id_of_root_dataset( &mut self, search_key: RefAny, ) -> Option<DomNodeId>
Find the root-level node whose dataset matches the type of search_key
Sourcepub fn get_string_contents(&self, node_id: DomNodeId) -> Option<AzString>
pub fn get_string_contents(&self, node_id: DomNodeId) -> Option<AzString>
Get the text content of a text node, or None if the node is not a text node
Sourcepub fn get_node_tag_name(&self, node_id: DomNodeId) -> Option<AzString>
pub fn get_node_tag_name(&self, node_id: DomNodeId) -> Option<AzString>
Get the tag name of a node (e.g., “div”, “p”, “span”)
Returns the HTML tag name as a string for the given node. For text nodes, returns “text”. For image nodes, returns “img”.
Sourcepub fn get_node_attribute(
&self,
node_id: DomNodeId,
attr_name: &str,
) -> Option<AzString>
pub fn get_node_attribute( &self, node_id: DomNodeId, attr_name: &str, ) -> Option<AzString>
Get an attribute value from a node by attribute name
§Arguments
node_id- The node to queryattr_name- The attribute name (e.g., “id”, “class”, “href”, “data-custom”, “aria-label”)
Returns the attribute value if found, None otherwise. This searches the strongly-typed AttributeVec on the node.
Sourcepub fn get_node_classes(&self, node_id: DomNodeId) -> StringVec
pub fn get_node_classes(&self, node_id: DomNodeId) -> StringVec
Get all classes of a node as a vector of strings
Sourcepub fn get_node_id(&self, node_id: DomNodeId) -> Option<AzString>
pub fn get_node_id(&self, node_id: DomNodeId) -> Option<AzString>
Get the ID attribute of a node (if it has one)
Sourcepub fn get_selection(&self, _dom_id: &DomId) -> Option<&SelectionState>
pub fn get_selection(&self, _dom_id: &DomId) -> Option<&SelectionState>
Get the current selection state for a DOM (via multi_cursor)
Sourcepub fn has_selection(&self, _dom_id: &DomId) -> bool
pub fn has_selection(&self, _dom_id: &DomId) -> bool
Check if a DOM has any selection (via multi_cursor)
Sourcepub fn get_primary_cursor(&self, _dom_id: &DomId) -> Option<TextCursor>
pub fn get_primary_cursor(&self, _dom_id: &DomId) -> Option<TextCursor>
Get the primary cursor for a DOM (via multi_cursor)
Sourcepub fn get_selection_ranges(&self, _dom_id: &DomId) -> SelectionRangeVec
pub fn get_selection_ranges(&self, _dom_id: &DomId) -> SelectionRangeVec
Get all selection ranges (excludes plain cursors, via multi_cursor)
Sourcepub fn get_text_cache(&self) -> &TextLayoutCache
pub fn get_text_cache(&self) -> &TextLayoutCache
Get direct access to the text layout cache
Note: This provides direct read-only access to the text layout cache, but you need to know the CacheId for the specific text node you want. Currently there’s no direct mapping from NodeId to CacheId exposed in the public API.
For text modifications, use CallbackChange transactions:
change_node_text()for changing text contentset_selection()for setting selectionsget_selection(),get_primary_cursor()for reading selections
Future: Add NodeId -> CacheId mapping to enable node-specific layout access
Sourcepub fn get_current_window_state(&self) -> &FullWindowState
pub fn get_current_window_state(&self) -> &FullWindowState
Get full current window state (immutable reference)
Sourcepub fn get_current_window_flags(&self) -> WindowFlags
pub fn get_current_window_flags(&self) -> WindowFlags
Get current window flags
Sourcepub fn get_current_keyboard_state(&self) -> KeyboardState
pub fn get_current_keyboard_state(&self) -> KeyboardState
Get current keyboard state
Sourcepub fn get_current_mouse_state(&self) -> MouseState
pub fn get_current_mouse_state(&self) -> MouseState
Get current mouse state
Sourcepub fn get_previous_window_state(&self) -> &Option<FullWindowState>
pub fn get_previous_window_state(&self) -> &Option<FullWindowState>
Get full previous window state (immutable reference)
Sourcepub fn get_previous_window_flags(&self) -> Option<WindowFlags>
pub fn get_previous_window_flags(&self) -> Option<WindowFlags>
Get previous window flags
Sourcepub fn get_previous_keyboard_state(&self) -> Option<KeyboardState>
pub fn get_previous_keyboard_state(&self) -> Option<KeyboardState>
Get previous keyboard state
Sourcepub fn get_previous_mouse_state(&self) -> Option<MouseState>
pub fn get_previous_mouse_state(&self) -> Option<MouseState>
Get previous mouse state
pub fn get_cursor_relative_to_node(&self) -> OptionCursorNodePosition
pub fn get_cursor_relative_to_viewport(&self) -> OptionLogicalPosition
Sourcepub fn get_cursor_position_screen(&self) -> OptionScreenPosition
pub fn get_cursor_position_screen(&self) -> OptionScreenPosition
Get cursor position in virtual screen coordinates (all monitors combined).
Computed as: window_position + cursor_position_in_window.
All coordinates are in logical pixels (HiDPI-independent on macOS; on Win32
this depends on DPI-awareness mode).
The origin (0, 0) is at the top-left of the primary monitor. Y increases downward. On multi-monitor setups, coordinates may be negative for monitors to the left of or above the primary monitor.
Returns None if the cursor is outside the window or the window position
is unknown.
§Platform notes
| Platform | Accuracy |
|---|---|
| macOS | Exact (points = logical pixels) |
| Win32 | Exact when DPI-aware; approximate otherwise |
| X11 | Exact (pixels) |
| Wayland | Falls back to window-local (compositor hides global position) |
Sourcepub fn get_drag_delta(&self) -> OptionDragDelta
pub fn get_drag_delta(&self) -> OptionDragDelta
Get the drag delta in window-local coordinates.
Returns the offset from drag start to current cursor position in window-local
logical pixels. Returns None if no drag is active.
Warning: This is NOT stable during window moves (titlebar drag).
Use get_drag_delta_screen() for titlebar dragging.
Sourcepub fn get_drag_delta_screen(&self) -> OptionDragDelta
pub fn get_drag_delta_screen(&self) -> OptionDragDelta
Get the drag delta in screen coordinates.
Unlike get_drag_delta(), this is stable even when the window moves
(e.g., during titlebar drag). Returns None if no drag is active.
On Wayland: falls back to window-local delta.
Sourcepub fn get_drag_delta_screen_incremental(&self) -> OptionDragDelta
pub fn get_drag_delta_screen_incremental(&self) -> OptionDragDelta
Get the incremental (frame-to-frame) drag delta in screen coordinates.
Returns the screen-space delta between the current and previous sample (not the total delta since drag start). Use this with the current window position for robust titlebar drag:
new_pos = current_window_pos + incremental_deltaThis handles external position changes (DPI change, OS clamping, compositor
resize) that would make the initial position stale.
Returns None if no drag is active or fewer than 2 samples exist.
pub fn get_current_window_handle(&self) -> RawWindowHandle
Sourcepub fn get_system_style(&self) -> Arc<SystemStyle> ⓘ
pub fn get_system_style(&self) -> Arc<SystemStyle> ⓘ
Get the system style (for menu rendering, CSD, etc.) This is useful for creating custom menus or other system-styled UI.
Sourcepub fn get_monitors(&self) -> MonitorVec
pub fn get_monitors(&self) -> MonitorVec
Get a snapshot of all monitors available on the system.
The returned MonitorVec is cloned from the shared monitor cache.
The cache is initialized once at app start and updated by the platform
layer on monitor topology changes. No OS calls are made here.
Sourcepub fn get_current_monitor(&self) -> OptionMonitor
pub fn get_current_monitor(&self) -> OptionMonitor
Get the monitor that the current window is on, if known.
Uses FullWindowState::monitor_id (set by the platform layer) to find
the matching monitor in the cached monitor list. Returns None if the
monitor ID is not set or no matching monitor is found.
Sourcepub fn get_cursor_position(&self) -> Option<LogicalPosition>
pub fn get_cursor_position(&self) -> Option<LogicalPosition>
Get the current cursor position in logical coordinates relative to the window
Sourcepub fn get_hit_node_layout_rect(&self) -> Option<LogicalRect>
pub fn get_hit_node_layout_rect(&self) -> Option<LogicalRect>
Get the layout rectangle of the currently hit node (in logical coordinates)
Sourcepub fn get_computed_css_property(
&self,
node_id: DomNodeId,
property_type: CssPropertyType,
) -> Option<CssProperty>
pub fn get_computed_css_property( &self, node_id: DomNodeId, property_type: CssPropertyType, ) -> Option<CssProperty>
Get the computed CSS property for a specific DOM node
This queries the CSS property cache and returns the resolved property value for the given node, taking into account:
- User overrides (from callbacks)
- Node state (:hover, :active, :focus)
- CSS rules from stylesheets
- Cascaded properties from parents
- Inline styles
§Arguments
node_id- The DOM node to queryproperty_type- The CSS property type to retrieve
§Returns
Some(CssProperty)if the property is set on this nodeNoneif the property is not set (will use default value)
Sourcepub fn get_computed_width(&self, node_id: DomNodeId) -> Option<CssProperty>
pub fn get_computed_width(&self, node_id: DomNodeId) -> Option<CssProperty>
Get the computed width of a node from CSS
Convenience method for getting the CSS width property.
Sourcepub fn get_computed_height(&self, node_id: DomNodeId) -> Option<CssProperty>
pub fn get_computed_height(&self, node_id: DomNodeId) -> Option<CssProperty>
Get the computed height of a node from CSS
Convenience method for getting the CSS height property.
pub fn get_system_time_fn(&self) -> GetSystemTimeCallback
pub fn get_current_time(&self) -> Instant
Sourcepub fn get_renderer_resources(&self) -> &RendererResources
pub fn get_renderer_resources(&self) -> &RendererResources
Get immutable reference to the renderer resources
This provides access to fonts, images, and other rendering resources. Useful for custom rendering or screenshot functionality.
Sourcepub fn take_screenshot(&self, dom_id: DomId) -> Result<Vec<u8>, AzString>
pub fn take_screenshot(&self, dom_id: DomId) -> Result<Vec<u8>, AzString>
Take a CPU-rendered screenshot of the current window content
This renders the current display list to a PNG image using CPU rendering. The screenshot captures the window content as it would appear on screen, without window decorations.
§Arguments
dom_id- The DOM to screenshot (use the main DOM ID for the full window)
§Returns
Ok(Vec<u8>)- PNG-encoded image dataErr(String)- Error message if rendering failed
§Example
fn on_click(info: &mut CallbackInfo) -> Update {
let dom_id = info.get_hit_node().dom;
match info.take_screenshot(dom_id) {
Ok(png_data) => {
std::fs::write("screenshot.png", png_data).unwrap();
}
Err(e) => eprintln!("Screenshot failed: {}", e),
}
Update::DoNothing
}Sourcepub fn take_screenshot_to_file(
&self,
dom_id: DomId,
path: &str,
) -> Result<(), AzString>
pub fn take_screenshot_to_file( &self, dom_id: DomId, path: &str, ) -> Result<(), AzString>
Take a screenshot and save it directly to a file
Convenience method that combines take_screenshot with file writing.
§Arguments
dom_id- The DOM to screenshotpath- The file path to save the PNG to
§Returns
Ok(())- Screenshot saved successfullyErr(String)- Error message if rendering or saving failed
Sourcepub fn take_native_screenshot(&self, _path: &str) -> Result<(), AzString>
pub fn take_native_screenshot(&self, _path: &str) -> Result<(), AzString>
Take a native OS-level screenshot of the window including window decorations
NOTE: This is a stub implementation. For full native screenshot support,
use the NativeScreenshotExt trait from the azul-dll crate, which uses
runtime dynamic loading (dlopen) to avoid static linking dependencies.
§Returns
Err(String)- Always returns an error directing to use the extension trait
Sourcepub fn take_native_screenshot_bytes(&self) -> Result<Vec<u8>, AzString>
pub fn take_native_screenshot_bytes(&self) -> Result<Vec<u8>, AzString>
Take a native OS-level screenshot and return the PNG data as bytes
NOTE: This is a stub implementation. For full native screenshot support,
use the NativeScreenshotExt trait from the azul-dll crate.
§Returns
Ok(Vec<u8>)- PNG-encoded image dataErr(String)- Error message if screenshot failed
Sourcepub fn take_native_screenshot_base64(&self) -> Result<AzString, AzString>
pub fn take_native_screenshot_base64(&self) -> Result<AzString, AzString>
Take a native OS-level screenshot and return as a Base64 data URI
Returns the screenshot as a “data:image/png;base64,…” string that can be directly used in HTML img tags or JSON responses.
§Returns
Ok(String)- Base64 data URI stringErr(String)- Error message if screenshot failed
Sourcepub fn take_screenshot_base64(
&self,
dom_id: DomId,
) -> Result<AzString, AzString>
pub fn take_screenshot_base64( &self, dom_id: DomId, ) -> Result<AzString, AzString>
Take a CPU-rendered screenshot and return as a Base64 data URI
Returns the screenshot as a “data:image/png;base64,…” string. This is the software-rendered version without window decorations.
§Returns
Ok(String)- Base64 data URI stringErr(String)- Error message if rendering failed
Sourcepub fn get_scroll_manager(&self) -> &ScrollManager
pub fn get_scroll_manager(&self) -> &ScrollManager
Get immutable reference to the scroll manager
Use this to query scroll state for nodes without modifying it.
To request programmatic scrolling, use nodes_scrolled_in_callback.
Sourcepub fn get_gesture_drag_manager(&self) -> &GestureAndDragManager
pub fn get_gesture_drag_manager(&self) -> &GestureAndDragManager
Get immutable reference to the gesture and drag manager
Use this to query current gesture/drag state (e.g., “is this node being dragged?”, “what files are being dropped?”, “is a long-press active?”).
The manager is updated by the event loop and provides read-only query access to callbacks for gesture-aware UI behavior.
Sourcepub fn inject_native_gesture(&mut self, gesture: NativeGestureEvent)
pub fn inject_native_gesture(&mut self, gesture: NativeGestureEvent)
Queue a platform-native gesture-recognizer result. Applied by
the event-loop after the callback returns, via
CallbackChange::InjectNativeGesture -> GestureAndDragManager:: inject_native_gesture. Used by the iOS / Android / macOS
platform backends from their gesture-recognizer callbacks and by
the e2e debug-server harness so JSON tests can drive every event
filter end-to-end.
Sourcepub fn get_focus_manager(&self) -> &FocusManager
pub fn get_focus_manager(&self) -> &FocusManager
Get immutable reference to the focus manager
Use this to query which node currently has focus and whether focus is being moved to another node.
Sourcepub fn get_undo_redo_manager(&self) -> &UndoRedoManager
pub fn get_undo_redo_manager(&self) -> &UndoRedoManager
Get a reference to the undo/redo manager
This allows user callbacks to query the undo/redo state and intercept undo/redo operations via preventDefault().
Sourcepub fn get_hover_manager(&self) -> &HoverManager
pub fn get_hover_manager(&self) -> &HoverManager
Get immutable reference to the hover manager
Use this to query which nodes are currently hovered at various input points (mouse, touch points, pen).
Sourcepub fn get_text_input_manager(&self) -> &TextInputManager
pub fn get_text_input_manager(&self) -> &TextInputManager
Get immutable reference to the text input manager
Use this to query text selection state, cursor positions, and IME composition.
Sourcepub fn has_any_selection(&self) -> bool
pub fn has_any_selection(&self) -> bool
Check if multi_cursor has any selection ranges.
Replaces the removed get_selection_manager().
Sourcepub fn is_node_focused(&self, node_id: DomNodeId) -> bool
pub fn is_node_focused(&self, node_id: DomNodeId) -> bool
Check if a specific node is currently focused
Sourcepub fn is_dom_focused(&self, dom_id: DomId) -> bool
pub fn is_dom_focused(&self, dom_id: DomId) -> bool
Check if any node in a specific DOM is focused
Sourcepub fn get_pen_state(&self) -> Option<&PenState>
pub fn get_pen_state(&self) -> Option<&PenState>
Get current pen/stylus state if a pen is active
Sourcepub fn get_wacom_pad(&self) -> Option<WacomPadState>
pub fn get_wacom_pad(&self) -> Option<WacomPadState>
Get the current Wacom tablet-pad state (ExpressKeys + touch-ring),
or None if no pad backend has delivered one. (The pen’s own wacom
features - eraser / barrel button / barrel roll / tilt / pressure -
are in CallbackInfo::get_pen_state.) Kept live by the platform pad
backend (Wintab / libwacom+libinput / macOS tablet NSEvents).
Sourcepub fn get_location_fix(&self) -> Option<LocationFix>
pub fn get_location_fix(&self) -> Option<LocationFix>
Get the most recent geolocation fix, or None if no GeolocationProbe
is mounted or no platform backend has delivered a fix yet. The fix is
kept live by the platform backends (Android FusedLocationProvider,
iOS/macOS CLLocationManager) via the async fix channel that the
layout pass folds into the manager - so a callback can read the user’s
position to, e.g., place a “you are here” marker on a map.
Sourcepub fn get_sensor_reading(&self, kind: SensorKind) -> Option<SensorReading>
pub fn get_sensor_reading(&self, kind: SensorKind) -> Option<SensorReading>
Get the latest motion-sensor reading for kind (Accelerometer /
Gyroscope / Magnetometer), or None if no platform backend has
delivered one. Kept live by the sensor backends (iOS CoreMotion,
Android SensorManager) via the async channel the layout pass folds
into the manager - so a callback can drive tilt / shake / compass UI.
Sourcepub fn get_safe_area_insets(&self) -> SafeAreaInsets
pub fn get_safe_area_insets(&self) -> SafeAreaInsets
The safe-area insets (notch / system-UI margins) for this window, in
logical px - lay out interactive content within them so it isn’t hidden
by a notch / rounded corners / status bar. Zero where the platform or
window has no inset. Set by the platform shell (macOS NSScreen notch,
iOS UIView.safeAreaInsets, Android WindowInsets).
Sourcepub fn get_gamepad_state(&self, id: GamepadId) -> Option<GamepadState>
pub fn get_gamepad_state(&self, id: GamepadId) -> Option<GamepadState>
Get the latest state of the gamepad id (button bitset + analog
axes), or None if no pad with that id has connected. Kept live by
the controller backend (gilrs / iOS GCController / Android
InputDevice) via the async channel the layout pass folds into the
manager - so a callback can drive movement / menu UI. For the common
single-controller case, CallbackInfo::get_primary_gamepad skips
the id bookkeeping.
Sourcepub fn get_primary_gamepad(&self) -> Option<GamepadState>
pub fn get_primary_gamepad(&self) -> Option<GamepadState>
Get the first currently-connected gamepad, or None if none is
connected - the convenient single-controller accessor.
Sourcepub fn get_biometric_result(&self) -> Option<BiometricResult>
pub fn get_biometric_result(&self) -> Option<BiometricResult>
Get the most recent biometric-auth result, or None if no
request_biometric_auth has completed yet. Kept live by the
platform backends (iOS/macOS LAContext, Android BiometricPrompt,
Windows UserConsentVerifier) via the async result channel the
layout pass folds into the manager - so a callback can unlock a
vault / settings panel once the user authenticates.
Sourcepub fn get_biometric_kind(&self) -> BiometricKind
pub fn get_biometric_kind(&self) -> BiometricKind
Get the device’s biometric capability (sync probe): Face,
Fingerprint, Iris, or NotAvailable. Lets a callback decide
whether to even offer a biometric unlock before requesting one
(no OS prompt is shown - this just reads the cached probe).
Sourcepub fn request_biometric_auth(&mut self, prompt: BiometricPrompt)
pub fn request_biometric_auth(&mut self, prompt: BiometricPrompt)
Request a biometric-auth prompt (Face ID / Touch ID / Android
BiometricPrompt / Windows Hello). Returns immediately - the OS
draws its own modal asynchronously; the outcome arrives on a later
frame and is read via CallbackInfo::get_biometric_result. Call
this from, e.g., an unlock button’s on_click. The prompt
configures the reason text, cancel label, and whether the OS
passcode fallback is allowed. (No platform backend reports a real
outcome yet - the request currently resolves to
BiometricResult::Unavailable; the iOS/macOS/Android backends land
in a later tick.)
Sourcepub fn keyring_store(
&mut self,
key: AzString,
secret: AzString,
require_biometry: bool,
)
pub fn keyring_store( &mut self, key: AzString, secret: AzString, require_biometry: bool, )
Store secret under key in the OS keyring (Keychain / KeyStore /
libsecret / CredentialLocker). When require_biometry is set, a
later keyring_get of this key triggers the OS biometric prompt.
Returns immediately; the outcome arrives via get_keyring_result()
on a later frame.
Sourcepub fn keyring_get(&mut self, key: AzString)
pub fn keyring_get(&mut self, key: AzString)
Read the secret stored under key. A biometry-bound item shows the
OS prompt first; the secret (or a denial) arrives via
get_keyring_result() on a later frame.
Sourcepub fn keyring_delete(&mut self, key: AzString)
pub fn keyring_delete(&mut self, key: AzString)
Remove the item stored under key from the OS keyring (no-op if
absent). The outcome arrives via get_keyring_result().
Sourcepub fn get_keyring_result(&self) -> Option<KeyringResult>
pub fn get_keyring_result(&self) -> Option<KeyringResult>
Get the most recent keyring outcome, or None until the first op
completes. Read after a keyring_store/get/delete to observe the
result - e.g. the revealed secret from a keyring_get
(KeyringResult::Retrieved).
Sourcepub fn get_permission_status(&self, capability: Capability) -> PermissionState
pub fn get_permission_status(&self, capability: Capability) -> PermissionState
Read the most recently observed permission state for capability
(Camera / Microphone / Geolocation / Sensors / Notifications / …) — e.g.
so a callback can check a capability is Granted before using it (show
a camera preview only once granted). Kept live by the platform
permission backend; a capability is subscribed by mounting its probe
node (CameraProbe / GeolocationProbe / …) into the DOM.
Sourcepub fn get_pen_pressure(&self) -> Option<f32>
pub fn get_pen_pressure(&self) -> Option<f32>
Get current pen pressure (0.0 to 1.0) Returns None if no pen is active, Some(0.5) for mouse
Sourcepub fn get_pen_tilt(&self) -> Option<PenTilt>
pub fn get_pen_tilt(&self) -> Option<PenTilt>
Get current pen tilt angles (x_tilt, y_tilt) in degrees Returns None if no pen is active
Sourcepub fn is_pen_in_contact(&self) -> bool
pub fn is_pen_in_contact(&self) -> bool
Check if pen is currently in contact with surface
Sourcepub fn is_pen_eraser(&self) -> bool
pub fn is_pen_eraser(&self) -> bool
Check if pen is in eraser mode
Check if pen barrel button is pressed
Sourcepub fn get_last_input_sample(&self) -> Option<&InputSample>
pub fn get_last_input_sample(&self) -> Option<&InputSample>
Get the last recorded input sample (for event_id and detailed input data)
Sourcepub fn get_current_event_id(&self) -> Option<u64>
pub fn get_current_event_id(&self) -> Option<u64>
Get the event ID of the current event
Sourcepub fn get_swipe_direction(&self) -> OptionGestureDirection
pub fn get_swipe_direction(&self) -> OptionGestureDirection
Returns the dominant direction of the current swipe gesture, if any. Detection uses the touch / pointer trajectory and a velocity threshold; on iOS / Android the platform backend may override the in-process detector with a native gesture-recognizer result.
Sourcepub fn get_pinch(&self) -> OptionDetectedPinch
pub fn get_pinch(&self) -> OptionDetectedPinch
Returns the active pinch gesture (scale + center + distances), if any.
Sourcepub fn get_rotation(&self) -> OptionDetectedRotation
pub fn get_rotation(&self) -> OptionDetectedRotation
Returns the active rotation gesture (radians + center), if any.
Sourcepub fn get_long_press(&self) -> OptionDetectedLongPress
pub fn get_long_press(&self) -> OptionDetectedLongPress
Returns the active long-press, if the user is currently holding a pointer in place beyond the configured threshold.
Sourcepub fn was_double_clicked(&self) -> bool
pub fn was_double_clicked(&self) -> bool
True iff the gesture manager classified the current event sequence as a double-click / double-tap.
Sourcepub fn set_focus_to_node(&mut self, dom_id: DomId, node_id: NodeId)
pub fn set_focus_to_node(&mut self, dom_id: DomId, node_id: NodeId)
Set focus to a specific DOM node by ID
Sourcepub fn set_focus_to_path(&mut self, dom_id: DomId, css_path: CssPath)
pub fn set_focus_to_path(&mut self, dom_id: DomId, css_path: CssPath)
Set focus to a node matching a CSS path
Sourcepub fn focus_next(&mut self)
pub fn focus_next(&mut self)
Move focus to next focusable element in tab order
Sourcepub fn focus_previous(&mut self)
pub fn focus_previous(&mut self)
Move focus to previous focusable element in tab order
Sourcepub fn focus_first(&mut self)
pub fn focus_first(&mut self)
Move focus to first focusable element
Sourcepub fn focus_last(&mut self)
pub fn focus_last(&mut self)
Move focus to last focusable element
Sourcepub fn clear_focus(&mut self)
pub fn clear_focus(&mut self)
Remove focus from all elements
Sourcepub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Check if a drag gesture is currently active
Convenience method that queries the gesture manager.
Sourcepub fn get_focused_node(&self) -> Option<DomNodeId>
pub fn get_focused_node(&self) -> Option<DomNodeId>
Get the currently focused node (if any)
Returns None if no node has focus.
Sourcepub fn get_hovered_file(&self) -> Option<&AzString>
pub fn get_hovered_file(&self) -> Option<&AzString>
Get the currently hovered file (if drag-drop is in progress)
Returns None if no file is being hovered over the window.
Sourcepub fn get_dropped_file(&self) -> Option<&AzString>
pub fn get_dropped_file(&self) -> Option<&AzString>
Get the currently dropped file (if a file was just dropped)
This is a one-shot value that is cleared after event processing. Returns None if no file was dropped this frame.
Sourcepub fn is_drag_active(&self) -> bool
pub fn is_drag_active(&self) -> bool
Check if a node or file drag is currently active
Returns true if either a node drag or file drag is in progress. Uses gesture_drag_manager as the primary source of truth, with drag_drop_manager as fallback.
Sourcepub fn is_node_drag_active(&self) -> bool
pub fn is_node_drag_active(&self) -> bool
Check if a node drag is specifically active
Sourcepub fn is_file_drag_active(&self) -> bool
pub fn is_file_drag_active(&self) -> bool
Check if a file drag is specifically active
Sourcepub fn get_drag_state(&self) -> Option<DragState>
pub fn get_drag_state(&self) -> Option<DragState>
Get the current drag/drop state (if any)
Returns None if no drag is active, or Some with drag state. Checks gesture_drag_manager first, then falls back to drag_drop_manager.
Sourcepub fn get_drag_context(&self) -> Option<&DragContext>
pub fn get_drag_context(&self) -> Option<&DragContext>
Get the current drag context (if any)
Returns None if no drag is active, or Some with drag context. Prefer this over get_drag_state for new code.
Sourcepub fn get_current_hit_test(&self) -> Option<&FullHitTest>
pub fn get_current_hit_test(&self) -> Option<&FullHitTest>
Get the current mouse cursor hit test result (most recent frame)
Sourcepub fn get_hit_test_frame(&self, frames_ago: usize) -> Option<&FullHitTest>
pub fn get_hit_test_frame(&self, frames_ago: usize) -> Option<&FullHitTest>
Get mouse cursor hit test from N frames ago (0 = current, 1 = previous, etc.)
Sourcepub fn get_hit_test_history(&self) -> Option<&VecDeque<FullHitTest>>
pub fn get_hit_test_history(&self) -> Option<&VecDeque<FullHitTest>>
Get the full mouse cursor hit test history (up to 5 frames)
Returns None if no mouse history exists yet
Sourcepub fn has_sufficient_history_for_gestures(&self) -> bool
pub fn has_sufficient_history_for_gestures(&self) -> bool
Check if there’s sufficient mouse history for gesture detection (at least 2 frames)
Sourcepub fn get_file_drop_manager(&self) -> &FileDropManager
pub fn get_file_drop_manager(&self) -> &FileDropManager
Get immutable reference to the file drop manager
Sourcepub fn get_drag_drop_manager(&self) -> &DragDropManager
pub fn get_drag_drop_manager(&self) -> &DragDropManager
Get immutable reference to the drag-drop manager
Sourcepub fn get_dragged_node(&self) -> Option<DomNodeId>
pub fn get_dragged_node(&self) -> Option<DomNodeId>
Get the node being dragged (if any)
Sourcepub fn get_dragged_file(&self) -> Option<&AzString>
pub fn get_dragged_file(&self) -> Option<&AzString>
Get the file path being dragged (if any)
Sourcepub fn get_drag_types(&self) -> Vec<AzString>
pub fn get_drag_types(&self) -> Vec<AzString>
Get the MIME types available in the current drag data.
W3C equivalent: dataTransfer.types
Returns an empty vec if no drag is active or no data is set.
Sourcepub fn get_drag_data(&self, mime_type: &str) -> Option<Vec<u8>>
pub fn get_drag_data(&self, mime_type: &str) -> Option<Vec<u8>>
Get drag data for a specific MIME type.
W3C equivalent: dataTransfer.getData(type)
Returns None if no drag is active or the MIME type is not set.
Sourcepub fn set_drag_data(&mut self, mime_type: AzString, data: Vec<u8>)
pub fn set_drag_data(&mut self, mime_type: AzString, data: Vec<u8>)
Set drag data for a MIME type on the active drag operation.
W3C equivalent: dataTransfer.setData(type, data)
Should be called from a DragStart callback to populate the drag data.
Sourcepub fn accept_drop(&mut self)
pub fn accept_drop(&mut self)
Accept the current drop operation on this node.
W3C equivalent: calling event.preventDefault() in a DragOver handler.
This signals that the current drop target can accept the dragged data.
Must be called from a DragOver or DragEnter callback for the Drop event
to fire on this node.
Sourcepub fn set_drop_effect(&mut self, effect: DropEffect)
pub fn set_drop_effect(&mut self, effect: DropEffect)
Set the drop effect for the current drag operation.
W3C equivalent: dataTransfer.dropEffect = "move"|"copy"|"link"
Should be called from a DragOver or DragEnter callback.
Sourcepub fn get_scroll_offset(&self) -> Option<LogicalPosition>
pub fn get_scroll_offset(&self) -> Option<LogicalPosition>
Get the current scroll offset for the hit node (if it’s scrollable)
Convenience method that uses the hit_dom_node from this callback.
Use get_scroll_offset_for_node if you need to query a specific node.
Sourcepub fn get_scroll_offset_for_node(
&self,
dom_id: DomId,
node_id: NodeId,
) -> Option<LogicalPosition>
pub fn get_scroll_offset_for_node( &self, dom_id: DomId, node_id: NodeId, ) -> Option<LogicalPosition>
Get the current scroll offset for a specific node (if it’s scrollable)
Sourcepub fn get_scroll_state(
&self,
dom_id: DomId,
node_id: NodeId,
) -> Option<&AnimatedScrollState>
pub fn get_scroll_state( &self, dom_id: DomId, node_id: NodeId, ) -> Option<&AnimatedScrollState>
Get the scroll state (container rect, content rect, current offset) for a node
Sourcepub fn get_scroll_node_info(
&self,
dom_id: DomId,
node_id: NodeId,
) -> Option<ScrollNodeInfo>
pub fn get_scroll_node_info( &self, dom_id: DomId, node_id: NodeId, ) -> Option<ScrollNodeInfo>
Get a read-only snapshot of a scroll node’s bounds and position.
This is the recommended API for timer callbacks that need to compute scroll physics. Returns container/content rects and max scroll bounds.
Sourcepub fn get_scroll_delta(
&self,
_dom_id: DomId,
_node_id: NodeId,
) -> Option<LogicalPosition>
pub fn get_scroll_delta( &self, _dom_id: DomId, _node_id: NodeId, ) -> Option<LogicalPosition>
Deprecated: Returns None. Scroll deltas are no longer tracked per-frame. Kept for FFI backward compatibility.
Sourcepub fn had_scroll_activity(&self, _dom_id: DomId, _node_id: NodeId) -> bool
pub fn had_scroll_activity(&self, _dom_id: DomId, _node_id: NodeId) -> bool
Deprecated: Returns false. Scroll activity flags were removed. Kept for FFI backward compatibility.
Sourcepub fn find_scroll_parent(
&self,
dom_id: DomId,
node_id: NodeId,
) -> Option<NodeId>
pub fn find_scroll_parent( &self, dom_id: DomId, node_id: NodeId, ) -> Option<NodeId>
Find the closest scrollable ancestor of a node.
Walks up the node hierarchy to find a node registered in the ScrollManager. Used by auto-scroll timer to find which container to scroll.
Sourcepub fn get_scroll_input_queue(&self) -> ScrollInputQueue
pub fn get_scroll_input_queue(&self) -> ScrollInputQueue
Get a clone of the scroll input queue for consuming pending inputs.
Timer callbacks use this to drain pending scroll inputs recorded by
platform event handlers. The queue is thread-safe (Arctake_all() with only &self.
Sourcepub fn get_gpu_state_manager(&self) -> &GpuStateManager
pub fn get_gpu_state_manager(&self) -> &GpuStateManager
Get immutable reference to the GPU state manager
Sourcepub fn get_virtual_view_manager(&self) -> &VirtualViewManager
pub fn get_virtual_view_manager(&self) -> &VirtualViewManager
Get immutable reference to the VirtualView manager
Sourcepub fn inspect_copy_changeset(
&self,
target: DomNodeId,
) -> Option<ClipboardContent>
pub fn inspect_copy_changeset( &self, target: DomNodeId, ) -> Option<ClipboardContent>
Inspect a pending copy operation
Returns the clipboard content that would be copied if the operation proceeds. Use this to validate or transform clipboard content before copying.
Sourcepub fn inspect_cut_changeset(
&self,
target: DomNodeId,
) -> Option<ClipboardContent>
pub fn inspect_cut_changeset( &self, target: DomNodeId, ) -> Option<ClipboardContent>
Inspect a pending cut operation
Returns the clipboard content that would be cut (copied + deleted). Use this to validate or transform content before cutting.
Sourcepub fn inspect_paste_target_range(
&self,
_target: DomNodeId,
) -> Option<SelectionRange>
pub fn inspect_paste_target_range( &self, _target: DomNodeId, ) -> Option<SelectionRange>
Inspect the current selection range that would be affected by paste
Returns the selection range that will be replaced when pasting. Returns None if no selection exists (paste will insert at cursor).
Sourcepub fn inspect_select_all_changeset(
&self,
target: DomNodeId,
) -> Option<SelectAllResult>
pub fn inspect_select_all_changeset( &self, target: DomNodeId, ) -> Option<SelectAllResult>
Inspect what text would be selected by Select All operation
Returns the full text content and the range that would be selected.
Sourcepub fn inspect_delete_changeset(
&self,
target: DomNodeId,
forward: bool,
) -> Option<DeleteResult>
pub fn inspect_delete_changeset( &self, target: DomNodeId, forward: bool, ) -> Option<DeleteResult>
Inspect what would be deleted by a backspace/delete operation
Uses the pure functions from text3::edit::inspect_delete() to determine
what would be deleted without actually performing the deletion.
Returns (range_to_delete, deleted_text).
- forward=true: Delete key (delete character after cursor)
- forward=false: Backspace key (delete character before cursor)
Sourcepub fn inspect_undo_operation(
&self,
node_id: NodeId,
) -> Option<&UndoableOperation>
pub fn inspect_undo_operation( &self, node_id: NodeId, ) -> Option<&UndoableOperation>
Inspect a pending undo operation
Returns the operation that would be undone, allowing inspection of what state will be restored.
Sourcepub fn inspect_redo_operation(
&self,
node_id: NodeId,
) -> Option<&UndoableOperation>
pub fn inspect_redo_operation( &self, node_id: NodeId, ) -> Option<&UndoableOperation>
Inspect a pending redo operation
Returns the operation that would be reapplied.
Sourcepub fn can_undo(&self, node_id: NodeId) -> bool
pub fn can_undo(&self, node_id: NodeId) -> bool
Check if undo is available for a specific node
Returns true if there is at least one undoable operation in the stack.
Sourcepub fn can_redo(&self, node_id: NodeId) -> bool
pub fn can_redo(&self, node_id: NodeId) -> bool
Check if redo is available for a specific node
Returns true if there is at least one redoable operation in the stack.
Sourcepub fn get_undo_text(&self, node_id: NodeId) -> Option<AzString>
pub fn get_undo_text(&self, node_id: NodeId) -> Option<AzString>
Get the text that would be restored by undo for a specific node
Returns the pre-state text content that would be restored if undo is performed. Returns None if no undo operation is available.
Sourcepub fn get_redo_text(&self, node_id: NodeId) -> Option<AzString>
pub fn get_redo_text(&self, node_id: NodeId) -> Option<AzString>
Get the text that would be restored by redo for a specific node
Returns the pre-state text content that would be restored if redo is performed. Returns None if no redo operation is available.
Sourcepub fn get_clipboard_content(&self) -> Option<&ClipboardContent>
pub fn get_clipboard_content(&self) -> Option<&ClipboardContent>
Get clipboard content from system clipboard (available during paste operations)
This returns content that was read from the system clipboard when Ctrl+V was pressed. It’s only available in On::Paste callbacks or similar clipboard-related callbacks.
Use this to inspect what will be pasted before allowing or modifying the paste operation.
§Returns
Some(&ClipboardContent)- If paste is in progress and clipboard has contentNone- If no paste operation is active or clipboard is empty
Sourcepub fn set_clipboard_content(&mut self, content: ClipboardContent)
pub fn set_clipboard_content(&mut self, content: ClipboardContent)
Override clipboard content for copy/cut operations
This sets custom content that will be written to the system clipboard. Use this in On::Copy or On::Cut callbacks to modify what gets copied.
§Arguments
content- The clipboard content to write to system clipboard
Sourcepub fn set_copy_content(&mut self, target: DomNodeId, content: ClipboardContent)
pub fn set_copy_content(&mut self, target: DomNodeId, content: ClipboardContent)
Set/modify the clipboard content before a copy operation
Use this to transform clipboard content before copying. The change is queued and will be applied after the callback returns, if preventDefault() was not called.
Sourcepub fn set_cut_content(&mut self, target: DomNodeId, content: ClipboardContent)
pub fn set_cut_content(&mut self, target: DomNodeId, content: ClipboardContent)
Set/modify the clipboard content before a cut operation
Similar to set_copy_content but for cut operations. The change is queued and will be applied after the callback returns.
Sourcepub fn set_select_all_range(&mut self, target: DomNodeId, range: SelectionRange)
pub fn set_select_all_range(&mut self, target: DomNodeId, range: SelectionRange)
Override the selection range for select-all operation
Use this to limit what gets selected (e.g., only select visible text). The change is queued and will be applied after the callback returns.
Sourcepub fn request_hit_test_update(&mut self, position: LogicalPosition)
pub fn request_hit_test_update(&mut self, position: LogicalPosition)
Request a hit test update at a specific position
This is used by the Debug API to update the hover manager’s hit test data after modifying the mouse position. This ensures that mouse event callbacks can find the correct nodes under the cursor.
The hit test is performed during the next frame update.
Sourcepub fn process_text_selection_click(
&mut self,
position: LogicalPosition,
time_ms: u64,
)
pub fn process_text_selection_click( &mut self, position: LogicalPosition, time_ms: u64, )
Process a text selection click at a specific position
This is used by the Debug API to trigger text selection directly, bypassing the normal event pipeline which generates PreCallbackSystemEvent::TextClick.
The selection processing is deferred until the CallbackChange is processed, at which point the LayoutWindow can be mutably accessed.
Sourcepub fn get_node_text_content(&self, target: DomNodeId) -> Option<String>
pub fn get_node_text_content(&self, target: DomNodeId) -> Option<String>
Get the current text content of a node
Helper for inspecting text before operations.
Sourcepub fn get_node_cursor_position(&self, target: DomNodeId) -> Option<TextCursor>
pub fn get_node_cursor_position(&self, target: DomNodeId) -> Option<TextCursor>
Get the current cursor position in a node
Returns the text cursor position if the node is focused.
Sourcepub fn get_node_selection_ranges(&self, _target: DomNodeId) -> SelectionRangeVec
pub fn get_node_selection_ranges(&self, _target: DomNodeId) -> SelectionRangeVec
Get the current selection ranges in a node
Returns all active selection ranges for the specified DOM.
Sourcepub fn node_has_selection(&self, target: DomNodeId) -> bool
pub fn node_has_selection(&self, target: DomNodeId) -> bool
Check if a specific node has an active selection
This checks if the specific node (identified by DomNodeId) has a selection, as opposed to has_selection(DomId) which checks the entire DOM.
Sourcepub fn get_node_text_length(&self, target: DomNodeId) -> Option<usize>
pub fn get_node_text_length(&self, target: DomNodeId) -> Option<usize>
Get the length of text in a node
Useful for bounds checking in custom operations.
Sourcepub fn inspect_move_cursor_left(&self, target: DomNodeId) -> Option<TextCursor>
pub fn inspect_move_cursor_left(&self, target: DomNodeId) -> Option<TextCursor>
Inspect where the cursor would move when pressing left arrow
Returns the new cursor position that would result from moving left. Returns None if the cursor is already at the start of the document.
§Arguments
target- The node containing the cursor
Sourcepub fn inspect_move_cursor_right(&self, target: DomNodeId) -> Option<TextCursor>
pub fn inspect_move_cursor_right(&self, target: DomNodeId) -> Option<TextCursor>
Inspect where the cursor would move when pressing right arrow
Returns the new cursor position that would result from moving right. Returns None if the cursor is already at the end of the document.
Sourcepub fn inspect_move_cursor_up(&self, target: DomNodeId) -> Option<TextCursor>
pub fn inspect_move_cursor_up(&self, target: DomNodeId) -> Option<TextCursor>
Inspect where the cursor would move when pressing up arrow
Returns the new cursor position that would result from moving up one line. Returns None if the cursor is already on the first line.
Sourcepub fn inspect_move_cursor_down(&self, target: DomNodeId) -> Option<TextCursor>
pub fn inspect_move_cursor_down(&self, target: DomNodeId) -> Option<TextCursor>
Inspect where the cursor would move when pressing down arrow
Returns the new cursor position that would result from moving down one line. Returns None if the cursor is already on the last line.
Sourcepub fn inspect_move_cursor_to_line_start(
&self,
target: DomNodeId,
) -> Option<TextCursor>
pub fn inspect_move_cursor_to_line_start( &self, target: DomNodeId, ) -> Option<TextCursor>
Inspect where the cursor would move when pressing Home key
Returns the cursor position at the start of the current line.
Sourcepub fn inspect_move_cursor_to_line_end(
&self,
target: DomNodeId,
) -> Option<TextCursor>
pub fn inspect_move_cursor_to_line_end( &self, target: DomNodeId, ) -> Option<TextCursor>
Inspect where the cursor would move when pressing End key
Returns the cursor position at the end of the current line.
Sourcepub fn inspect_move_cursor_to_document_start(
&self,
target: DomNodeId,
) -> Option<TextCursor>
pub fn inspect_move_cursor_to_document_start( &self, target: DomNodeId, ) -> Option<TextCursor>
Inspect where the cursor would move when pressing Ctrl+Home
Returns the cursor position at the start of the document.
Sourcepub fn inspect_move_cursor_to_document_end(
&self,
target: DomNodeId,
) -> Option<TextCursor>
pub fn inspect_move_cursor_to_document_end( &self, target: DomNodeId, ) -> Option<TextCursor>
Inspect where the cursor would move when pressing Ctrl+End
Returns the cursor position at the end of the document.
Sourcepub fn inspect_backspace(&self, target: DomNodeId) -> Option<DeleteResult>
pub fn inspect_backspace(&self, target: DomNodeId) -> Option<DeleteResult>
Inspect what text would be deleted by backspace (including Shift+Backspace)
Returns (range_to_delete, deleted_text). This is a convenience wrapper around inspect_delete_changeset(target, false).
Sourcepub fn inspect_delete(&self, target: DomNodeId) -> Option<DeleteResult>
pub fn inspect_delete(&self, target: DomNodeId) -> Option<DeleteResult>
Inspect what text would be deleted by delete key
Returns (range_to_delete, deleted_text). This is a convenience wrapper around inspect_delete_changeset(target, true).
Sourcepub fn move_cursor_left(&mut self, target: DomNodeId, extend_selection: bool)
pub fn move_cursor_left(&mut self, target: DomNodeId, extend_selection: bool)
Move cursor left (arrow left key)
§Arguments
target- The node containing the cursorextend_selection- If true, extends selection (Shift+Left); if false, moves cursor
Sourcepub fn move_cursor_right(&mut self, target: DomNodeId, extend_selection: bool)
pub fn move_cursor_right(&mut self, target: DomNodeId, extend_selection: bool)
Move cursor right (arrow right key)
Sourcepub fn move_cursor_up(&mut self, target: DomNodeId, extend_selection: bool)
pub fn move_cursor_up(&mut self, target: DomNodeId, extend_selection: bool)
Move cursor up (arrow up key)
Sourcepub fn move_cursor_down(&mut self, target: DomNodeId, extend_selection: bool)
pub fn move_cursor_down(&mut self, target: DomNodeId, extend_selection: bool)
Move cursor down (arrow down key)
Sourcepub fn move_cursor_to_line_start(
&mut self,
target: DomNodeId,
extend_selection: bool,
)
pub fn move_cursor_to_line_start( &mut self, target: DomNodeId, extend_selection: bool, )
Move cursor to line start (Home key)
Sourcepub fn move_cursor_to_line_end(
&mut self,
target: DomNodeId,
extend_selection: bool,
)
pub fn move_cursor_to_line_end( &mut self, target: DomNodeId, extend_selection: bool, )
Move cursor to line end (End key)
Sourcepub fn move_cursor_to_document_start(
&mut self,
target: DomNodeId,
extend_selection: bool,
)
pub fn move_cursor_to_document_start( &mut self, target: DomNodeId, extend_selection: bool, )
Move cursor to document start (Ctrl+Home)
Sourcepub fn move_cursor_to_document_end(
&mut self,
target: DomNodeId,
extend_selection: bool,
)
pub fn move_cursor_to_document_end( &mut self, target: DomNodeId, extend_selection: bool, )
Move cursor to document end (Ctrl+End)
Sourcepub fn delete_backward(&mut self, target: DomNodeId)
pub fn delete_backward(&mut self, target: DomNodeId)
Delete text backward (backspace or Shift+Backspace)
Queues a backspace operation to be applied after the callback. Use inspect_backspace() to see what would be deleted.
Sourcepub fn delete_forward(&mut self, target: DomNodeId)
pub fn delete_forward(&mut self, target: DomNodeId)
Delete text forward (delete key)
Queues a delete operation to be applied after the callback. Use inspect_delete() to see what would be deleted.
Trait Implementations§
Source§impl Clone for CallbackInfo
impl Clone for CallbackInfo
Source§fn clone(&self) -> CallbackInfo
fn clone(&self) -> CallbackInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CallbackInfo
impl Debug for CallbackInfo
impl Copy for CallbackInfo
Auto Trait Implementations§
impl Freeze for CallbackInfo
impl !RefUnwindSafe for CallbackInfo
impl !Send for CallbackInfo
impl !Sync for CallbackInfo
impl Unpin for CallbackInfo
impl UnsafeUnpin for CallbackInfo
impl !UnwindSafe for CallbackInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more