pub struct SemanticsNode {Show 30 fields
pub node_id: NodeId,
pub role: SemanticsRole,
pub widget_role: Option<SemanticsWidgetRole>,
pub actions: Vec<SemanticsAction>,
pub children: Vec<SemanticsNode>,
pub description: Option<String>,
pub state_description: Option<String>,
pub on_click_label: Option<String>,
pub selected: Option<bool>,
pub toggled: Option<bool>,
pub enabled: bool,
pub custom_actions: Vec<SemanticsCustomAction>,
pub canvas_children: Vec<CanvasSemanticsNode>,
pub editable_text: bool,
pub hidden: bool,
pub merge_descendants: bool,
pub selectable_group: bool,
pub pane_title: Option<String>,
pub text: Option<String>,
pub text_selection: Option<TextRange>,
pub focusable: bool,
pub focused: bool,
pub live_region: Option<LiveRegionMode>,
pub progress: Option<ProgressBarRangeInfo>,
pub set_progress: Option<SemanticsSetProgress>,
pub set_text: Option<SemanticsSetText>,
pub vertical_scroll: Option<ScrollAxisRange>,
pub horizontal_scroll: Option<ScrollAxisRange>,
pub scroll_by: Option<SemanticsScrollBy>,
pub collection: Option<CollectionInfo>,
}Expand description
A single node within the semantics tree.
Not Eq: a node now carries drawn-control bounds, which are floats. The
tree is compared for “did anything a screen reader can see change”, and
that comparison is PartialEq everywhere else on the accessibility path
(AccessibilityRect, AccessibilityElement) for the same reason.
Fields§
§node_id: NodeId§role: SemanticsRoleWhere this node sits in the tree (layout, text, subcomposition …).
widget_role: Option<SemanticsWidgetRole>What kind of control this node is, as a screen reader announces it —
Compose’s Role. Separate from SemanticsNode::role because a
clickable Row is structurally a layout node and semantically a button.
actions: Vec<SemanticsAction>§children: Vec<SemanticsNode>§description: Option<String>§state_description: Option<String>§on_click_label: Option<String>§selected: Option<bool>§toggled: Option<bool>§enabled: bool§custom_actions: Vec<SemanticsCustomAction>§canvas_children: Vec<CanvasSemanticsNode>Controls this node drew rather than laid out; their bounds are relative
to this node’s own top-left. See CanvasSemanticsNode.
editable_text: boolWhether a screen reader skips this node and everything under it.
merge_descendants: boolWhether a screen reader takes this node and the text under it as one stop.
selectable_group: boolWhether the selectable controls under this node form one group.
pane_title: Option<String>The title of the screen or pane this node is the root of.
text: Option<String>The text an editable field holds.
text_selection: Option<TextRange>§focusable: boolWhether this node registered a focus target, so focus can land on it.
Compose’s SemanticsProperties.Focused companion.
focused: boolWhether focus sits on this node right now.
live_region: Option<LiveRegionMode>How urgently a screen reader reads this node when its text changes.
Compose’s SemanticsProperties.LiveRegion.
progress: Option<ProgressBarRangeInfo>The value this control holds inside a range. Compose’s
ProgressBarRangeInfo.
set_progress: Option<SemanticsSetProgress>What this control does when a screen reader moves its value.
set_text: Option<SemanticsSetText>What this field does when a screen reader hands it text.
vertical_scroll: Option<ScrollAxisRange>How far this container scrolled up and down, when it scrolls.
horizontal_scroll: Option<ScrollAxisRange>How far this container scrolled left and right, when it scrolls.
scroll_by: Option<SemanticsScrollBy>What this container does when a screen reader pages it.
collection: Option<CollectionInfo>How many rows and columns this list holds, when it is a list.
Trait Implementations§
Source§impl Clone for SemanticsNode
impl Clone for SemanticsNode
Source§fn clone(&self) -> SemanticsNode
fn clone(&self) -> SemanticsNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more