Interface Accessible

All Superinterfaces:
Proxy
All Known Subinterfaces:
AccessibleHypertext, AccessibleRange, AccessibleText
All Known Implementing Classes:
AboutDialog, AboutDialog, AboutWindow, Accessible.Accessible$Impl, AccessibleHyperlink, AccessibleHypertext.AccessibleHypertext$Impl, AccessibleRange.AccessibleRange$Impl, AccessibleText.AccessibleText$Impl, Actionable.Actionable$Impl, ActionBar, ActionRow, AlertDialog, AppChooser.AppChooser$Impl, AppChooserButton, AppChooserDialog, AppChooserWidget, ApplicationWindow, ApplicationWindow, AspectFrame, Assistant, Avatar, Banner, Bin, BottomSheet, Box, BreakpointBin, Button, ButtonContent, ButtonRow, Calendar, Carousel, CarouselIndicatorDots, CarouselIndicatorLines, CellEditable.CellEditable$Impl, CellView, CenterBox, CheckButton, Clamp, ClampScrollable, ColorButton, ColorChooserDialog, ColorChooserWidget, ColorDialogButton, ColumnView, ComboBox, ComboBoxText, ComboRow, CompletionCell, Dialog, Dialog, DragIcon, DrawingArea, DropDown, Editable.Editable$Impl, EditableLabel, EmojiChooser, Entry, EntryRow, Expander, ExpanderRow, FileChooserDialog, FileChooserWidget, Fixed, Flap, FlowBox, FlowBoxChild, FontButton, FontChooserDialog, FontChooserWidget, FontDialogButton, Frame, GLArea, GraphicsOffload, Grid, GridView, Gutter, GutterRenderer, GutterRenderer.GutterRenderer$Impl, GutterRendererPixbuf, GutterRendererText, HeaderBar, HeaderBar, HoverDisplay, IconView, Image, InfoBar, InlineViewSwitcher, Inscription, Label, LayoutSlot, Leaflet, LevelBar, LinkButton, ListBase, ListBase.ListBase$Impl, ListBox, ListBoxRow, ListView, LockButton, Map, MediaControls, MenuButton, MessageDialog, MessageDialog, MultiLayoutView, Native.Native$Impl, NavigationPage, NavigationSplitView, NavigationView, Notebook, Overlay, OverlaySplitView, PageSetupUnixDialog, Paned, PasswordEntry, PasswordEntryRow, Picture, Popover, PopoverBin, PopoverMenu, PopoverMenuBar, PreferencesDialog, PreferencesGroup, PreferencesPage, PreferencesRow, PreferencesWindow, PrintUnixDialog, ProgressBar, Range, Revealer, Root.Root$Impl, Scale, ScaleButton, Scrollbar, ScrolledWindow, SearchBar, SearchEntry, Separator, ShortcutLabel, ShortcutLabel, ShortcutsDialog, ShortcutsGroup, ShortcutsSection, ShortcutsShortcut, ShortcutsWindow, Sidebar, SpinButton, Spinner, Spinner, SpinRow, SplitButton, Squeezer, Stack, StackPage, StackSidebar, StackSwitcher, Statusbar, StatusPage, StyleSchemeChooserButton, StyleSchemeChooserWidget, StyleSchemePreview, Swipeable.Swipeable$Impl, Switch, SwitchRow, TabBar, TabButton, TabOverview, TabPage, TabView, Text, TextView, ToastOverlay, ToggleButton, ToggleGroup, ToolbarView, TreeExpander, TreeView, Video, View, Viewport, ViewStack, ViewStackPage, ViewSwitcher, ViewSwitcherBar, ViewSwitcherSidebar, ViewSwitcherTitle, VolumeButton, WebView, WebViewBase, Widget, Widget.Widget$Impl, Window, Window, WindowControls, WindowHandle, WindowTitle, WrapBox

@Generated("org.javagi.JavaGI") public interface Accessible extends Proxy

An interface for describing UI elements for Assistive Technologies.

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 and Gtk.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(Accessible, Accessible) and updating the sibling by updateNextAccessibleSibling(Accessible).

  • Method Details

    • getType

      static @Nullable Type getType()
      Get the GType of the Accessible class.
      Returns:
      the GType
    • announce

      default void announce(String message, AccessibleAnnouncementPriority priority)

      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
      Since:
      4.14
    • getAccessibleId

      default @Nullable String getAccessibleId()

      Retrieves the accessible identifier for the accessible object.

      This functionality can be overridden by GtkAccessible implementations.

      It is left to the accessible implementation to define the scope and uniqueness of the identifier.

      Returns:
      the accessible identifier
      Since:
      4.22
    • getAccessibleParent

      default @Nullable Accessible 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

      default AccessibleRole getAccessibleRole()
      Retrieves the accessible role of an accessible object.
      Returns:
      the accessible role
    • getAtContext

      default ATContext getAtContext()
      Retrieves the implementation for the given accessible object.
      Returns:
      the accessible implementation object
      Since:
      4.10
    • getBounds

      default boolean getBounds(Out<Integer> x, Out<Integer> y, Out<Integer> width, Out<Integer> height)

      Queries the coordinates and dimensions of this accessible

      This 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 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:
      true if the bounds are valid, and false otherwise
      Since:
      4.10
    • getFirstAccessibleChild

      default @Nullable Accessible getFirstAccessibleChild()
      Retrieves the first accessible child of an accessible object.
      Returns:
      the first accessible child
      Since:
      4.10
    • getNextAccessibleSibling

      default @Nullable Accessible getNextAccessibleSibling()
      Retrieves the next accessible sibling of an accessible object
      Returns:
      the next accessible sibling
      Since:
      4.10
    • getPlatformState

      default boolean getPlatformState(AccessiblePlatformState state)

      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 for GtkText wrappers.

      Parameters:
      state - platform state to query
      Returns:
      the value of state for the accessible
      Since:
      4.10
    • resetProperty

      default void resetProperty(AccessibleProperty property)
      Resets the accessible property to its default value.
      Parameters:
      property - the accessible property
    • resetRelation

      default void resetRelation(AccessibleRelation relation)
      Resets the accessible relation to its default value.
      Parameters:
      relation - the accessible relation
    • resetState

      default void resetState(AccessibleState state)
      Resets the accessible state to its default value.
      Parameters:
      state - the accessible state
    • setAccessibleParent

      default void setAccessibleParent(@Nullable Accessible parent, @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 object
      nextSibling - the sibling accessible object
      Since:
      4.10
    • updateNextAccessibleSibling

      default void updateNextAccessibleSibling(@Nullable Accessible newSibling)

      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

      default void updatePlatformState(AccessiblePlatformState state)

      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

      default void updateProperty(@Nullable AccessibleProperty @Nullable [] properties, @Nullable Value @Nullable [] values)

      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 properties
      values - an array of GValues, one for each property
    • updateRelation

      default void updateRelation(@Nullable AccessibleRelation @Nullable [] relations, @Nullable Value @Nullable [] values)

      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 relations
      values - an array of GValues, one for each relation
    • updateState

      default void updateState(@Nullable AccessibleState @Nullable [] states, @Nullable Value @Nullable [] values)

      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 states
      values - an array of GValues, one for each state