gtkmm 4.16.0
|
Accessible interface. More...
#include <gtkmm/accessible.h>
Public Member Functions | |
Accessible (Accessible &&src) noexcept | |
Accessible & | operator= (Accessible &&src) noexcept |
~Accessible () noexcept override | |
GtkAccessible * | gobj () |
Provides access to the underlying C GObject. | |
const GtkAccessible * | gobj () const |
Provides access to the underlying C GObject. | |
Glib::RefPtr< ATContext > | get_at_context () |
Retrieves the accessible implementation for the given Gtk::Accessible . | |
Glib::RefPtr< const ATContext > | get_at_context () const |
Retrieves the accessible implementation for the given Gtk::Accessible . | |
bool | get_platform_state (PlatformState state) const |
Query a platform state, such as focus. | |
Glib::RefPtr< Accessible > | get_accessible_parent () |
Retrieves the accessible parent for an accessible object. | |
Glib::RefPtr< const Accessible > | get_accessible_parent () const |
Retrieves the accessible parent for an accessible object. | |
void | set_accessible_parent (const Glib::RefPtr< Accessible > & parent, const Glib::RefPtr< Accessible > &next_sibling) |
Sets the parent and sibling of an accessible object. | |
Glib::RefPtr< Accessible > | get_first_accessible_child () |
Retrieves the first accessible child of an accessible object. | |
Glib::RefPtr< const Accessible > | get_first_accessible_child () const |
Retrieves the first accessible child of an accessible object. | |
Glib::RefPtr< Accessible > | get_next_accessible_sibling () |
Retrieves the next accessible sibling of an accessible object. | |
Glib::RefPtr< const Accessible > | get_next_accessible_sibling () const |
Retrieves the next accessible sibling of an accessible object. | |
void | update_next_accessible_sibling (const Glib::RefPtr< Accessible > &new_sibling) |
Updates the next accessible sibling of self. | |
bool | get_bounds (int &x, int &y, int & width, int &height) const |
Queries the coordinates and dimensions of this accessible. | |
Role | get_accessible_role () const |
Retrieves the accessible role of an accessible object. | |
void | update_state (State state, const Glib::ValueBase & value) |
Updates an accessible state. | |
void | update_property (Property property, const Glib::ValueBase & value) |
Updates an accessible property. | |
void | update_relation (Relation relation, const Glib::ValueBase & value) |
Updates an accessible relation. | |
void | reset_state (State state) |
Resets the accessible state to its default value. | |
void | reset_property (Property property) |
Resets the accessible property to its default value. | |
void | reset_relation (Relation relation) |
Resets the accessible relation to its default value. | |
void | announce (const Glib::ustring & message, AnnouncementPriority priority) |
Requests the user's screen reader to announce the given message. | |
Glib::PropertyProxy< Role > | property_accessible_role () |
The accessible role of the given Gtk::Accessible implementation. | |
Glib::PropertyProxy_ReadOnly< Role > | property_accessible_role () const |
The accessible role of the given Gtk::Accessible implementation. | |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Protected Member Functions | |
Accessible () | |
You should derive from this class to use it. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::Accessible > | wrap (GtkAccessible *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Accessible interface.
Gtk::Accessible provides an interface for describing a UI element, like a Gtk::Widget, in a way that can be consumed by Assistive Technologies, or “AT”. Every accessible implementation has:
The role cannot be changed after instantiating a Gtk::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 visibility changes, the Gtk::Accessible::State::HIDDEN state will also change to reflect Gtk::Widget::property_visible().
|
strong |
Enumerator | |
---|---|
AUTOCOMPLETE | Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for a combobox, searchbox, or textbox and specifies how predictions would be presented if they were made. Value type: Gtk::AccessibleAutocomplete. |
DESCRIPTION | Defines a string value that describes or annotates the current element. Value type: string. |
HAS_POPUP | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. |
KEY_SHORTCUTS | Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. Value type: string. |
LABEL | |
LEVEL | Defines the hierarchical level of an element within a structure. Value type: integer. |
MODAL | Indicates whether an element is modal when displayed. Value type: boolean. |
MULTI_LINE | Indicates whether a text box accepts multiple lines of input or only a single line. Value type: boolean. |
MULTI_SELECTABLE | Indicates that the user may select more than one item from the current selectable descendants. Value type: boolean. |
ORIENTATION | Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. Value type: Gtk::Orientation. |
PLACEHOLDER | Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format. Value type: string. |
READ_ONLY | Indicates that the element is not editable, but is otherwise operable. Value type: boolean. |
REQUIRED | Indicates that user input is required on the element before a form may be submitted. Value type: boolean. |
ROLE_DESCRIPTION | Defines a human-readable, author-localized description for the role of an element. Value type: string. |
SORT | Indicates if items in a table or grid are sorted in ascending or descending order. Value type: Gtk::AccessibleSort. |
VALUE_MAX | Defines the maximum allowed value for a range widget. Value type: double. |
VALUE_MIN | Defines the minimum allowed value for a range widget. Value type: double. |
VALUE_NOW | Defines the current value for a range widget. Value type: double. |
VALUE_TEXT | Defines the human readable text alternative of aria-valuenow for a range widget. Value type: string. |
HELP_TEXT |
|
strong |
Enumerator | |
---|---|
ACTIVE_DESCENDANT | Identifies the currently active element when focus is on a composite widget, combobox, textbox, group, or application. Value type: reference. |
COL_COUNT | Defines the total number of columns in a table, grid, or treegrid. Value type: integer. |
COL_INDEX | Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. Value type: integer. |
COL_INDEX_TEXT | Defines a human readable text alternative of Gtk::Accessible::Relation::COL_INDEX. Value type: string. |
COL_SPAN | Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. Value type: integer. |
CONTROLS | Identifies the element (or elements) whose contents or presence are controlled by the current element. Value type: reference. |
DESCRIBED_BY | Identifies the element (or elements) that describes the object. Value type: reference. |
DETAILS | Identifies the element (or elements) that provide additional information related to the object. Value type: reference. |
ERROR_MESSAGE | Identifies the element (or elements) that provide an error message for an object. Value type: reference. |
FLOW_TO | Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order. Value type: reference. |
LABELLED_BY | Identifies the element (or elements) that labels the current element. Value type: reference. |
OWNS | Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between elements where the widget hierarchy cannot be used to represent the relationship. Value type: reference. |
POS_IN_SET | Defines an element's number or position in the current set of listitems or treeitems. Value type: integer. |
ROW_COUNT | Defines the total number of rows in a table, grid, or treegrid. Value type: integer. |
ROW_INDEX | Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. Value type: integer. |
ROW_INDEX_TEXT | Defines a human readable text alternative of aria-rowindex. Value type: string. |
ROW_SPAN | Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. Value type: integer. |
SET_SIZE | Defines the number of items in the current set of listitems or treeitems. Value type: integer. |
|
strong |
Enumerator | |
---|---|
ALERT | An element with important, and usually time-sensitive, information. |
ALERT_DIALOG | A type of dialog that contains an alert message. |
BANNER | Unused. |
BUTTON | An input element that allows for user-triggered actions when clicked or pressed. |
CAPTION | Unused. |
CELL | Unused. |
CHECKBOX | A checkable input element that has three possible values: |
COLUMN_HEADER | A header in a columned list. |
COMBO_BOX | An input that controls another element, such as a list or a grid, that can dynamically pop up to help the user set the value of the input. |
COMMAND | Abstract role. |
COMPOSITE | Abstract role. |
DIALOG | A dialog is a window that is designed to interrupt the current processing of an application in order to prompt the user to enter information or require a response. |
DOCUMENT | Content that assistive technology users may want to browse in a reading mode. |
FEED | Unused. |
FORM | Unused. |
GENERIC | A nameless container that has no semantic meaning of its own. This is the role that GTK uses by default for widgets. |
GRID | A grid of items. |
GRID_CELL | An item in a grid or tree grid. |
GROUP | An element that groups multiple related widgets. GTK uses this role for various containers, like Gtk::HeaderBar or Gtk::Notebook. |
HEADING | Unused. |
IMG | An image. |
INPUT | Abstract role. |
LABEL | A visible name or caption for a user interface component. Defines a string value that labels the current element. Value type: string. |
LANDMARK | Abstract role. |
LEGEND | Unused. |
LINK | A clickable link. |
LIST | A list of items. |
LIST_BOX | Unused. |
LIST_ITEM | An item in a list. |
LOG | Unused. |
MAIN | Unused. |
MARQUEE | Unused. |
MATH | Unused. |
METER | An element that represents a value within a known range. |
MENU | A menu. |
MENU_BAR | A menubar. |
MENU_ITEM | An item in a menu. |
MENU_ITEM_CHECKBOX | A check item in a menu. |
MENU_ITEM_RADIO | A radio item in a menu. |
NAVIGATION | Unused. |
NONE | An element that is not represented to accessibility technologies. This role is synonymous to GTK_ACCESSIBLE_ROLE_PRESENTATION. |
NOTE | Unused. |
OPTION | Unused. |
PRESENTATION | An element that is not represented to accessibility technologies. This role is synonymous to GTK_ACCESSIBLE_ROLE_NONE. |
PROGRESS_BAR | An element that displays the progress status for tasks that take a long time. |
RADIO | A checkable input in a group of radio roles, only one of which can be checked at a time. |
RADIO_GROUP | Unused. |
RANGE | Abstract role. |
REGION | Unused. |
ROW | A row in a columned list. |
ROW_GROUP | Unused. |
ROW_HEADER | Unused. |
SCROLLBAR | A graphical object that controls the scrolling of content within a viewing area, regardless of whether the content is fully displayed within the viewing area. |
SEARCH | Unused. |
SEARCH_BOX | A type of textbox intended for specifying search criteria. |
SECTION | Abstract role. |
SECTION_HEAD | Abstract role. |
SELECT | Abstract role. |
SEPARATOR | A divider that separates and distinguishes sections of content or groups of menuitems. |
SLIDER | A user input where the user selects a value from within a given range. |
SPIN_BUTTON | A form of range that expects the user to select from among discrete choices. |
STATUS | Unused. |
STRUCTURE | Abstract role. |
SWITCH | A type of checkbox that represents on/off values, as opposed to checked/unchecked values. |
TAB | An item in a list of tab used for switching pages. |
TABLE | Unused. |
TAB_LIST | A list of tabs for switching pages. |
TAB_PANEL | A page in a notebook or stack. |
TEXT_BOX | A type of input that allows free-form text as its value. |
TIME | Unused. |
TIMER | Unused. |
TOOLBAR | Unused. |
TOOLTIP | Unused. |
TREE | Unused. |
TREE_GRID | A treeview-like, columned list. |
TREE_ITEM | Unused. |
WIDGET | Abstract role for interactive components of a graphical user interface. |
WINDOW | Abstract role for windows. |
TOGGLE_BUTTON | |
APPLICATION | |
PARAGRAPH | |
BLOCK_QUOTE | |
ARTICLE | |
COMMENT | |
TERMINAL |
|
strong |
Enumerator | |
---|---|
BUSY | A “busy” state. This state has boolean values. |
CHECKED | A “checked” state; indicates the current state of a Gtk::CheckButton. Value type: Gtk::AccessibleTristate. |
DISABLED | A “disabled” state; corresponds to the Gtk::Widget::property_sensitive() property. It indicates a UI element that is perceivable, but not editable or operable. Value type: boolean. |
EXPANDED | An “expanded” state; corresponds to the Gtk::Expander::property_expanded() property. Value type: boolean or undefined. |
HIDDEN | A “hidden” state; corresponds to the Gtk::Widget::property_visible() property. You can use this state explicitly on UI elements that should not be exposed to an assistive technology. Value type: boolean See also: Gtk::Accessible::State::DISABLED. |
INVALID | An “invalid” state; set when a widget is showing an error. Value type: Gtk::AccessibleInvalidState. |
PRESSED | A “pressed” state; indicates the current state of a Gtk::ToggleButton. Value type: Gtk::AccessibleTristate enumeration. |
SELECTED | A “selected” state; set when a widget is selected. Value type: boolean or undefined. |
VISITED |
|
protected |
You should derive from this class to use it.
|
noexcept |
|
overridenoexcept |
void Gtk::Accessible::announce | ( | const Glib::ustring & | message, |
AnnouncementPriority | 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.
message | The string to announce. |
priority | The priority of the announcement. |
Glib::RefPtr< Accessible > Gtk::Accessible::get_accessible_parent | ( | ) |
Retrieves the accessible parent for an accessible object.
This function returns nullptr
for top level widgets.
Glib::RefPtr< const Accessible > Gtk::Accessible::get_accessible_parent | ( | ) | const |
Retrieves the accessible parent for an accessible object.
This function returns nullptr
for top level widgets.
Role Gtk::Accessible::get_accessible_role | ( | ) | const |
Retrieves the accessible role of an accessible object.
Glib::RefPtr< ATContext > Gtk::Accessible::get_at_context | ( | ) |
Retrieves the accessible implementation for the given Gtk::Accessible
.
Retrieves the accessible implementation for the given Gtk::Accessible
.
bool Gtk::Accessible::get_bounds | ( | int & | x, |
int & | y, | ||
int & | width, | ||
int & | height | ||
) | const |
Queries the coordinates and dimensions of this accessible.
This functionality can be overridden by Gtk::Accessible
implementations, e.g. to get the bounds from an ignored child widget.
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. |
Glib::RefPtr< Accessible > Gtk::Accessible::get_first_accessible_child | ( | ) |
Retrieves the first accessible child of an accessible object.
since: 4.10
Glib::RefPtr< const Accessible > Gtk::Accessible::get_first_accessible_child | ( | ) | const |
Retrieves the first accessible child of an accessible object.
since: 4.10
Glib::RefPtr< Accessible > Gtk::Accessible::get_next_accessible_sibling | ( | ) |
Retrieves the next accessible sibling of an accessible object.
since: 4.10
Glib::RefPtr< const Accessible > Gtk::Accessible::get_next_accessible_sibling | ( | ) | const |
Retrieves the next accessible sibling of an accessible object.
since: 4.10
bool Gtk::Accessible::get_platform_state | ( | PlatformState | state | ) | const |
Query a platform state, such as focus.
See gtk_accessible_platform_changed().
This functionality can be overridden by Gtk::Accessible
implementations, e.g. to get platform state from an ignored child widget, as is the case for Gtk::Text
wrappers.
state | Platform state to query. |
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
|
noexcept |
Glib::PropertyProxy< Role > Gtk::Accessible::property_accessible_role | ( | ) |
The accessible role of the given Gtk::Accessible
implementation.
The accessible role cannot be changed once set.
Default value: Gtk::Accessible::Role::NONE
Glib::PropertyProxy_ReadOnly< Role > Gtk::Accessible::property_accessible_role | ( | ) | const |
The accessible role of the given Gtk::Accessible
implementation.
The accessible role cannot be changed once set.
Default value: Gtk::Accessible::Role::NONE
Resets the accessible property to its default value.
property | A Gtk::Accessible::Property . |
Resets the accessible relation to its default value.
relation | A Gtk::Accessible::Relation . |
Resets the accessible state to its default value.
state | A Gtk::Accessible::State . |
void Gtk::Accessible::set_accessible_parent | ( | const Glib::RefPtr< Accessible > & | parent, |
const Glib::RefPtr< Accessible > & | next_sibling | ||
) |
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
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. |
void Gtk::Accessible::update_next_accessible_sibling | ( | const Glib::RefPtr< Accessible > & | new_sibling | ) |
Updates the next accessible sibling of self.
That might be useful when a new child of a custom Gtk::Accessible
is created, and it needs to be linked to a previous child.
new_sibling | The new next accessible sibling to set. |
Updates an accessible property.
This function should be called by Gtk::Widget types whenever an accessible property change must be communicated to assistive technologies.
property | A Gtk::Accessible::Property. |
value | A Glib::ValueBase. |
Updates an accessible relation.
This function should be called by Gtk::Widget types whenever an accessible relation change must be communicated to assistive technologies.
relation | A Gtk::Accessible::Relation. |
value | A Glib::ValueBase. |
Updates an accessible state.
This function should be called by Gtk::Widget types whenever an accessible state change must be communicated to assistive technologies.
state | A Gtk::Accessible::State. |
value | A Glib::ValueBase. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |