gtk4::prelude

Trait AccessibleExt

Source
pub trait AccessibleExt: IsA<Accessible> + 'static {
Show 15 methods // Provided methods fn announce(&self, message: &str, priority: AccessibleAnnouncementPriority) { ... } fn accessible_parent(&self) -> Option<Accessible> { ... } fn accessible_role(&self) -> AccessibleRole { ... } fn at_context(&self) -> ATContext { ... } fn bounds(&self) -> Option<(i32, i32, i32, i32)> { ... } fn first_accessible_child(&self) -> Option<Accessible> { ... } fn next_accessible_sibling(&self) -> Option<Accessible> { ... } fn platform_state(&self, state: AccessiblePlatformState) -> bool { ... } fn reset_property(&self, property: AccessibleProperty) { ... } fn reset_relation(&self, relation: AccessibleRelation) { ... } fn reset_state(&self, state: AccessibleState) { ... } fn set_accessible_parent( &self, parent: Option<&impl IsA<Accessible>>, next_sibling: Option<&impl IsA<Accessible>>, ) { ... } fn update_next_accessible_sibling( &self, new_sibling: Option<&impl IsA<Accessible>>, ) { ... } fn set_accessible_role(&self, accessible_role: AccessibleRole) { ... } fn connect_accessible_role_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Provided Methods§

Source

fn announce(&self, message: &str, priority: AccessibleAnnouncementPriority)

Available on crate feature v4_14 only.

Requests the user’s screen reader to announce the given message.

This kind of notification is useful for messages that either have only a visual representation or that are not exposed visually at all, e.g. a notification about a successful operation.

Also, by using this API, you can ensure that the message does not interrupts the user’s current screen reader output.

§message

the string to announce

§priority

the priority of the announcement

Source

fn accessible_parent(&self) -> Option<Accessible>

Available on crate feature v4_10 only.

Retrieves the accessible parent for an accessible object.

This function returns NULL for top level widgets.

§Returns

the accessible parent

Source

fn accessible_role(&self) -> AccessibleRole

Retrieves the accessible role of an accessible object.

§Returns

the accessible role

Source

fn at_context(&self) -> ATContext

Available on crate feature v4_10 only.

Retrieves the accessible implementation for the given Accessible.

§Returns

the accessible implementation object

Source

fn bounds(&self) -> Option<(i32, i32, i32, i32)>

Available on crate feature v4_10 only.

Queries the coordinates and dimensions of this accessible

This functionality can be overridden by Accessible implementations, e.g. to get the bounds from an ignored child widget.

§Returns

true if the bounds are valid, and false otherwise

§x

the x coordinate of the top left corner of the accessible

§y

the y coordinate of the top left corner of the widget

§width

the width of the accessible object

§height

the height of the accessible object

Source

fn first_accessible_child(&self) -> Option<Accessible>

Available on crate feature v4_10 only.

Retrieves the first accessible child of an accessible object.

§Returns

the first accessible child

Source

fn next_accessible_sibling(&self) -> Option<Accessible>

Available on crate feature v4_10 only.

Retrieves the next accessible sibling of an accessible object

§Returns

the next accessible sibling

Source

fn platform_state(&self, state: AccessiblePlatformState) -> bool

Available on crate feature v4_10 only.

Query a platform state, such as focus.

See gtk_accessible_platform_changed().

This functionality can be overridden by Accessible implementations, e.g. to get platform state from an ignored child widget, as is the case for Text wrappers.

§state

platform state to query

§Returns

the value of @state for the accessible

Source

fn reset_property(&self, property: AccessibleProperty)

Resets the accessible @property to its default value.

§property

a AccessibleProperty

Source

fn reset_relation(&self, relation: AccessibleRelation)

Resets the accessible @relation to its default value.

§relation

a AccessibleRelation

Source

fn reset_state(&self, state: AccessibleState)

Resets the accessible @state to its default value.

§state

a AccessibleState

Source

fn set_accessible_parent( &self, parent: Option<&impl IsA<Accessible>>, next_sibling: Option<&impl IsA<Accessible>>, )

Available on crate feature v4_10 only.

Sets the parent and sibling of an accessible object.

This function is meant to be used by accessible implementations that are not part of the widget hierarchy, and but act as a logical bridge between widgets. For instance, if a widget creates an object that holds metadata for each child, and you want that object to implement the Accessible interface, you will use this function to ensure that the parent of each child widget is the metadata object, and the parent of each metadata object is the container widget.

§parent

the parent accessible object

§next_sibling

the sibling accessible object

Source

fn update_next_accessible_sibling( &self, new_sibling: Option<&impl IsA<Accessible>>, )

Available on crate feature v4_10 only.

Updates the next accessible sibling of @self.

That might be useful when a new child of a custom Accessible is created, and it needs to be linked to a previous child.

§new_sibling

the new next accessible sibling to set

Source

fn set_accessible_role(&self, accessible_role: AccessibleRole)

The accessible role of the given Accessible implementation.

The accessible role cannot be changed once set.

Source

fn connect_accessible_role_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§