The accessible role cannot be changed once set.
gtk.accessible_mixin
Module for [Accessible] interface mixin
Templates 2
[gtk.accessible.Accessible] is an interface for describing UI elements for Assistive Technologies.
Every accessible implementation has:
- a “role”, represented by a value of the [gtk.types.AccessibleRole] enumeration
- an “attribute”, represented by a set of [gtk.types.AccessibleState],
[gtk.types.AccessibleProperty] and [gtk.types.AccessibleRelation] values
The role cannot be changed after instantiating a [gtk.accessible.Accessible] implementation.
The attributes are updated every time a UI element's state changes in a way that should be reflected by assistive technologies. For instance, if a [gtk.widget.Widget] visibility changes, the [gtk.types.AccessibleState.Hidden] state will also change to reflect the [gtk.widget.Widget.visible] property.
Every accessible implementation is part of a tree of accessible objects. Normally, this tree corresponds to the widget tree, but can be customized by reimplementing the vfunc@Gtk.Accessible.get_accessible_parent, vfunc@Gtk.Accessible.get_first_accessible_child and vfunc@Gtk.Accessible.get_next_accessible_sibling virtual functions. Note that you can not create a top-level accessible object as of now, which means that you must always have a parent accessible object. Also note that when an accessible object does not correspond to a widget, and it has children, whose implementation you don't control, it is necessary to ensure the correct shape of the a11y tree by calling [gtk.accessible.Accessible.setAccessibleParent] and updating the sibling by [gtk.accessible.Accessible.updateNextAccessibleSibling].
Get accessibleRole property.
Returns
Set accessibleRole property.
Parameters
propval | The accessible role of the given [gtk.accessible.Accessible] implementation. The accessible role cannot be changed once set. |
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.
Parameters
message | the string to announce |
priority | the priority of the announcement |
Retrieves the accessible parent for an accessible object.
This function returns NULL for top level widgets.
Returns
Retrieves the accessible role of an accessible object.
Returns
Retrieves the accessible implementation for the given [gtk.accessible.Accessible].
Returns
Queries the coordinates and dimensions of this accessible
This functionality can be overridden by [gtk.accessible.Accessible] implementations, e.g. to get the bounds from an ignored child widget.
Parameters
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 |
Returns
Retrieves the first accessible child of an accessible object.
Returns
Retrieves the next accessible sibling of an accessible object
Returns
Query a platform state, such as focus.
See gtk_accessible_platform_changed().
This functionality can be overridden by [gtk.accessible.Accessible] implementations, e.g. to get platform state from an ignored child widget, as is the case for [gtk.text.Text] wrappers.
Parameters
state | platform state to query |
Returns
Resets the accessible property to its default value.
Parameters
property | a [gtk.types.AccessibleProperty] |
Resets the accessible relation to its default value.
Parameters
relation | a [gtk.types.AccessibleRelation] |
Resets the accessible state to its default value.
Parameters
state | a [gtk.types.AccessibleState] |
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 [gtk.accessible.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.
Parameters
parent | the parent accessible object |
nextSibling | the sibling accessible object |
Updates the next accessible sibling of self.
That might be useful when a new child of a custom [gtk.accessible.Accessible] is created, and it needs to be linked to a previous child.
Parameters
newSibling | the new next accessible sibling to set |
Updates an array of accessible properties.
This function should be called by [gtk.widget.Widget] types whenever an accessible property change must be communicated to assistive technologies.
This function is meant to be used by language bindings.
Parameters
properties | an array of [gtk.types.AccessibleProperty] |
values | an array of GValues, one for each property |
Updates an array of accessible relations.
This function should be called by [gtk.widget.Widget] types whenever an accessible relation change must be communicated to assistive technologies.
This function is meant to be used by language bindings.
Parameters
relations | an array of [gtk.types.AccessibleRelation] |
values | an array of GValues, one for each relation |
Updates an array of accessible states.
This function should be called by [gtk.widget.Widget] types whenever an accessible state change must be communicated to assistive technologies.
This function is meant to be used by language bindings.
Parameters
states | an array of [gtk.types.AccessibleState] |
values | an array of GValues, one for each state |
Set accessibleRole property.
Parameters
propval | The accessible role of the given [gtk.accessible.Accessible] implementation. The accessible role cannot be changed once set. |