Struct accesskit::Node[][src]

pub struct Node {
Show 140 fields pub id: NodeId, pub role: Role, pub transform: Option<Box<Affine>>, pub bounds: Option<Rect>, pub children: Vec<NodeId>, pub actions: EnumSet<Action>, pub name: Option<Box<str>>, pub name_from: Option<NameFrom>, pub description: Option<Box<str>>, pub description_from: Option<DescriptionFrom>, pub value: Option<Box<str>>, pub autofill_available: bool, pub expanded: Option<bool>, pub default: bool, pub editable: bool, pub focusable: bool, pub orientation: Option<Orientation>, pub hovered: bool, pub ignored: bool, pub invisible: bool, pub linked: bool, pub multiline: bool, pub multiselectable: bool, pub protected: bool, pub required: bool, pub visited: bool, pub busy: bool, pub nonatomic_text_field_root: bool, pub container_live_atomic: bool, pub container_live_busy: bool, pub live_atomic: bool, pub modal: bool, pub canvas_has_fallback: bool, pub scrollable: bool, pub clickable: bool, pub clips_children: bool, pub not_user_selectable_style: bool, pub selected: Option<bool>, pub selected_from_focus: bool, pub grabbed: Option<bool>, pub drop_effects: EnumSet<DropEffect>, pub is_line_breaking_object: bool, pub is_page_breaking_object: bool, pub has_aria_attribute: bool, pub touch_pass_through: bool, pub indirect_children: Vec<NodeId>, pub active_descendant: Option<NodeId>, pub error_message: Option<NodeId>, pub in_page_link_target: Option<NodeId>, pub member_of: Option<NodeId>, pub next_on_line: Option<NodeId>, pub previous_on_line: Option<NodeId>, pub popup_for: Option<NodeId>, pub controls: Vec<NodeId>, pub details: Vec<NodeId>, pub described_by: Vec<NodeId>, pub flow_to: Vec<NodeId>, pub labelled_by: Vec<NodeId>, pub radio_groups: Vec<NodeId>, pub markers: Box<[TextMarker]>, pub text_direction: Option<TextDirection>, pub character_offsets: Box<[f32]>, pub words: Box<[Range<usize>]>, pub custom_actions: Box<[CustomAction]>, pub access_key: Option<Box<str>>, pub invalid_state: Option<InvalidState>, pub auto_complete: Option<Box<str>>, pub checked_state: Option<CheckedState>, pub checked_state_description: Option<Box<str>>, pub child_tree: Option<TreeId>, pub class_name: Option<Box<str>>, pub container_live_relevant: Option<Box<str>>, pub container_live_status: Option<Box<str>>, pub css_display: Option<Box<str>>, pub font_family: Option<Box<str>>, pub html_tag: Option<Box<str>>, pub inner_html: Option<Box<str>>, pub input_type: Option<Box<str>>, pub key_shortcuts: Option<Box<str>>, pub language: Option<Box<str>>, pub live_relevant: Option<Box<str>>, pub live_status: Option<Box<str>>, pub placeholder: Option<Box<str>>, pub aria_role: Option<Box<str>>, pub role_description: Option<Box<str>>, pub tooltip: Option<Box<str>>, pub url: Option<Box<str>>, pub default_action_verb: Option<DefaultActionVerb>, pub scroll_x: Option<f32>, pub scroll_x_min: Option<f32>, pub scroll_x_max: Option<f32>, pub scroll_y: Option<f32>, pub scroll_y_min: Option<f32>, pub scroll_y_max: Option<f32>, pub text_selection: Option<TextSelection>, pub aria_column_count: Option<usize>, pub aria_cell_column_index: Option<usize>, pub aria_cell_column_span: Option<usize>, pub aria_row_count: Option<usize>, pub aria_cell_row_index: Option<usize>, pub aria_cell_row_span: Option<usize>, pub table_row_count: Option<usize>, pub table_column_count: Option<usize>, pub table_header: Option<NodeId>, pub table_row_index: Option<usize>, pub table_row_header: Option<NodeId>, pub table_column_index: Option<usize>, pub table_column_header: Option<NodeId>, pub table_cell_column_index: Option<usize>, pub table_cell_column_span: Option<usize>, pub table_cell_row_index: Option<usize>, pub table_cell_row_span: Option<usize>, pub sort_direction: Option<SortDirection>, pub hierarchical_level: Option<usize>, pub read_only: bool, pub disabled: bool, pub set_size: Option<usize>, pub pos_in_set: Option<usize>, pub color_value: Option<u32>, pub aria_current: Option<AriaCurrent>, pub background_color: Option<u32>, pub foreground_color: Option<u32>, pub has_popup: Option<HasPopup>, pub list_style: Option<ListStyle>, pub text_align: Option<TextAlign>, pub vertical_offset: Option<VerticalOffset>, pub bold: bool, pub italic: bool, pub overline: Option<TextDecoration>, pub strikethrough: Option<TextDecoration>, pub underline: Option<TextDecoration>, pub previous_focus: Option<NodeId>, pub next_focus: Option<NodeId>, pub value_for_range: Option<f32>, pub min_value_for_range: Option<f32>, pub max_value_for_range: Option<f32>, pub step_value_for_range: Option<f32>, pub font_size: Option<f32>, pub font_weight: Option<f32>, pub text_indent: Option<f32>,
}
Expand description

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

Fields

id: NodeIdrole: Roletransform: Option<Box<Affine>>

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

AccessKit is not opinionated about the resolution dependence or y direction of any coordinates; these requirements are ultimately determined by the platform accessibility API. This implies that for a tree generated by cross-platform code, a platform-specific layer between that cross-platform code and the AccessKit platform adapter must add an appropriate transform to the root node. However, AccessKit expects the final transformed coordinates to be relative to the origin of the tree’s container (e.g. window).

bounds: Option<Rect>

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

children: Vec<NodeId>actions: EnumSet<Action>

Unordered set of actions supported by this node.

name: Option<Box<str>>name_from: Option<NameFrom>

What information was used to compute the object’s name.

description: Option<Box<str>>description_from: Option<DescriptionFrom>

What information was used to compute the object’s description.

value: Option<Box<str>>autofill_available: boolexpanded: Option<bool>

Whether this node is expanded, collapsed, or neither. Setting this to false means the node is collapsed; omitting it means this state isn’t applicable.

default: booleditable: boolfocusable: boolorientation: Option<Orientation>hovered: boolignored: bool

Skip over this node in the accessibility tree, but keep its subtree.

invisible: boollinked: boolmultiline: boolmultiselectable: boolprotected: boolrequired: boolvisited: boolbusy: boolnonatomic_text_field_root: bool

The object functions as a text field which exposes its descendants. Use cases include the root of a content-editable region, an ARIA textbox which isn’t currently editable and which has interactive descendants, and a

element that has “design-mode” set to “on”.
container_live_atomic: boolcontainer_live_busy: boollive_atomic: boolmodal: bool

If a dialog box is marked as explicitly modal

canvas_has_fallback: bool

Set on a canvas element if it has fallback content.

scrollable: bool

Indicates this node is user-scrollable, e.g. overflow:scroll|auto, as opposed to only programmatically scrollable, like overflow:hidden, or not scrollable at all, e.g. overflow:visible.

clickable: bool

A hint to clients that the node is clickable.

clips_children: bool

Indicates that this node clips its children, i.e. may have overflow: hidden or clip children by default.

not_user_selectable_style: bool

Indicates that this node is not selectable because the style has user-select: none. Note that there may be other reasons why a node is not selectable - for example, bullets in a list. However, this attribute is only set on user-select: none.

selected: Option<bool>

Indicates whether this node is selected or unselected. 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.

selected_from_focus: bool

Indicates whether this node is selected due to selection follows focus.

grabbed: Option<bool>

Indicates whether this node can be grabbed for drag-and-drop operation. Setting this flag to false rather than omitting it means that this node is not currently grabbed but it can be. Note: aria-grabbed is deprecated in WAI-ARIA 1.1.

drop_effects: EnumSet<DropEffect>is_line_breaking_object: bool

Indicates whether this node causes a hard line-break (e.g. block level elements, or
)

is_page_breaking_object: bool

Indicates whether this node causes a page break

has_aria_attribute: bool

True if the node has any ARIA attributes set.

touch_pass_through: bool

This element allows touches to be passed through when a screen reader is in touch exploration mode, e.g. a virtual keyboard normally behaves this way.

indirect_children: Vec<NodeId>

Ids of nodes that are children of this node logically, but are not children of this node in the tree structure. As an example, a table cell is a child of a row, and an ‘indirect’ child of a column.

active_descendant: Option<NodeId>error_message: Option<NodeId>in_page_link_target: Option<NodeId>member_of: Option<NodeId>next_on_line: Option<NodeId>previous_on_line: Option<NodeId>popup_for: Option<NodeId>controls: Vec<NodeId>details: Vec<NodeId>described_by: Vec<NodeId>flow_to: Vec<NodeId>labelled_by: Vec<NodeId>radio_groups: Vec<NodeId>markers: Box<[TextMarker]>text_direction: Option<TextDirection>character_offsets: Box<[f32]>

For inline text. This is the pixel position of the end of each character within the bounding rectangle of this object, in the direction given by Node::text_direction. For example, for left-to-right text, the first offset is the right coordinate of the first character within the object’s bounds, the second offset is the right coordinate of the second character, and so on.

words: Box<[Range<usize>]>

For inline text. The indices of each word, in code units for the encoding specified in Tree::source_string_encoding.

custom_actions: Box<[CustomAction]>access_key: Option<Box<str>>invalid_state: Option<InvalidState>auto_complete: Option<Box<str>>checked_state: Option<CheckedState>checked_state_description: Option<Box<str>>child_tree: Option<TreeId>class_name: Option<Box<str>>container_live_relevant: Option<Box<str>>container_live_status: Option<Box<str>>css_display: Option<Box<str>>font_family: Option<Box<str>>

Only present when different from parent.

html_tag: Option<Box<str>>inner_html: Option<Box<str>>

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

input_type: Option<Box<str>>key_shortcuts: Option<Box<str>>language: Option<Box<str>>

Only present when different from parent.

live_relevant: Option<Box<str>>live_status: Option<Box<str>>placeholder: Option<Box<str>>

Only if not already exposed in Node::name (NameFrom::Placeholder).

aria_role: Option<Box<str>>role_description: Option<Box<str>>tooltip: Option<Box<str>>

Only if not already exposed in Node::name (NameFrom::Title).

url: Option<Box<str>>default_action_verb: Option<DefaultActionVerb>scroll_x: Option<f32>scroll_x_min: Option<f32>scroll_x_max: Option<f32>scroll_y: Option<f32>scroll_y_min: Option<f32>scroll_y_max: Option<f32>text_selection: Option<TextSelection>aria_column_count: Option<usize>aria_cell_column_index: Option<usize>aria_cell_column_span: Option<usize>aria_row_count: Option<usize>aria_cell_row_index: Option<usize>aria_cell_row_span: Option<usize>table_row_count: Option<usize>table_column_count: Option<usize>table_header: Option<NodeId>table_row_index: Option<usize>table_row_header: Option<NodeId>table_column_index: Option<usize>table_column_header: Option<NodeId>table_cell_column_index: Option<usize>table_cell_column_span: Option<usize>table_cell_row_index: Option<usize>table_cell_row_span: Option<usize>sort_direction: Option<SortDirection>hierarchical_level: Option<usize>

Tree control attributes.

read_only: bool

Use for a textbox that allows focus/selection but not input.

disabled: bool

Use for a control or group of controls that disallows input.

set_size: Option<usize>pos_in_set: Option<usize>color_value: Option<u32>

For Role::ColorWell, specifies the selected color in RGBA.

aria_current: Option<AriaCurrent>background_color: Option<u32>

Background color in RGBA.

foreground_color: Option<u32>

Foreground color in RGBA.

has_popup: Option<HasPopup>list_style: Option<ListStyle>

The list style type. Only available on list items.

text_align: Option<TextAlign>vertical_offset: Option<VerticalOffset>bold: boolitalic: booloverline: Option<TextDecoration>strikethrough: Option<TextDecoration>underline: Option<TextDecoration>previous_focus: Option<NodeId>next_focus: Option<NodeId>value_for_range: Option<f32>min_value_for_range: Option<f32>max_value_for_range: Option<f32>step_value_for_range: Option<f32>font_size: Option<f32>

Font size is in pixels.

font_weight: 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.

text_indent: Option<f32>

The text indent of the text, in mm.

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

The name of the generated JSON Schema. Read more

Generates a JSON Schema for this type. Read more

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.