Skip to main content

SemanticsConfiguration

Struct SemanticsConfiguration 

Source
pub struct SemanticsConfiguration {
Show 26 fields pub content_description: Option<String>, pub state_description: Option<String>, pub on_click_label: Option<String>, pub role: Option<SemanticsWidgetRole>, pub selected: Option<bool>, pub toggled: Option<bool>, pub enabled: bool, pub is_clickable: bool, pub is_editable_text: bool, pub text: Option<String>, pub text_selection: Option<TextRange>, pub custom_actions: Vec<SemanticsCustomAction>, pub canvas_children: Vec<CanvasSemanticsNode>, pub is_modal: bool, pub hidden: bool, pub merge_descendants: bool, pub selectable_group: bool, pub pane_title: Option<String>, 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

Semantics configuration for accessibility.

Fields§

§content_description: Option<String>§state_description: Option<String>

Compose’s stateDescription.

§on_click_label: Option<String>

Compose’s onClick(label = …); implies clickable.

§role: Option<SemanticsWidgetRole>

Compose’s Role.

§selected: Option<bool>§toggled: Option<bool>§enabled: bool§is_clickable: bool§is_editable_text: bool§text: Option<String>

The text an editable field holds, read as its value. Compose’s editableText.

§text_selection: Option<TextRange>§custom_actions: Vec<SemanticsCustomAction>§canvas_children: Vec<CanvasSemanticsNode>

Controls this node drew itself instead of laying out. See CanvasSemanticsNode.

§is_modal: bool

Whether this node takes over the screen: everything outside it is inert, and a screen reader keeps its traversal inside.

§hidden: bool

Whether a screen reader skips this node and everything under it: a decorative image, or a placeholder drawn under a named field. Compose’s hideFromAccessibility.

§merge_descendants: bool

Whether a screen reader takes this node and the text under it as one stop, the way it does for a button: a row whose name, count and price belong together. Compose’s mergeDescendants.

§selectable_group: bool

Whether the selectable controls under this node form one group, so a screen reader says which of how many a tab or a radio button is. Compose’s selectableGroup.

§pane_title: Option<String>

The title of the screen or pane this node is the root of, read out when the app moves to it. Compose’s paneTitle.

§live_region: Option<LiveRegionMode>

Compose’s liveRegion. When set, a screen reader reads this node again whenever its text changes, without the user moving to it.

§progress: Option<ProgressBarRangeInfo>

Compose’s progressBarRangeInfo. A control with it is adjustable: a screen reader offers its own way to move the value.

§set_progress: Option<SemanticsSetProgress>

What the control does when a screen reader moves its value. Compose’s setProgress.

§set_text: Option<SemanticsSetText>

What this field does when a screen reader or a voice tool hands it text. Compose’s setText.

§vertical_scroll: Option<ScrollAxisRange>

How far this container scrolled up and down. Compose’s verticalScrollAxisRange.

§horizontal_scroll: Option<ScrollAxisRange>

How far this container scrolled left and right. Compose’s horizontalScrollAxisRange.

§scroll_by: Option<SemanticsScrollBy>

What this container does when a screen reader pages it. Compose’s scrollBy.

§collection: Option<CollectionInfo>

How many rows and columns this list holds. Compose’s collectionInfo.

Implementations§

Source§

impl SemanticsConfiguration

Source

pub fn merge(&mut self, other: &SemanticsConfiguration)

Source

pub fn is_activatable(&self) -> bool

Whether a screen reader should offer activation. A named click label is how Compose declares onClick, so it implies the action the same way.

Trait Implementations§

Source§

impl Clone for SemanticsConfiguration

Source§

fn clone(&self) -> SemanticsConfiguration

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SemanticsConfiguration

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for SemanticsConfiguration

Source§

fn default() -> SemanticsConfiguration

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

impl PartialEq for SemanticsConfiguration

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SemanticsConfiguration

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.