Interface Accessible
- All Superinterfaces:
Proxy
- All Known Subinterfaces:
AccessibleRange
,AccessibleText
- All Known Implementing Classes:
AboutDialog
,AboutDialog
,AboutWindow
,Accessible.AccessibleImpl
,AccessibleRange.AccessibleRangeImpl
,AccessibleText.AccessibleTextImpl
,Actionable.ActionableImpl
,ActionBar
,ActionRow
,AlertDialog
,AppChooser.AppChooserImpl
,AppChooserButton
,AppChooserDialog
,AppChooserWidget
,ApplicationWindow
,ApplicationWindow
,AspectFrame
,Assistant
,Avatar
,Banner
,Bin
,BottomSheet
,Box
,BreakpointBin
,Button
,ButtonContent
,ButtonRow
,Calendar
,Carousel
,CarouselIndicatorDots
,CarouselIndicatorLines
,CellEditable.CellEditableImpl
,CellView
,CenterBox
,CheckButton
,Clamp
,ClampScrollable
,ColorButton
,ColorChooserDialog
,ColorChooserWidget
,ColorDialogButton
,ColumnView
,ComboBox
,ComboBoxText
,ComboRow
,CompletionCell
,Dialog
,Dialog
,DragIcon
,DrawingArea
,DropDown
,Editable.EditableImpl
,EditableLabel
,EmojiChooser
,Entry
,EntryRow
,Expander
,ExpanderRow
,FileChooserDialog
,FileChooserWidget
,Fixed
,Flap
,FlowBox
,FlowBoxChild
,FontButton
,FontChooserDialog
,FontChooserWidget
,FontDialogButton
,Frame
,GLArea
,GraphicsOffload
,Grid
,GridView
,Gutter
,GutterRenderer
,GutterRenderer.GutterRendererImpl
,GutterRendererPixbuf
,GutterRendererText
,HeaderBar
,HeaderBar
,HoverDisplay
,IconView
,Image
,InfoBar
,Inscription
,Label
,LayoutSlot
,Leaflet
,LevelBar
,LinkButton
,ListBase
,ListBase.ListBaseImpl
,ListBox
,ListBoxRow
,ListView
,LockButton
,Map
,MediaControls
,MenuButton
,MessageDialog
,MessageDialog
,MultiLayoutView
,Native.NativeImpl
,NavigationPage
,NavigationSplitView
,NavigationView
,Notebook
,Overlay
,OverlaySplitView
,PageSetupUnixDialog
,Paned
,PasswordEntry
,PasswordEntryRow
,Picture
,Popover
,PopoverMenu
,PopoverMenuBar
,PreferencesDialog
,PreferencesGroup
,PreferencesPage
,PreferencesRow
,PreferencesWindow
,PrintUnixDialog
,ProgressBar
,Range
,Revealer
,Root.RootImpl
,Scale
,ScaleButton
,Scrollbar
,ScrolledWindow
,SearchBar
,SearchEntry
,Separator
,ShortcutLabel
,ShortcutsGroup
,ShortcutsSection
,ShortcutsShortcut
,ShortcutsWindow
,SpinButton
,Spinner
,Spinner
,SpinRow
,SplitButton
,Squeezer
,Stack
,StackPage
,StackSidebar
,StackSwitcher
,Statusbar
,StatusPage
,StyleSchemeChooserButton
,StyleSchemeChooserWidget
,StyleSchemePreview
,Swipeable.SwipeableImpl
,Switch
,SwitchRow
,TabBar
,TabButton
,TabOverview
,TabPage
,TabView
,Text
,TextView
,ToastOverlay
,ToggleButton
,ToolbarView
,TreeExpander
,TreeView
,Video
,View
,Viewport
,ViewStack
,ViewStackPage
,ViewSwitcher
,ViewSwitcherBar
,ViewSwitcherTitle
,VolumeButton
,WebView
,WebViewBase
,Widget
,Widget.WidgetImpl
,Window
,Window
,WindowControls
,WindowHandle
,WindowTitle
GtkAccessible
is an interface for describing UI elements for
Assistive Technologies.
Every accessible implementation has:
- a “role”, represented by a value of the
Gtk.AccessibleRole
enumeration - an “attribute”, represented by a set of
Gtk.AccessibleState
,Gtk.AccessibleProperty
andGtk.AccessibleRelation
values
The role cannot be changed after instantiating a GtkAccessible
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 GtkWidget
visibility changes, the AccessibleState.HIDDEN
state will also change to reflect the Gtk.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 getAccessibleParent()
,
getFirstAccessibleChild()
and
getNextAccessibleSibling()
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 setAccessibleParent(org.gnome.gtk.Accessible, org.gnome.gtk.Accessible)
and
updating the sibling by updateNextAccessibleSibling(org.gnome.gtk.Accessible)
.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
The AccessibleImpl type represents a native instance of the Accessible interface.static class
The common interface for accessible objects.static interface
Accessible.Builder<B extends Builder<B>>
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
announce
(String message, AccessibleAnnouncementPriority priority) Requests the user's screen reader to announce the given message.default Accessible
Retrieves the accessible parent for an accessible object.default AccessibleRole
Retrieves the accessible role of an accessible object.default ATContext
Retrieves the accessible implementation for the givenGtkAccessible
.default boolean
Queries the coordinates and dimensions of this accessibledefault Accessible
Retrieves the first accessible child of an accessible object.default Accessible
Retrieves the next accessible sibling of an accessible objectdefault boolean
Query a platform state, such as focus.static Type
getType()
Get the GType of the Accessible classdefault void
resetProperty
(AccessibleProperty property) Resets the accessibleproperty
to its default value.default void
resetRelation
(AccessibleRelation relation) Resets the accessiblerelation
to its default value.default void
resetState
(AccessibleState state) Resets the accessiblestate
to its default value.default void
setAccessibleParent
(@Nullable Accessible parent, @Nullable Accessible nextSibling) Sets the parent and sibling of an accessible object.default void
updateNextAccessibleSibling
(@Nullable Accessible newSibling) Updates the next accessible sibling of this Accessible.default void
updateProperty
(AccessibleProperty[] properties, Value[] values) Updates an array of accessible properties.default void
updateRelation
(AccessibleRelation[] relations, Value[] values) Updates an array of accessible relations.default void
updateState
(AccessibleState[] states, Value[] values) Updates an array of accessible states.
-
Method Details
-
getType
-
announce
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 announcepriority
- the priority of the announcement
-
getAccessibleParent
Retrieves the accessible parent for an accessible object.This function returns
NULL
for top level widgets.- Returns:
- the accessible parent
-
getAccessibleRole
Retrieves the accessible role of an accessible object.- Returns:
- the accessible role
-
getAtContext
Retrieves the accessible implementation for the givenGtkAccessible
.- Returns:
- the accessible implementation object
-
getBounds
Queries the coordinates and dimensions of this accessibleThis functionality can be overridden by
GtkAccessible
implementations, e.g. to get the bounds from an ignored child widget.- Parameters:
x
- the x coordinate of the top left corner of the accessibley
- the y coordinate of the top left corner of the widgetwidth
- the width of the accessible objectheight
- the height of the accessible object- Returns:
- true if the bounds are valid, and false otherwise
-
getFirstAccessibleChild
Retrieves the first accessible child of an accessible object.- Returns:
- the first accessible child
-
getNextAccessibleSibling
Retrieves the next accessible sibling of an accessible object- Returns:
- the next accessible sibling
-
getPlatformState
Query a platform state, such as focus.See gtk_accessible_platform_changed().
This functionality can be overridden by
GtkAccessible
implementations, e.g. to get platform state from an ignored child widget, as is the case forGtkText
wrappers.- Parameters:
state
- platform state to query- Returns:
- the value of
state
for the accessible
-
resetProperty
Resets the accessibleproperty
to its default value.- Parameters:
property
- aGtkAccessibleProperty
-
resetRelation
Resets the accessiblerelation
to its default value.- Parameters:
relation
- aGtkAccessibleRelation
-
resetState
Resets the accessiblestate
to its default value.- Parameters:
state
- aGtkAccessibleState
-
setAccessibleParent
default void setAccessibleParent(@Nullable @Nullable Accessible parent, @Nullable @Nullable Accessible nextSibling) 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
GtkAccessible
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 objectnextSibling
- the sibling accessible object
-
updateNextAccessibleSibling
Updates the next accessible sibling of this Accessible.That might be useful when a new child of a custom
GtkAccessible
is created, and it needs to be linked to a previous child.- Parameters:
newSibling
- the new next accessible sibling to set
-
updateProperty
Updates an array of accessible properties.This function should be called by
GtkWidget
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 ofGtkAccessibleProperty
values
- an array ofGValues
, one for each property
-
updateRelation
Updates an array of accessible relations.This function should be called by
GtkWidget
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 ofGtkAccessibleRelation
values
- an array ofGValues
, one for each relation
-
updateState
Updates an array of accessible states.This function should be called by
GtkWidget
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 ofGtkAccessibleState
values
- an array ofGValues
, one for each state
-