pub struct WidgetAccessInfoBuilder<'a> { /* private fields */ }
Expand description
Accessibility metadata.
Implementations§
source§impl WidgetAccessInfoBuilder<'_>
impl WidgetAccessInfoBuilder<'_>
sourcepub fn set_role(&mut self, role: AccessRole)
pub fn set_role(&mut self, role: AccessRole)
Set the accessibility role of the widget.
sourcepub fn push_command(&mut self, cmd: AccessCmdName)
pub fn push_command(&mut self, cmd: AccessCmdName)
Add a supported access command.
sourcepub fn set_auto_complete(&mut self, mode: AutoComplete)
pub fn set_auto_complete(&mut self, mode: AutoComplete)
sourcepub fn set_checked(&mut self, checked: Option<bool>)
pub fn set_checked(&mut self, checked: Option<bool>)
If the widget is checked (Some(true)
), unchecked (Some(false)
), or if the checked status is indeterminate (None
).
sourcepub fn set_current(&mut self, kind: CurrentKind)
pub fn set_current(&mut self, kind: CurrentKind)
Indicates that the widget represents the current item of a kind.
sourcepub fn set_error_message(&mut self, invalid_wgt: impl Into<WidgetId>)
pub fn set_error_message(&mut self, invalid_wgt: impl Into<WidgetId>)
Indicates that the widget is an error message for the invalid_wgt
.
The other widget must set_invalid
.
sourcepub fn set_active_descendant(&mut self, descendant: impl Into<WidgetId>)
pub fn set_active_descendant(&mut self, descendant: impl Into<WidgetId>)
Identifies the currently active widget when focus is on a composite widget.
sourcepub fn set_expanded(&mut self, expanded: bool)
pub fn set_expanded(&mut self, expanded: bool)
Indicate that the widget toggles the visibility of related widgets.
Use push_controls
, or push_owns
to indicate the widgets that change visibility based on
this value.
sourcepub fn set_popup(&mut self, popup: Popup)
pub fn set_popup(&mut self, popup: Popup)
Indicates the availability and type of interactive popup widget.
sourcepub fn set_invalid(&mut self, error: Invalid)
pub fn set_invalid(&mut self, error: Invalid)
Indicates that the widget’s data is invalid with optional kinds of errors.
sourcepub fn set_label(&mut self, name: impl Into<Txt>)
pub fn set_label(&mut self, name: impl Into<Txt>)
Sets a custom name for the widget in accessibility info.
Note that if this is not set the WidgetId::name
of the widget is used.
sourcepub fn set_level(&mut self, hierarchical_level: NonZero<u32>)
pub fn set_level(&mut self, hierarchical_level: NonZero<u32>)
Sets the hierarchical level of the widget within a parent scope.
sourcepub fn flag_multi_selectable(&mut self)
pub fn flag_multi_selectable(&mut self)
Indicates that the user may select more than one item from the current selectable descendants.
sourcepub fn set_orientation(&mut self, orientation: Orientation)
pub fn set_orientation(&mut self, orientation: Orientation)
Indicates whether the widget’s orientation is horizontal, vertical, or unknown/ambiguous.
sourcepub fn set_placeholder(&mut self, placeholder: impl Into<Txt>)
pub fn set_placeholder(&mut self, placeholder: impl Into<Txt>)
Short hint (a word or short phrase) intended to help the user with data entry when a form control has no value.
sourcepub fn flag_read_only(&mut self)
pub fn flag_read_only(&mut self)
Indicates that the widget is not editable, but is otherwise operable.
sourcepub fn flag_required(&mut self)
pub fn flag_required(&mut self)
Indicates that user input is required on the widget before a form may be submitted.
sourcepub fn flag_selected(&mut self)
pub fn flag_selected(&mut self)
Indicates that the widget is selected.
sourcepub fn set_sort(&mut self, direction: SortDirection)
pub fn set_sort(&mut self, direction: SortDirection)
Sets the sort direction for the table or grid items.
sourcepub fn set_value_max(&mut self, max: f64)
pub fn set_value_max(&mut self, max: f64)
Set the maximum value (inclusive).
sourcepub fn set_value_min(&mut self, min: f64)
pub fn set_value_min(&mut self, min: f64)
Set the minimum value (inclusive).
sourcepub fn set_value_text(&mut self, value: impl Into<Txt>)
pub fn set_value_text(&mut self, value: impl Into<Txt>)
Set a text that is a readable version of the current value.
sourcepub fn set_live(&mut self, indicator: LiveIndicator, atomic: bool, busy: bool)
pub fn set_live(&mut self, indicator: LiveIndicator, atomic: bool, busy: bool)
Indicate that the widget can change, how the change can be announced, if atomic
the entire widget must be re-read, if busy
the screen reader must wait until the change completes.
sourcepub fn set_col_count(&mut self, count: usize)
pub fn set_col_count(&mut self, count: usize)
sourcepub fn set_col_index(&mut self, index: usize)
pub fn set_col_index(&mut self, index: usize)
Sets the widget’s column index in the parent table or grid.
sourcepub fn set_col_span(&mut self, span: usize)
pub fn set_col_span(&mut self, span: usize)
Sets the number of columns spanned by the widget in the parent table or grid.
sourcepub fn set_row_count(&mut self, count: usize)
pub fn set_row_count(&mut self, count: usize)
sourcepub fn set_row_index(&mut self, index: usize)
pub fn set_row_index(&mut self, index: usize)
Sets the widget’s row index in the parent table or grid.
sourcepub fn set_row_span(&mut self, span: usize)
pub fn set_row_span(&mut self, span: usize)
Sets the number of rows spanned by the widget in the parent table or grid.
sourcepub fn set_item_count(&mut self, count: usize)
pub fn set_item_count(&mut self, count: usize)
Sets the number of items in the current set of list items or tree items when not all items in the set are present in the tree.
sourcepub fn set_item_index(&mut self, index: usize)
pub fn set_item_index(&mut self, index: usize)
Sets the widget’s number or position in the current set of list items or tree items when not all items are present in the tree.
sourcepub fn flag_modal(&mut self)
pub fn flag_modal(&mut self)
Sets if the widget is modal when displayed.
sourcepub fn set_lang(&mut self, lang: LanguageIdentifier)
pub fn set_lang(&mut self, lang: LanguageIdentifier)
Defines the language used by screen-readers to read text in this widget and descendants.
sourcepub fn set_scroll_horizontal(&mut self, normal_x: impl IntoVar<Factor>)
pub fn set_scroll_horizontal(&mut self, normal_x: impl IntoVar<Factor>)
Sets the amount scrolled horizontally if allowed.
The normal_x
value can be a read-only variable, the variable can be updated without needing to rebuild
info for every pixel scrolled, if the view-process requires access info the value is updated every render
together with the widget bounds updates.
The value must be normalized in the 0..=1 range, 0 is showing the content leftmost edge, 1 is showing the content the rightmost edge.
sourcepub fn set_scroll_vertical(&mut self, normal_y: impl IntoVar<Factor>)
pub fn set_scroll_vertical(&mut self, normal_y: impl IntoVar<Factor>)
Sets the amount scrolled vertically if allowed.
The normal_y
value can be a read-only variable, the variable can be updated without needing to rebuild
info for every pixel scrolled, if the view-process requires access info the value is updated every render
together with the widget bounds updates.
The value must be normalized in the 0..=1 range, 0 is showing the content topmost edge, 1 is showing the content the bottommost edge.
sourcepub fn push_controls(&mut self, controlled_id: impl Into<WidgetId>)
pub fn push_controls(&mut self, controlled_id: impl Into<WidgetId>)
Push a widget whose contents or presence are controlled by this widget.
sourcepub fn push_described_by(&mut self, descriptor_id: impl Into<WidgetId>)
pub fn push_described_by(&mut self, descriptor_id: impl Into<WidgetId>)
Push a widget that describes this widget.
sourcepub fn set_describes(&mut self, target_id: impl Into<WidgetId>)
pub fn set_describes(&mut self, target_id: impl Into<WidgetId>)
Set a widget that is described-by this widget.
When access info for the view-process is build this is converted to a described-by entry. Note
that only updated widgets are send to the view-process, so if this relation is dynamic you must
request info rebuild for the previous and new target_id
to ensure they update correctly.
sourcepub fn push_details(&mut self, detail_id: impl Into<WidgetId>)
pub fn push_details(&mut self, detail_id: impl Into<WidgetId>)
Push a widget that provide additional information related to this widget.
sourcepub fn push_labelled_by(&mut self, label_id: impl Into<WidgetId>)
pub fn push_labelled_by(&mut self, label_id: impl Into<WidgetId>)
Push a widget that provide additional information related to this widget.
sourcepub fn set_labels(&mut self, target_id: impl Into<WidgetId>)
pub fn set_labels(&mut self, target_id: impl Into<WidgetId>)
Set a widget that is labelled-by this widget.
When access info for the view-process is build this is converted to a labelled-by entry. Note
that only updated widgets are send to the view-process, so if this relation is dynamic you must
request info rebuild for the previous and new target_id
to ensure they update correctly.
sourcepub fn push_owns(&mut self, owned_id: impl Into<WidgetId>)
pub fn push_owns(&mut self, owned_id: impl Into<WidgetId>)
Push a widget that is a child of this widget, but is not already a child in the info tree.
sourcepub fn push_flows_to(&mut self, next_id: impl Into<WidgetId>)
pub fn push_flows_to(&mut self, next_id: impl Into<WidgetId>)
Push an option for next widget read that is not the next logical widget already.
sourcepub fn flag_labelled_by_child(&mut self)
pub fn flag_labelled_by_child(&mut self)
Uses the accessible children as labelled_by
.
sourcepub fn flag_inaccessible(&mut self)
pub fn flag_inaccessible(&mut self)
Exclude the widget and descendants from the view-process and screen readers.
Note that the accessibility info for the widget and descendants is still collected and available in the app-process.
sourcepub fn on_access_build(
&mut self,
handler: impl Fn(AccessBuildArgs<'_>) + Send + Sync + 'static,
)
pub fn on_access_build( &mut self, handler: impl Fn(AccessBuildArgs<'_>) + Send + Sync + 'static, )
Register a handler
that is called every time view-process access info is build from the current widget,
the handler can modify the view info.
Auto Trait Implementations§
impl<'a> Freeze for WidgetAccessInfoBuilder<'a>
impl<'a> !RefUnwindSafe for WidgetAccessInfoBuilder<'a>
impl<'a> Send for WidgetAccessInfoBuilder<'a>
impl<'a> Sync for WidgetAccessInfoBuilder<'a>
impl<'a> Unpin for WidgetAccessInfoBuilder<'a>
impl<'a> !UnwindSafe for WidgetAccessInfoBuilder<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more