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
,InlineViewSwitcher
,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
,ToggleGroup
,ToolbarView
,TreeExpander
,TreeView
,Video
,View
,Viewport
,ViewStack
,ViewStackPage
,ViewSwitcher
,ViewSwitcherBar
,ViewSwitcherTitle
,VolumeButton
,WebView
,WebViewBase
,Widget
,Widget.WidgetImpl
,Window
,Window
,WindowControls
,WindowHandle
,WindowTitle
,WrapBox
Every accessible implementation has:
- a “role”, represented by a value of the
Gtk.AccessibleRole
enumeration - “attributes”, 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
Nested ClassesModifier 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 implementation for the given accessible object.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
Queries a platform state, such as focus.static Type
getType()
Get the GType of the Accessible classdefault void
resetProperty
(AccessibleProperty property) Resets the accessible property to its default value.default void
resetRelation
(AccessibleRelation relation) Resets the accessible relation to its default value.default void
resetState
(AccessibleState state) Resets the accessible state 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.default void
Informs ATs that the platform state has changed.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- Since:
- 4.14
-
getAccessibleParent
Retrieves the accessible parent for an accessible object.This function returns
NULL
for top level widgets.- Returns:
- the accessible parent
- Since:
- 4.10
-
getAccessibleRole
Retrieves the accessible role of an accessible object.- Returns:
- the accessible role
-
getAtContext
Retrieves the implementation for the given accessible object.- Returns:
- the accessible implementation object
- Since:
- 4.10
-
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
- Since:
- 4.10
-
getFirstAccessibleChild
Retrieves the first accessible child of an accessible object.- Returns:
- the first accessible child
- Since:
- 4.10
-
getNextAccessibleSibling
Retrieves the next accessible sibling of an accessible object- Returns:
- the next accessible sibling
- Since:
- 4.10
-
getPlatformState
Queries a platform state, such as focus.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
- Since:
- 4.10
-
resetProperty
Resets the accessible property to its default value.- Parameters:
property
- the accessible property
-
resetRelation
Resets the accessible relation to its default value.- Parameters:
relation
- the accessible relation
-
resetState
Resets the accessible state to its default value.- Parameters:
state
- the accessible state
-
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- Since:
- 4.10
-
updateNextAccessibleSibling
Updates the next accessible sibling.That might be useful when a new child of a custom accessible is created, and it needs to be linked to a previous child.
- Parameters:
newSibling
- the new next accessible sibling to set- Since:
- 4.10
-
updatePlatformState
Informs ATs that the platform state has changed.This function should be used by
GtkAccessible
implementations that have a platform state but are not widgets. Widgets handle platform states automatically.- Parameters:
state
- the platform state to update- Since:
- 4.18
-
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 of accessible propertiesvalues
- 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 of accessible relationsvalues
- 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 of accessible statesvalues
- an array ofGValues
, one for each state
-