Struct zng_app::widget::info::access::WidgetAccessInfoBuilder

source ·
pub struct WidgetAccessInfoBuilder<'a> { /* private fields */ }
Expand description

Accessibility metadata.

Implementations§

source§

impl<'a> WidgetAccessInfoBuilder<'a>

source

pub fn set_role(&mut self, role: AccessRole)

Set the accessibility role of the widget.

source

pub fn push_command(&mut self, cmd: AccessCmdName)

Add a supported access command.

source

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

Set how input text triggers display of one or more predictions of the user’s intended value for a ComboBox, SearchBox, or TextInput.

source

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

source

pub fn set_current(&mut self, kind: CurrentKind)

Indicates that the widget represents the current item of a kind.

source

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.

source

pub fn set_active_descendant(&mut self, descendant: impl Into<WidgetId>)

Identifies the currently active widget when focus is on a composite widget.

source

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.

source

pub fn set_popup(&mut self, popup: Popup)

Indicates the availability and type of interactive popup widget.

source

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

Indicates that the widget’s data is invalid with optional kinds of errors.

source

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.

source

pub fn set_level(&mut self, hierarchical_level: NonZeroU32)

Sets the hierarchical level of the widget within a parent scope.

source

pub fn flag_multi_selectable(&mut self)

Indicates that the user may select more than one item from the current selectable descendants.

source

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

Indicates whether the widget’s orientation is horizontal, vertical, or unknown/ambiguous.

source

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.

source

pub fn flag_read_only(&mut self)

Indicates that the widget is not editable, but is otherwise operable.

source

pub fn flag_required(&mut self)

Indicates that user input is required on the widget before a form may be submitted.

source

pub fn flag_selected(&mut self)

Indicates that the widget is selected.

source

pub fn set_sort(&mut self, direction: SortDirection)

Sets the sort direction for the table or grid items.

source

pub fn set_value_max(&mut self, max: f64)

Set the maximum value (inclusive).

source

pub fn set_value_min(&mut self, min: f64)

Set the minimum value (inclusive).

source

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

Set the current value.

source

pub fn set_value_text(&mut self, value: impl Into<Txt>)

Set a text that is a readable version of the current value.

source

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.

source

pub fn set_col_count(&mut self, count: usize)

Sets the total number of columns in a Table, Grid, or TreeGrid when not all columns are present in tree.

The value 0 indicates that not all columns are in the widget and the application cannot determinate the exact number.

source

pub fn set_col_index(&mut self, index: usize)

Sets the widget’s column index in the parent table or grid.

source

pub fn set_col_span(&mut self, span: usize)

Sets the number of columns spanned by the widget in the parent table or grid.

source

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

Sets the total number of rows in a Table, Grid, or TreeGrid when not all rows are present in tree.

The value 0 indicates that not all rows are in the widget and the application cannot determinate the exact number.

source

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

Sets the widget’s row index in the parent table or grid.

source

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

Sets the number of rows spanned by the widget in the parent table or grid.

source

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.

source

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.

source

pub fn flag_modal(&mut self)

Sets if the widget is modal when displayed.

source

pub fn set_lang(&mut self, lang: LanguageIdentifier)

Defines the language used by screen-readers to read text in this widget and descendants.

source

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.

source

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.

source

pub fn push_controls(&mut self, controlled_id: impl Into<WidgetId>)

Push a widget whose contents or presence are controlled by this widget.

source

pub fn push_described_by(&mut self, descriptor_id: impl Into<WidgetId>)

Push a widget that describes this widget.

source

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.

source

pub fn push_details(&mut self, detail_id: impl Into<WidgetId>)

Push a widget that provide additional information related to this widget.

source

pub fn push_labelled_by(&mut self, label_id: impl Into<WidgetId>)

Push a widget that provide additional information related to this widget.

source

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.

source

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.

source

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.

source

pub fn flag_labelled_by_child(&mut self)

Uses the accessible children as labelled_by.

source

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.

source

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§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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<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<T, U> TryFrom<U> for T
where U: Into<T>,

source§

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

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

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

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