Struct bevy::a11y::accesskit::NodeBuilder

pub struct NodeBuilder { /* private fields */ }
Expand description

Builds a Node.

Implementations§

§

impl NodeBuilder

pub fn new(role: Role) -> NodeBuilder

Examples found in repository?
examples/ui/ui.rs (line 169)
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    // Camera
    commands.spawn((Camera2dBundle::default(), IsDefaultUiCamera));

    // root node
    commands
        .spawn(NodeBundle {
            style: Style {
                width: Val::Percent(100.0),
                height: Val::Percent(100.0),
                justify_content: JustifyContent::SpaceBetween,
                ..default()
            },
            ..default()
        })
        .with_children(|parent| {
            // left vertical fill (border)
            parent
                .spawn(NodeBundle {
                    style: Style {
                        width: Val::Px(200.),
                        border: UiRect::all(Val::Px(2.)),
                        ..default()
                    },
                    background_color: Color::srgb(0.65, 0.65, 0.65).into(),
                    ..default()
                })
                .with_children(|parent| {
                    // left vertical fill (content)
                    parent
                        .spawn(NodeBundle {
                            style: Style {
                                width: Val::Percent(100.),
                                flex_direction: FlexDirection::Column,
                                padding: UiRect::all(Val::Px(5.)),
                                row_gap: Val::Px(5.),
                                ..default()
                            },
                            background_color: Color::srgb(0.15, 0.15, 0.15).into(),
                            ..default()
                        })
                        .with_children(|parent| {
                            // text
                            parent.spawn((
                                TextBundle::from_section(
                                    "Text Example",
                                    TextStyle {
                                        font: asset_server.load("fonts/FiraSans-Bold.ttf"),
                                        font_size: 30.0,
                                        ..default()
                                    },
                                ),
                                // Because this is a distinct label widget and
                                // not button/list item text, this is necessary
                                // for accessibility to treat the text accordingly.
                                Label,
                            ));

                            #[cfg(feature = "bevy_dev_tools")]
                            // Debug overlay text
                            parent.spawn((
                                TextBundle::from_section(
                                    "Press Space to enable debug outlines.",
                                    TextStyle {
                                        font: asset_server.load("fonts/FiraSans-Bold.ttf"),
                                        font_size: 20.,
                                        ..Default::default()
                                    },
                                ),
                                Label,
                            ));

                            #[cfg(not(feature = "bevy_dev_tools"))]
                            parent.spawn((
                                TextBundle::from_section(
                                    "Try enabling feature \"bevy_dev_tools\".",
                                    TextStyle {
                                        font: asset_server.load("fonts/FiraSans-Bold.ttf"),
                                        font_size: 20.,
                                        ..Default::default()
                                    },
                                ),
                                Label,
                            ));
                        });
                });
            // right vertical fill
            parent
                .spawn(NodeBundle {
                    style: Style {
                        flex_direction: FlexDirection::Column,
                        justify_content: JustifyContent::Center,
                        align_items: AlignItems::Center,
                        width: Val::Px(200.),
                        ..default()
                    },
                    background_color: Color::srgb(0.15, 0.15, 0.15).into(),
                    ..default()
                })
                .with_children(|parent| {
                    // Title
                    parent.spawn((
                        TextBundle::from_section(
                            "Scrolling list",
                            TextStyle {
                                font: asset_server.load("fonts/FiraSans-Bold.ttf"),
                                font_size: 25.,
                                ..default()
                            },
                        ),
                        Label,
                    ));
                    // List with hidden overflow
                    parent
                        .spawn(NodeBundle {
                            style: Style {
                                flex_direction: FlexDirection::Column,
                                align_self: AlignSelf::Stretch,
                                height: Val::Percent(50.),
                                overflow: Overflow::clip_y(),
                                ..default()
                            },
                            background_color: Color::srgb(0.10, 0.10, 0.10).into(),
                            ..default()
                        })
                        .with_children(|parent| {
                            // Moving panel
                            parent
                                .spawn((
                                    NodeBundle {
                                        style: Style {
                                            flex_direction: FlexDirection::Column,
                                            align_items: AlignItems::Center,
                                            ..default()
                                        },
                                        ..default()
                                    },
                                    ScrollingList::default(),
                                    AccessibilityNode(NodeBuilder::new(Role::List)),
                                ))
                                .with_children(|parent| {
                                    // List items
                                    for i in 0..30 {
                                        parent.spawn((
                                            TextBundle::from_section(
                                                format!("Item {i}"),
                                                TextStyle {
                                                    font: asset_server
                                                        .load("fonts/FiraSans-Bold.ttf"),
                                                    font_size: 20.,
                                                    ..default()
                                                },
                                            ),
                                            Label,
                                            AccessibilityNode(NodeBuilder::new(Role::ListItem)),
                                        ));
                                    }
                                });
                        });
                });
            parent
                .spawn(NodeBundle {
                    style: Style {
                        width: Val::Px(200.0),
                        height: Val::Px(200.0),
                        position_type: PositionType::Absolute,
                        left: Val::Px(210.),
                        bottom: Val::Px(10.),
                        border: UiRect::all(Val::Px(20.)),
                        ..default()
                    },
                    border_color: LIME.into(),
                    background_color: Color::srgb(0.4, 0.4, 1.).into(),
                    ..default()
                })
                .with_children(|parent| {
                    parent.spawn(NodeBundle {
                        style: Style {
                            width: Val::Percent(100.0),
                            height: Val::Percent(100.0),
                            ..default()
                        },
                        background_color: Color::srgb(0.8, 0.8, 1.).into(),
                        ..default()
                    });
                });
            // render order test: reddest in the back, whitest in the front (flex center)
            parent
                .spawn(NodeBundle {
                    style: Style {
                        width: Val::Percent(100.0),
                        height: Val::Percent(100.0),
                        position_type: PositionType::Absolute,
                        align_items: AlignItems::Center,
                        justify_content: JustifyContent::Center,
                        ..default()
                    },
                    ..default()
                })
                .with_children(|parent| {
                    parent
                        .spawn(NodeBundle {
                            style: Style {
                                width: Val::Px(100.0),
                                height: Val::Px(100.0),
                                ..default()
                            },
                            background_color: Color::srgb(1.0, 0.0, 0.).into(),
                            ..default()
                        })
                        .with_children(|parent| {
                            parent.spawn(NodeBundle {
                                style: Style {
                                    // Take the size of the parent node.
                                    width: Val::Percent(100.0),
                                    height: Val::Percent(100.0),
                                    position_type: PositionType::Absolute,
                                    left: Val::Px(20.),
                                    bottom: Val::Px(20.),
                                    ..default()
                                },
                                background_color: Color::srgb(1.0, 0.3, 0.3).into(),
                                ..default()
                            });
                            parent.spawn(NodeBundle {
                                style: Style {
                                    width: Val::Percent(100.0),
                                    height: Val::Percent(100.0),
                                    position_type: PositionType::Absolute,
                                    left: Val::Px(40.),
                                    bottom: Val::Px(40.),
                                    ..default()
                                },
                                background_color: Color::srgb(1.0, 0.5, 0.5).into(),
                                ..default()
                            });
                            parent.spawn(NodeBundle {
                                style: Style {
                                    width: Val::Percent(100.0),
                                    height: Val::Percent(100.0),
                                    position_type: PositionType::Absolute,
                                    left: Val::Px(60.),
                                    bottom: Val::Px(60.),
                                    ..default()
                                },
                                background_color: Color::srgb(1.0, 0.7, 0.7).into(),
                                ..default()
                            });
                            // alpha test
                            parent.spawn(NodeBundle {
                                style: Style {
                                    width: Val::Percent(100.0),
                                    height: Val::Percent(100.0),
                                    position_type: PositionType::Absolute,
                                    left: Val::Px(80.),
                                    bottom: Val::Px(80.),
                                    ..default()
                                },
                                background_color: Color::srgba(1.0, 0.9, 0.9, 0.4).into(),
                                ..default()
                            });
                        });
                });
            // bevy logo (flex center)
            parent
                .spawn(NodeBundle {
                    style: Style {
                        width: Val::Percent(100.0),
                        position_type: PositionType::Absolute,
                        justify_content: JustifyContent::Center,
                        align_items: AlignItems::FlexStart,
                        ..default()
                    },
                    ..default()
                })
                .with_children(|parent| {
                    // bevy logo (image)
                    // A `NodeBundle` is used to display the logo the image as an `ImageBundle` can't automatically
                    // size itself with a child node present.
                    parent
                        .spawn((
                            NodeBundle {
                                style: Style {
                                    width: Val::Px(500.0),
                                    height: Val::Px(125.0),
                                    margin: UiRect::top(Val::VMin(5.)),
                                    ..default()
                                },
                                ..default()
                            },
                            UiImage::new(asset_server.load("branding/bevy_logo_dark_big.png")),
                        ))
                        .with_children(|parent| {
                            // alt text
                            // This UI node takes up no space in the layout and the `Text` component is used by the accessibility module
                            // and is not rendered.
                            parent.spawn((
                                NodeBundle {
                                    style: Style {
                                        display: Display::None,
                                        ..Default::default()
                                    },
                                    ..Default::default()
                                },
                                Text::from_section("Bevy logo", TextStyle::default()),
                            ));
                        });
                });
        });
}

pub fn build(self, classes: &mut NodeClassSet) -> Node

§

impl NodeBuilder

pub fn role(&self) -> Role

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

§

impl NodeBuilder

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

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

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

pub fn clear_actions(&mut self)

§

impl NodeBuilder

pub fn is_hovered(&self) -> bool

pub fn set_hovered(&mut self)

pub fn clear_hovered(&mut self)

pub fn is_hidden(&self) -> bool

Exclude this node and its descendants from the tree presented to assistive technologies, and from hit testing.

pub fn set_hidden(&mut self)

pub fn clear_hidden(&mut self)

pub fn is_linked(&self) -> bool

pub fn set_linked(&mut self)

pub fn clear_linked(&mut self)

pub fn is_multiselectable(&self) -> bool

pub fn set_multiselectable(&mut self)

pub fn clear_multiselectable(&mut self)

pub fn is_required(&self) -> bool

pub fn set_required(&mut self)

pub fn clear_required(&mut self)

pub fn is_visited(&self) -> bool

pub fn set_visited(&mut self)

pub fn clear_visited(&mut self)

pub fn is_busy(&self) -> bool

pub fn set_busy(&mut self)

pub fn clear_busy(&mut self)

pub fn is_live_atomic(&self) -> bool

pub fn set_live_atomic(&mut self)

pub fn clear_live_atomic(&mut self)

pub fn is_modal(&self) -> bool

If a dialog box is marked as explicitly modal.

pub fn set_modal(&mut self)

pub fn clear_modal(&mut self)

pub fn is_touch_transparent(&self) -> 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.

pub fn set_touch_transparent(&mut self)

pub fn clear_touch_transparent(&mut self)

pub fn is_read_only(&self) -> bool

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

pub fn set_read_only(&mut self)

pub fn clear_read_only(&mut self)

pub fn is_disabled(&self) -> bool

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

pub fn set_disabled(&mut self)

pub fn clear_disabled(&mut self)

pub fn is_bold(&self) -> bool

pub fn set_bold(&mut self)

pub fn clear_bold(&mut self)

pub fn is_italic(&self) -> bool

pub fn set_italic(&mut self)

pub fn clear_italic(&mut self)

pub fn clips_children(&self) -> bool

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

pub fn set_clips_children(&mut self)

pub fn clear_clips_children(&mut self)

pub fn is_line_breaking_object(&self) -> bool

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

pub fn set_is_line_breaking_object(&mut self)

pub fn clear_is_line_breaking_object(&mut self)

pub fn is_page_breaking_object(&self) -> bool

Indicates whether this node causes a page break.

pub fn set_is_page_breaking_object(&mut self)

pub fn clear_is_page_breaking_object(&mut self)

pub fn is_spelling_error(&self) -> bool

pub fn set_is_spelling_error(&mut self)

pub fn clear_is_spelling_error(&mut self)

pub fn is_grammar_error(&self) -> bool

pub fn set_is_grammar_error(&mut self)

pub fn clear_is_grammar_error(&mut self)

pub fn is_search_match(&self) -> bool

pub fn set_is_search_match(&mut self)

pub fn clear_is_search_match(&mut self)

pub fn is_suggestion(&self) -> bool

pub fn set_is_suggestion(&mut self)

pub fn clear_is_suggestion(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_children(&mut self)

§

impl NodeBuilder

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

§

impl NodeBuilder

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

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

pub fn clear_controls(&mut self)

§

impl NodeBuilder

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

§

impl NodeBuilder

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

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

pub fn clear_details(&mut self)

§

impl NodeBuilder

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

§

impl NodeBuilder

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

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

pub fn clear_described_by(&mut self)

§

impl NodeBuilder

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

§

impl NodeBuilder

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

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

pub fn clear_flow_to(&mut self)

§

impl NodeBuilder

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

§

impl NodeBuilder

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

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

pub fn clear_labelled_by(&mut self)

§

impl NodeBuilder

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

§

impl NodeBuilder

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

On radio buttons this should be set to a list of all of the buttons in the same group as this one, including this radio button itself.

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

pub fn clear_radio_group(&mut self)

§

impl NodeBuilder

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

§

impl NodeBuilder

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

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

pub fn clear_active_descendant(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_error_message(&mut self)

§

impl NodeBuilder

§

impl NodeBuilder

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

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

pub fn clear_member_of(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_next_on_line(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_previous_on_line(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_popup_for(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_header(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_row_header(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_column_header(&mut self)

§

impl NodeBuilder

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

pub fn set_name(&mut self, value: impl Into<Box<str>>)

pub fn clear_name(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_description(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_value(&mut self)

§

impl NodeBuilder

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.

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

pub fn clear_access_key(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_class_name(&mut self)

§

impl NodeBuilder

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

Only present when different from parent.

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

pub fn clear_font_family(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_html_tag(&mut self)

§

impl NodeBuilder

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.

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

pub fn clear_inner_html(&mut self)

§

impl NodeBuilder

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.

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

pub fn clear_keyboard_shortcut(&mut self)

§

impl NodeBuilder

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

Only present when different from parent.

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

pub fn clear_language(&mut self)

§

impl NodeBuilder

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

If a text input has placeholder text, it should be exposed through this property rather than name.

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

pub fn clear_placeholder(&mut self)

§

impl NodeBuilder

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 of this property should be in a human-friendly, localized format.

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

pub fn clear_role_description(&mut self)

§

impl NodeBuilder

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.

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

pub fn clear_state_description(&mut self)

§

impl NodeBuilder

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

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

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

pub fn clear_tooltip(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_url(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_scroll_x(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_scroll_x_min(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_scroll_x_max(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_scroll_y(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_scroll_y_min(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_scroll_y_max(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_numeric_value(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_min_numeric_value(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_max_numeric_value(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_numeric_value_step(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_numeric_value_jump(&mut self)

§

impl NodeBuilder

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

Font size is in pixels.

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

pub fn clear_font_size(&mut self)

§

impl NodeBuilder

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

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

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

pub fn clear_font_weight(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_row_count(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_column_count(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_row_index(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_column_index(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_cell_column_index(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_cell_column_span(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_cell_row_index(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_table_cell_row_span(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_hierarchical_level(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_size_of_set(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_position_in_set(&mut self)

§

impl NodeBuilder

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

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

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

pub fn clear_color_value(&mut self)

§

impl NodeBuilder

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

Background color in RGBA.

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

pub fn clear_background_color(&mut self)

§

impl NodeBuilder

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

Foreground color in RGBA.

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

pub fn clear_foreground_color(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_overline(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_strikethrough(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_underline(&mut self)

§

impl NodeBuilder

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

For inline text. 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 box 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.

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

pub fn clear_character_lengths(&mut self)

§

impl NodeBuilder

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

For inline text. The length of each word in characters, as defined in character_lengths. The sum of these lengths must equal the length of character_lengths.

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.

pub fn set_word_lengths(&mut self, value: impl Into<Box<[u8]>>)

pub fn clear_word_lengths(&mut self)

§

impl NodeBuilder

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

For inline text. 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.

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

pub fn clear_character_positions(&mut self)

§

impl NodeBuilder

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

For inline text. 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.

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

pub fn clear_character_widths(&mut self)

§

impl NodeBuilder

pub fn is_expanded(&self) -> 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.

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

pub fn clear_expanded(&mut self)

§

impl NodeBuilder

pub fn is_selected(&self) -> 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.

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

pub fn clear_selected(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_invalid(&mut self)

pub fn checked(&self) -> Option<Checked>

pub fn set_checked(&mut self, value: Checked)

pub fn clear_checked(&mut self)

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

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

pub fn clear_live(&mut self)

pub fn default_action_verb(&self) -> Option<DefaultActionVerb>

pub fn set_default_action_verb(&mut self, value: DefaultActionVerb)

pub fn clear_default_action_verb(&mut self)

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

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

pub fn clear_text_direction(&mut self)

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

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

pub fn clear_orientation(&mut self)

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

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

pub fn clear_sort_direction(&mut self)

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

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

pub fn clear_aria_current(&mut self)

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

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

pub fn clear_auto_complete(&mut self)

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

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

pub fn clear_has_popup(&mut self)

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

The list style type. Only available on list items.

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

pub fn clear_list_style(&mut self)

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

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

pub fn clear_text_align(&mut self)

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

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

pub fn clear_vertical_offset(&mut self)

§

impl NodeBuilder

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.

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

pub fn clear_transform(&mut self)

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).

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

pub fn clear_bounds(&mut self)

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

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

pub fn clear_text_selection(&mut self)

§

impl NodeBuilder

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

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

pub fn clear_custom_actions(&mut self)

§

impl NodeBuilder

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

Trait Implementations§

§

impl Clone for NodeBuilder

§

fn clone(&self) -> NodeBuilder

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
§

impl Debug for NodeBuilder

§

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

Formats the value using the given formatter. Read more
§

impl Default for NodeBuilder

§

fn default() -> NodeBuilder

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

impl From<NodeBuilder> for AccessibilityNode

§

fn from(node: NodeBuilder) -> AccessibilityNode

Converts to this type from the input type.
§

impl PartialEq for NodeBuilder

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for NodeBuilder

Auto Trait Implementations§

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
§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> FromWorld for T
where T: Default,

§

fn from_world(_world: &mut World) -> T

Creates Self using data from the given World.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

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

§

type Error = Infallible

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>,

§

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.
§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

§

fn clone_type_data(&self) -> Box<dyn TypeData>

§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> ConditionalSend for T
where T: Send,

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> Settings for T
where T: 'static + Send + Sync,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,