Skip to main content

Node

Struct Node 

Source
pub struct Node { /* private fields */ }
Expand description

A single accessible object. A complete UI is represented as a tree of these.

For brevity, and to make more of the documentation usable in bindings to other languages, documentation of getter methods is written as if documenting fields in a struct, and such methods are referred to as properties.

Implementations§

Source§

impl Node

Source

pub fn new(role: Role) -> Self

Source§

impl Node

Source

pub fn role(&self) -> Role

Source

pub fn set_role(&mut self, value: Role)

Source

pub fn supports_action(&self, action: Action) -> bool

Source

pub fn add_action(&mut self, action: Action)

Source

pub fn remove_action(&mut self, action: Action)

Source

pub fn clear_actions(&mut self)

Source

pub fn child_supports_action(&self, action: Action) -> bool

Return whether the specified action is in the set supported on this node’s direct children in the filtered tree.

Source

pub fn add_child_action(&mut self, action: Action)

Add the specified action to the set supported on this node’s direct children in the filtered tree.

Source

pub fn remove_child_action(&mut self, action: Action)

Remove the specified action from the set supported on this node’s direct children in the filtered tree.

Source

pub fn clear_child_actions(&mut self)

Clear the set of actions supported on this node’s direct children in the filtered tree.

Source§

impl Node

Source

pub fn is_hidden(&self) -> bool

Whether this node and its descendants are excluded from the tree presented to assistive technologies and from hit testing. ARIA equivalent: aria-hidden.

Difference with ARIA: aria-hidden controls exposure to assistive technologies, while this property also excludes the node from hit testing.

Source

pub fn set_hidden(&mut self)

Source

pub fn clear_hidden(&mut self)

Source

pub fn is_multiselectable(&self) -> bool

Whether users may select more than one selectable descendant. ARIA equivalent: aria-multiselectable.

Source

pub fn set_multiselectable(&mut self)

Source

pub fn clear_multiselectable(&mut self)

Source

pub fn is_required(&self) -> bool

Whether user input or selection is required on this node. ARIA equivalent: aria-required.

Source

pub fn set_required(&mut self)

Source

pub fn clear_required(&mut self)

Source

pub fn is_visited(&self) -> bool

Whether this node represents a link that has been visited.

Source

pub fn set_visited(&mut self)

Source

pub fn clear_visited(&mut self)

Source

pub fn is_busy(&self) -> bool

Whether this node is being modified and updates should be withheld until it is ready. ARIA equivalent: aria-busy.

Source

pub fn set_busy(&mut self)

Source

pub fn clear_busy(&mut self)

Source

pub fn is_live_atomic(&self) -> bool

Whether updates to this live region should be presented as a whole. ARIA equivalent: aria-atomic.

Source

pub fn set_live_atomic(&mut self)

Source

pub fn clear_live_atomic(&mut self)

Source

pub fn is_modal(&self) -> bool

Whether this dialog is modal. ARIA equivalent: aria-modal.

Source

pub fn set_modal(&mut self)

Source

pub fn clear_modal(&mut self)

Source

pub fn is_touch_transparent(&self) -> bool

Whether touches pass through this node when a screen reader is in touch exploration mode, as they normally do on a virtual keyboard.

Source

pub fn set_touch_transparent(&mut self)

Source

pub fn clear_touch_transparent(&mut self)

Source

pub fn is_read_only(&self) -> bool

Whether this text widget permits focus and selection but not editing. ARIA equivalent: aria-readonly.

Source

pub fn set_read_only(&mut self)

Source

pub fn clear_read_only(&mut self)

Source

pub fn is_disabled(&self) -> bool

Whether this control or group of controls is unavailable for interaction. ARIA equivalent: aria-disabled.

Source

pub fn set_disabled(&mut self)

Source

pub fn clear_disabled(&mut self)

Source

pub fn is_italic(&self) -> bool

Whether this node’s text is italic.

Source

pub fn set_italic(&mut self)

Source

pub fn clear_italic(&mut self)

Source

pub fn clips_children(&self) -> bool

Whether this node clips child content outside its bounds.

Source

pub fn set_clips_children(&mut self)

Source

pub fn clear_clips_children(&mut self)

Source

pub fn is_line_breaking_object(&self) -> bool

Whether this node causes a hard line break.

Source

pub fn set_is_line_breaking_object(&mut self)

Source

pub fn clear_is_line_breaking_object(&mut self)

Source

pub fn is_page_breaking_object(&self) -> bool

Whether this node causes a page break.

Source

pub fn set_is_page_breaking_object(&mut self)

Source

pub fn clear_is_page_breaking_object(&mut self)

Source

pub fn is_spelling_error(&self) -> bool

Whether this node’s text is marked as a spelling error.

Source

pub fn set_is_spelling_error(&mut self)

Source

pub fn clear_is_spelling_error(&mut self)

Source

pub fn is_grammar_error(&self) -> bool

Whether this node’s text is marked as a grammar error.

Source

pub fn set_is_grammar_error(&mut self)

Source

pub fn clear_is_grammar_error(&mut self)

Source

pub fn is_search_match(&self) -> bool

Whether this node represents text matching the current search.

Source

pub fn set_is_search_match(&mut self)

Source

pub fn clear_is_search_match(&mut self)

Source

pub fn is_suggestion(&self) -> bool

Whether this node’s text is a suggested replacement.

Source

pub fn set_is_suggestion(&mut self)

Source

pub fn clear_is_suggestion(&mut self)

Source§

impl Node

Source

pub fn children(&self) -> &[NodeId]

The ordered list of this node’s direct children in the tree. The order should match the intended reading and navigation order.

Source

pub fn set_children(&mut self, value: impl Into<Vec<NodeId>>)

Source

pub fn clear_children(&mut self)

Source§

impl Node

Source

pub fn push_child(&mut self, item: NodeId)

Source§

impl Node

Source

pub fn controls(&self) -> &[NodeId]

The nodes whose contents or presence are controlled by this node. ARIA equivalent: aria-controls.

Source

pub fn set_controls(&mut self, value: impl Into<Vec<NodeId>>)

Source

pub fn clear_controls(&mut self)

Source§

impl Node

Source

pub fn push_controlled(&mut self, item: NodeId)

Source§

impl Node

Source

pub fn details(&self) -> &[NodeId]

The nodes that provide detailed, structured descriptions for this node and that users may navigate to. Use Node::described_by when a plain-text description is sufficient. ARIA equivalent: aria-details.

Difference with ARIA: aria-details references a single element, while this property may reference multiple nodes.

Source

pub fn set_details(&mut self, value: impl Into<Vec<NodeId>>)

Source

pub fn clear_details(&mut self)

Source§

impl Node

Source

pub fn push_detail(&mut self, item: NodeId)

Source§

impl Node

Source

pub fn described_by(&self) -> &[NodeId]

The nodes whose contents provide a plain-text description for this node. Use Node::details for structured content that users may need to navigate. ARIA equivalent: aria-describedby.

Source

pub fn set_described_by(&mut self, value: impl Into<Vec<NodeId>>)

Source

pub fn clear_described_by(&mut self)

Source§

impl Node

Source

pub fn push_described_by(&mut self, item: NodeId)

Source§

impl Node

Source

pub fn flow_to(&self) -> &[NodeId]

The nodes that follow this node in an alternate reading order. ARIA equivalent: aria-flowto.

Source

pub fn set_flow_to(&mut self, value: impl Into<Vec<NodeId>>)

Source

pub fn clear_flow_to(&mut self)

Source§

impl Node

Source

pub fn push_flow_to(&mut self, item: NodeId)

Source§

impl Node

Source

pub fn labelled_by(&self) -> &[NodeId]

The nodes that label this node. ARIA equivalent: aria-labelledby.

Source

pub fn set_labelled_by(&mut self, value: impl Into<Vec<NodeId>>)

Source

pub fn clear_labelled_by(&mut self)

Source§

impl Node

Source

pub fn push_labelled_by(&mut self, item: NodeId)

Source§

impl Node

Source

pub fn owns(&self) -> &[NodeId]

Nodes owned by this node that are not already its descendants in the tree. This property is unnecessary for direct children or other descendants. ARIA equivalent: aria-owns.

Source

pub fn set_owns(&mut self, value: impl Into<Vec<NodeId>>)

Source

pub fn clear_owns(&mut self)

Source§

impl Node

Source

pub fn push_owned(&mut self, item: NodeId)

Source§

impl Node

Source

pub fn radio_group(&self) -> &[NodeId]

For a radio button, the list of all radio buttons in the same group, including this node.

Source

pub fn set_radio_group(&mut self, value: impl Into<Vec<NodeId>>)

Source

pub fn clear_radio_group(&mut self)

Source§

impl Node

Source

pub fn push_to_radio_group(&mut self, item: NodeId)

Source§

impl Node

Source

pub fn active_descendant(&self) -> Option<NodeId>

For a composite widget such as a listbox, tree, or grid, identifies the currently active descendant. Used when focus remains on the container while the active item changes. ARIA equivalent: aria-activedescendant.

Source

pub fn set_active_descendant(&mut self, value: NodeId)

Source

pub fn clear_active_descendant(&mut self)

Source§

impl Node

Source

pub fn error_message(&self) -> Option<NodeId>

The node that provides an error message for this node. This should normally be used with Node::invalid. ARIA equivalent: aria-errormessage.

Source

pub fn set_error_message(&mut self, value: NodeId)

Source

pub fn clear_error_message(&mut self)

Source§

impl Node

The target of this link when it points to another location in the same document.

Source§

impl Node

Source

pub fn member_of(&self) -> Option<NodeId>

The group to which this node belongs.

Source

pub fn set_member_of(&mut self, value: NodeId)

Source

pub fn clear_member_of(&mut self)

Source§

impl Node

Source

pub fn next_on_line(&self) -> Option<NodeId>

The next text run on the same visual line. The target’s Node::previous_on_line should point back to this node.

Source

pub fn set_next_on_line(&mut self, value: NodeId)

Source

pub fn clear_next_on_line(&mut self)

Source§

impl Node

Source

pub fn previous_on_line(&self) -> Option<NodeId>

The previous text run on the same visual line. The target’s Node::next_on_line should point back to this node.

Source

pub fn set_previous_on_line(&mut self, value: NodeId)

Source

pub fn clear_previous_on_line(&mut self)

Source§

impl Node

Source

pub fn popup_for(&self) -> Option<NodeId>

The node for which this node is a popup.

Source

pub fn set_popup_for(&mut self, value: NodeId)

Source

pub fn clear_popup_for(&mut self)

Source§

impl Node

Source

pub fn label(&self) -> Option<&str>

The label of this node. If the label is specified via the Node::labelled_by relation, this doesn’t need to be set. The text content of a node with the Role::Label role should be provided via Node::value, not this property. ARIA equivalent: aria-label.

Source

pub fn set_label(&mut self, value: impl Into<String>)

Source

pub fn clear_label(&mut self)

Source§

impl Node

Source

pub fn description(&self) -> Option<&str>

Additional information that supplements this node’s label. ARIA 1.3 draft equivalent: aria-description.

Source

pub fn set_description(&mut self, value: impl Into<String>)

Source

pub fn clear_description(&mut self)

Source§

impl Node

Source

pub fn value(&self) -> Option<&str>

The text content or string value of this node. ARIA equivalent: aria-valuetext for range widgets.

Difference with ARIA: Unlike aria-valuetext, this property is also used for text controls and the text content of nodes such as Role::Label and Role::TextRun.

Source

pub fn set_value(&mut self, value: impl Into<String>)

Source

pub fn clear_value(&mut self)

Source§

impl Node

Source

pub fn access_key(&self) -> Option<&str>

A single character, usually part of this node’s name, that can be pressed, possibly along with a platform-specific modifier, to perform this node’s default action. For menu items, the access key is only active while the menu is active, in contrast with keyboard_shortcut; a single menu item may in fact have both properties.

Source

pub fn set_access_key(&mut self, value: impl Into<String>)

Source

pub fn clear_access_key(&mut self)

Source§

impl Node

Source

pub fn author_id(&self) -> Option<&str>

A way for application authors to identify this node for automated testing purposes. The value must be unique among this node’s siblings.

Source

pub fn set_author_id(&mut self, value: impl Into<String>)

Source

pub fn clear_author_id(&mut self)

Source§

impl Node

Source

pub fn class_name(&self) -> Option<&str>

The platform control class name for this node.

Source

pub fn set_class_name(&mut self, value: impl Into<String>)

Source

pub fn clear_class_name(&mut self)

Source§

impl Node

Source

pub fn font_family(&self) -> Option<&str>

The font family used for this node’s text. Only set this when it differs from the parent.

Source

pub fn set_font_family(&mut self, value: impl Into<String>)

Source

pub fn clear_font_family(&mut self)

Source§

impl Node

Source

pub fn html_id(&self) -> Option<&str>

The ID of the HTML element represented by this node. On platforms where both are mapped to the same platform property, this takes precedence over author_id.

Source

pub fn set_html_id(&mut self, value: impl Into<String>)

Source

pub fn clear_html_id(&mut self)

Source§

impl Node

Source

pub fn html_tag(&self) -> Option<&str>

The name of the HTML element represented by this node.

Source

pub fn set_html_tag(&mut self, value: impl Into<String>)

Source

pub fn clear_html_tag(&mut self)

Source§

impl Node

Source

pub fn inner_html(&self) -> Option<&str>

Inner HTML of an element. Only used for a top-level math element, to support third-party math accessibility products that parse MathML.

Source

pub fn set_inner_html(&mut self, value: impl Into<String>)

Source

pub fn clear_inner_html(&mut self)

Source§

impl Node

Source

pub fn keyboard_shortcut(&self) -> Option<&str>

A keystroke or sequence of keystrokes, complete with any required modifiers(s), that will perform this node’s default action. The value of this property should be in a human-friendly format. ARIA equivalent: aria-keyshortcuts.

Source

pub fn set_keyboard_shortcut(&mut self, value: impl Into<String>)

Source

pub fn clear_keyboard_shortcut(&mut self)

Source§

impl Node

Source

pub fn language(&self) -> Option<&str>

An IETF language tag. Only set this when it differs from the parent.

Source

pub fn set_language(&mut self, value: impl Into<String>)

Source

pub fn clear_language(&mut self)

Source§

impl Node

Source

pub fn placeholder(&self) -> Option<&str>

A short hint that helps the user with data entry when the node has no Node::value. This property should not be used instead of Node::label. ARIA equivalent: aria-placeholder.

Source

pub fn set_placeholder(&mut self, value: impl Into<String>)

Source

pub fn clear_placeholder(&mut self)

Source§

impl Node

Source

pub fn role_description(&self) -> Option<&str>

An optional string that may override an assistive technology’s description of the node’s role. Only provide this for custom control types. The value should be human-friendly and localized. ARIA equivalent: aria-roledescription.

Source

pub fn set_role_description(&mut self, value: impl Into<String>)

Source

pub fn clear_role_description(&mut self)

Source§

impl Node

Source

pub fn state_description(&self) -> Option<&str>

An optional string that may override an assistive technology’s description of the node’s state, replacing default strings such as “checked” or “selected”. Note that most platform accessibility APIs and assistive technologies do not support this feature.

Source

pub fn set_state_description(&mut self, value: impl Into<String>)

Source

pub fn clear_state_description(&mut self)

Source§

impl Node

Source

pub fn tooltip(&self) -> Option<&str>

If a node’s only label comes from a tooltip, it should be exposed through this property rather than label.

Source

pub fn set_tooltip(&mut self, value: impl Into<String>)

Source

pub fn clear_tooltip(&mut self)

Source§

impl Node

Source

pub fn url(&self) -> Option<&str>

The target URL of a link.

Source

pub fn set_url(&mut self, value: impl Into<String>)

Source

pub fn clear_url(&mut self)

Source§

impl Node

Source

pub fn row_index_text(&self) -> Option<&str>

A human-readable alternative to the numeric row index. ARIA 1.3 draft equivalent: aria-rowindextext.

Source

pub fn set_row_index_text(&mut self, value: impl Into<String>)

Source

pub fn clear_row_index_text(&mut self)

Source§

impl Node

Source

pub fn column_index_text(&self) -> Option<&str>

A human-readable alternative to the numeric column index. ARIA 1.3 draft equivalent: aria-colindextext.

Source

pub fn set_column_index_text(&mut self, value: impl Into<String>)

Source

pub fn clear_column_index_text(&mut self)

Source§

impl Node

Source

pub fn braille_label(&self) -> Option<&str>

An alternative to Node::label that assistive technologies may present on a Braille display instead of speaking it. The value is ordinary text, not Unicode Braille characters. ARIA 1.3 draft equivalent: aria-braillelabel.

Source

pub fn set_braille_label(&mut self, value: impl Into<String>)

Source

pub fn clear_braille_label(&mut self)

Source§

impl Node

Source

pub fn braille_role_description(&self) -> Option<&str>

An alternative to Node::role_description that assistive technologies may present on a Braille display instead of speaking it. The value is ordinary text, not Unicode Braille characters. ARIA 1.3 draft equivalent: aria-brailleroledescription.

Source

pub fn set_braille_role_description(&mut self, value: impl Into<String>)

Source

pub fn clear_braille_role_description(&mut self)

Source§

impl Node

Source

pub fn scroll_x(&self) -> Option<f64>

The current horizontal scroll position of this scrollable container.

Source

pub fn set_scroll_x(&mut self, value: f64)

Source

pub fn clear_scroll_x(&mut self)

Source§

impl Node

Source

pub fn scroll_x_min(&self) -> Option<f64>

The minimum horizontal scroll position of this scrollable container.

Source

pub fn set_scroll_x_min(&mut self, value: f64)

Source

pub fn clear_scroll_x_min(&mut self)

Source§

impl Node

Source

pub fn scroll_x_max(&self) -> Option<f64>

The maximum horizontal scroll position of this scrollable container.

Source

pub fn set_scroll_x_max(&mut self, value: f64)

Source

pub fn clear_scroll_x_max(&mut self)

Source§

impl Node

Source

pub fn scroll_y(&self) -> Option<f64>

The current vertical scroll position of this scrollable container.

Source

pub fn set_scroll_y(&mut self, value: f64)

Source

pub fn clear_scroll_y(&mut self)

Source§

impl Node

Source

pub fn scroll_y_min(&self) -> Option<f64>

The minimum vertical scroll position of this scrollable container.

Source

pub fn set_scroll_y_min(&mut self, value: f64)

Source

pub fn clear_scroll_y_min(&mut self)

Source§

impl Node

Source

pub fn scroll_y_max(&self) -> Option<f64>

The maximum vertical scroll position of this scrollable container.

Source

pub fn set_scroll_y_max(&mut self, value: f64)

Source

pub fn clear_scroll_y_max(&mut self)

Source§

impl Node

Source

pub fn numeric_value(&self) -> Option<f64>

The current numeric value of this range widget. ARIA equivalent: aria-valuenow.

Source

pub fn set_numeric_value(&mut self, value: f64)

Source

pub fn clear_numeric_value(&mut self)

Source§

impl Node

Source

pub fn min_numeric_value(&self) -> Option<f64>

The minimum allowed numeric value of this range widget. ARIA equivalent: aria-valuemin.

Source

pub fn set_min_numeric_value(&mut self, value: f64)

Source

pub fn clear_min_numeric_value(&mut self)

Source§

impl Node

Source

pub fn max_numeric_value(&self) -> Option<f64>

The maximum allowed numeric value of this range widget. ARIA equivalent: aria-valuemax.

Source

pub fn set_max_numeric_value(&mut self, value: f64)

Source

pub fn clear_max_numeric_value(&mut self)

Source§

impl Node

Source

pub fn numeric_value_step(&self) -> Option<f64>

The amount by which the numeric value changes when incremented or decremented by one step.

Source

pub fn set_numeric_value_step(&mut self, value: f64)

Source

pub fn clear_numeric_value_step(&mut self)

Source§

impl Node

Source

pub fn numeric_value_jump(&self) -> Option<f64>

The amount by which the numeric value changes for a large increment or decrement.

Source

pub fn set_numeric_value_jump(&mut self, value: f64)

Source

pub fn clear_numeric_value_jump(&mut self)

Source§

impl Node

Source

pub fn font_size(&self) -> Option<f32>

Font size is in pixels.

Source

pub fn set_font_size(&mut self, value: f32)

Source

pub fn clear_font_size(&mut self)

Source§

impl Node

Source

pub fn font_weight(&self) -> Option<f32>

Font weight can take on any arbitrary numeric value. Increments of 100 in range [0, 900] represent keywords such as light, normal, bold, etc.

Source

pub fn set_font_weight(&mut self, value: f32)

Source

pub fn clear_font_weight(&mut self)

Source§

impl Node

Source

pub fn row_count(&self) -> Option<usize>

The total number of rows in a table, grid, or tree grid. ARIA equivalent: aria-rowcount.

Source

pub fn set_row_count(&mut self, value: usize)

Source

pub fn clear_row_count(&mut self)

Source§

impl Node

Source

pub fn column_count(&self) -> Option<usize>

The total number of columns in a table, grid, or tree grid. ARIA equivalent: aria-colcount.

Source

pub fn set_column_count(&mut self, value: usize)

Source

pub fn clear_column_count(&mut self)

Source§

impl Node

Source

pub fn row_index(&self) -> Option<usize>

The row index of this node within a table, grid, or tree grid. ARIA equivalent: aria-rowindex.

Difference with ARIA: aria-rowindex is one-based, while this property is zero-based.

Source

pub fn set_row_index(&mut self, value: usize)

Source

pub fn clear_row_index(&mut self)

Source§

impl Node

Source

pub fn column_index(&self) -> Option<usize>

The column index of this node within a table, grid, or tree grid. ARIA equivalent: aria-colindex.

Difference with ARIA: aria-colindex is one-based, while this property is zero-based.

Source

pub fn set_column_index(&mut self, value: usize)

Source

pub fn clear_column_index(&mut self)

Source§

impl Node

Source

pub fn row_span(&self) -> Option<usize>

The number of rows spanned by a cell or grid cell. ARIA equivalent: aria-rowspan.

Source

pub fn set_row_span(&mut self, value: usize)

Source

pub fn clear_row_span(&mut self)

Source§

impl Node

Source

pub fn column_span(&self) -> Option<usize>

The number of columns spanned by a cell or grid cell. ARIA equivalent: aria-colspan.

Source

pub fn set_column_span(&mut self, value: usize)

Source

pub fn clear_column_span(&mut self)

Source§

impl Node

Source

pub fn level(&self) -> Option<usize>

The hierarchical level of this node within a structure. ARIA equivalent: aria-level.

Difference with ARIA: aria-level is one-based, while this property is zero-based.

Source

pub fn set_level(&mut self, value: usize)

Source

pub fn clear_level(&mut self)

Source§

impl Node

Source

pub fn size_of_set(&self) -> Option<usize>

For containers like Role::ListBox, specifies the total number of items. ARIA equivalent: aria-setsize.

Difference with ARIA: aria-setsize is set on each item, while this property is set on the container.

Source

pub fn set_size_of_set(&mut self, value: usize)

Source

pub fn clear_size_of_set(&mut self)

Source§

impl Node

Source

pub fn position_in_set(&self) -> Option<usize>

For items like Role::ListBoxOption, specifies their index in the item list. This must be less than the value of size_of_set as set on the container. ARIA equivalent: aria-posinset.

Difference with ARIA: aria-posinset is one-based, while this property is zero-based.

Source

pub fn set_position_in_set(&mut self, value: usize)

Source

pub fn clear_position_in_set(&mut self)

Source§

impl Node

Source

pub fn color_value(&self) -> Option<Color>

For Role::ColorWell, specifies the selected color.

Source

pub fn set_color_value(&mut self, value: Color)

Source

pub fn clear_color_value(&mut self)

Source§

impl Node

Source

pub fn background_color(&self) -> Option<Color>

Background color.

Source

pub fn set_background_color(&mut self, value: Color)

Source

pub fn clear_background_color(&mut self)

Source§

impl Node

Source

pub fn foreground_color(&self) -> Option<Color>

Foreground color.

Source

pub fn set_foreground_color(&mut self, value: Color)

Source

pub fn clear_foreground_color(&mut self)

Source§

impl Node

Source

pub fn overline(&self) -> Option<TextDecoration>

The style and color of the overline applied to this node’s text.

Source

pub fn set_overline(&mut self, value: TextDecoration)

Source

pub fn clear_overline(&mut self)

Source§

impl Node

Source

pub fn strikethrough(&self) -> Option<TextDecoration>

The style and color of the strikethrough applied to this node’s text.

Source

pub fn set_strikethrough(&mut self, value: TextDecoration)

Source

pub fn clear_strikethrough(&mut self)

Source§

impl Node

Source

pub fn underline(&self) -> Option<TextDecoration>

The style and color of the underline applied to this node’s text.

Source

pub fn set_underline(&mut self, value: TextDecoration)

Source

pub fn clear_underline(&mut self)

Source§

impl Node

Source

pub fn character_lengths(&self) -> &[u8]

For text runs, the length (non-inclusive) of each character in UTF-8 code units (bytes). The sum of these lengths must equal the length of value, also in bytes.

A character is defined as the smallest unit of text that can be selected. This isn’t necessarily a single Unicode scalar value (code point). This is why AccessKit can’t compute the lengths of the characters from the text itself; this information must be provided by the text editing implementation.

If this node is the last text run in a line that ends with a hard line break, that line break should be included at the end of this node’s value as either a CRLF or LF; in both cases, the line break should be counted as a single character for the sake of this slice. When the caret is at the end of such a line, the focus of the text selection should be on the line break, not after it.

Source

pub fn set_character_lengths(&mut self, value: impl Into<Vec<u8>>)

Source

pub fn clear_character_lengths(&mut self)

Source§

impl Node

Source

pub fn word_starts(&self) -> &[u8]

For text runs, the start index of each word in characters, as defined in character_lengths. This list must be sorted.

If this text run doesn’t contain the start of any words, but only the middle or end of a word, this list must be empty.

If this text run is the first in the document or the first in a paragraph (that is, the previous run ends with a newline character), then the first character of the run is implicitly the start of a word. In this case, beginning this list with 0 is permitted but not necessary.

The end of each word is the beginning of the next word; there are no characters that are not considered part of a word. Trailing whitespace is typically considered part of the word that precedes it, while a line’s leading whitespace is considered its own word. Whether punctuation is considered a separate word or part of the preceding word depends on the particular text editing implementation. Some editors may have their own definition of a word; for example, in an IDE, words may correspond to programming language tokens.

Not all assistive technologies require information about word boundaries, and not all platform accessibility APIs even expose this information, but for assistive technologies that do use this information, users will get unpredictable results if the word boundaries exposed by the accessibility tree don’t match the editor’s behavior. This is why AccessKit does not determine word boundaries itself.

Source

pub fn set_word_starts(&mut self, value: impl Into<Vec<u8>>)

Source

pub fn clear_word_starts(&mut self)

Source§

impl Node

Source

pub fn character_positions(&self) -> Option<&[f32]>

For text runs, this is the position of each character within the node’s bounding box, in the direction given by text_direction, in the coordinate space of this node.

When present, the length of this slice should be the same as the length of character_lengths, including for lines that end with a hard line break. The position of such a line break should be the position where an end-of-paragraph marker would be rendered.

This property is optional. Without it, AccessKit can’t support some use cases, such as screen magnifiers that track the caret position or screen readers that display a highlight cursor. However, most text functionality still works without this information.

Source

pub fn set_character_positions(&mut self, value: impl Into<Vec<f32>>)

Source

pub fn clear_character_positions(&mut self)

Source§

impl Node

Source

pub fn character_widths(&self) -> Option<&[f32]>

For text runs, this is the advance width of each character, in the direction given by text_direction, in the coordinate space of this node.

When present, the length of this slice should be the same as the length of character_lengths, including for lines that end with a hard line break. The width of such a line break should be non-zero if selecting the line break by itself results in a visible highlight (as in Microsoft Word), or zero if not (as in Windows Notepad).

This property is optional. Without it, AccessKit can’t support some use cases, such as screen magnifiers that track the caret position or screen readers that display a highlight cursor. However, most text functionality still works without this information.

Source

pub fn set_character_widths(&mut self, value: impl Into<Vec<f32>>)

Source

pub fn clear_character_widths(&mut self)

Source§

impl Node

Source

pub fn is_expanded(&self) -> Option<bool>

Whether this node is expanded, collapsed, or neither. ARIA equivalent: aria-expanded.

Setting this to false means the node is collapsed; omitting it means this state isn’t applicable.

Source

pub fn set_expanded(&mut self, value: bool)

Source

pub fn clear_expanded(&mut self)

Source§

impl Node

Source

pub fn is_selected(&self) -> Option<bool>

Indicates whether this node is selected or unselected. ARIA equivalent: aria-selected.

The absence of this flag (as opposed to a false setting) means that the concept of “selected” doesn’t apply. When deciding whether to set the flag to false or omit it, consider whether it would be appropriate for a screen reader to announce “not selected”. The ambiguity of this flag in platform accessibility APIs has made extraneous “not selected” announcements a common annoyance.

Source

pub fn set_selected(&mut self, value: bool)

Source

pub fn clear_selected(&mut self)

Source§

impl Node

Source

pub fn invalid(&self) -> Option<Invalid>

Whether this node’s input is invalid, and whether the error is related to spelling or grammar. ARIA equivalent: aria-invalid.

Source

pub fn set_invalid(&mut self, value: Invalid)

Source

pub fn clear_invalid(&mut self)

Source

pub fn toggled(&self) -> Option<Toggled>

The checked or pressed state of a toggle control. ARIA equivalents: aria-checked and aria-pressed.

Difference with ARIA: ARIA uses separate states for checked and pressed controls, while this property is interpreted based on the node’s role.

Source

pub fn set_toggled(&mut self, value: Toggled)

Source

pub fn clear_toggled(&mut self)

Source

pub fn live(&self) -> Option<Live>

The priority with which updates to this live region should be announced. ARIA equivalent: aria-live.

Source

pub fn set_live(&mut self, value: Live)

Source

pub fn clear_live(&mut self)

Source

pub fn text_direction(&self) -> Option<TextDirection>

The direction in which this node’s text is laid out.

Source

pub fn set_text_direction(&mut self, value: TextDirection)

Source

pub fn clear_text_direction(&mut self)

Source

pub fn orientation(&self) -> Option<Orientation>

Whether this node is oriented horizontally or vertically. ARIA equivalent: aria-orientation.

Source

pub fn set_orientation(&mut self, value: Orientation)

Source

pub fn clear_orientation(&mut self)

Source

pub fn sort_direction(&self) -> Option<SortDirection>

The direction in which items are sorted by this row or column header. ARIA equivalent: aria-sort.

Source

pub fn set_sort_direction(&mut self, value: SortDirection)

Source

pub fn clear_sort_direction(&mut self)

Source

pub fn aria_current(&self) -> Option<AriaCurrent>

Whether and how this node represents the current item within a set. ARIA equivalent: aria-current.

Source

pub fn set_aria_current(&mut self, value: AriaCurrent)

Source

pub fn clear_aria_current(&mut self)

Source

pub fn auto_complete(&self) -> Option<AutoComplete>

How predictions are presented while the user enters text. ARIA equivalent: aria-autocomplete.

Source

pub fn set_auto_complete(&mut self, value: AutoComplete)

Source

pub fn clear_auto_complete(&mut self)

Source

pub fn has_popup(&self) -> Option<HasPopup>

The type of interactive popup that can be triggered by this node. ARIA equivalent: aria-haspopup.

Source

pub fn set_has_popup(&mut self, value: HasPopup)

Source

pub fn clear_has_popup(&mut self)

Source

pub fn list_style(&self) -> Option<ListStyle>

The list marker style. Only available on list items.

Source

pub fn set_list_style(&mut self, value: ListStyle)

Source

pub fn clear_list_style(&mut self)

Source

pub fn text_align(&self) -> Option<TextAlign>

How this node’s text is aligned horizontally.

Source

pub fn set_text_align(&mut self, value: TextAlign)

Source

pub fn clear_text_align(&mut self)

Source

pub fn vertical_offset(&self) -> Option<VerticalOffset>

Whether this node’s text is rendered as subscript or superscript.

Source

pub fn set_vertical_offset(&mut self, value: VerticalOffset)

Source

pub fn clear_vertical_offset(&mut self)

Source§

impl Node

Source

pub fn transform(&self) -> Option<&Affine>

An affine transform to apply to any coordinates within this node and its descendants, including the bounds property of this node. The combined transforms of this node and its ancestors define the coordinate space of this node. /// This should be None if it would be set to the identity transform, which should be the case for most nodes.

AccessKit expects the final transformed coordinates to be relative to the origin of the tree’s container (e.g. window), in physical pixels, with the y coordinate being top-down.

Source

pub fn set_transform(&mut self, value: impl Into<Box<Affine>>)

Source

pub fn clear_transform(&mut self)

Source

pub fn bounds(&self) -> Option<Rect>

The bounding box of this node, in the node’s coordinate space. This property does not affect the coordinate space of either this node or its descendants; only the transform property affects that. This, along with the recommendation that most nodes should have a transform of None, implies that the bounds property of most nodes should be in the coordinate space of the nearest ancestor with a non-None transform, or if there is no such ancestor, the tree’s container (e.g. window).

Source

pub fn set_bounds(&mut self, value: Rect)

Source

pub fn clear_bounds(&mut self)

Source

pub fn text_selection(&self) -> Option<&TextSelection>

The current text selection or caret position within this node’s text.

Source

pub fn set_text_selection(&mut self, value: impl Into<Box<TextSelection>>)

Source

pub fn clear_text_selection(&mut self)

Source

pub fn tree_id(&self) -> Option<TreeId>

The tree that this node grafts. When set, this node acts as a graft point, and its child is the root of the specified subtree.

A graft node must be created before its subtree is pushed.

Removing a graft node or clearing this property removes its subtree, unless a new graft node is provided in the same update.

Source

pub fn set_tree_id(&mut self, value: TreeId)

Source

pub fn clear_tree_id(&mut self)

Source§

impl Node

Source

pub fn custom_actions(&self) -> &[CustomAction]

The application-defined actions supported by this node.

Source

pub fn set_custom_actions(&mut self, value: impl Into<Vec<CustomAction>>)

Source

pub fn clear_custom_actions(&mut self)

Source§

impl Node

Source

pub fn push_custom_action(&mut self, item: CustomAction)

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Node

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Node

Source§

fn default() -> Node

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Node

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Node

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Node

Source§

fn eq(&self, other: &Node) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Node

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.