gtkmm 4.10.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gtk::Accessible Class Reference

Accessible interface. More...

`#include <gtkmm/accessible.h>`

Inheritance diagram for Gtk::Accessible:
[legend]

## Public Types
enum class | Role { ALERT , ALERT_DIALOG , BANNER , BUTTON , CAPTION , CELL , CHECKBOX , COLUMN_HEADER , COMBO_BOX , COMMAND , COMPOSITE , DIALOG , DOCUMENT , FEED , FORM , GENERIC , GRID , GRID_CELL , GROUP , HEADING , IMG , INPUT , LABEL , LANDMARK , LEGEND , LINK , LIST , LIST_BOX , LIST_ITEM , LOG , MAIN , MARQUEE , MATH , METER , MENU , MENU_BAR , MENU_ITEM , MENU_ITEM_CHECKBOX , MENU_ITEM_RADIO , NAVIGATION , NONE , NOTE , OPTION , PRESENTATION , PROGRESS_BAR , RADIO , RADIO_GROUP , RANGE , REGION , ROW , ROW_GROUP , ROW_HEADER , SCROLLBAR , SEARCH , SEARCH_BOX , SECTION , SECTION_HEAD , SELECT , SEPARATOR , SLIDER , SPIN_BUTTON , STATUS , STRUCTURE , SWITCH , TAB , TABLE , TAB_LIST , TAB_PANEL , TEXT_BOX , TIME , TIMER , TOOLBAR , TOOLTIP , TREE , TREE_GRID , TREE_ITEM , WIDGET , WINDOW , TOGGLE_BUTTON }
| The accessible role for a Gtk::Accessible implementation. More...
enum class | State { BUSY , CHECKED , DISABLED , EXPANDED , HIDDEN , INVALID , PRESSED , SELECTED }
| The possible accessible states of a Gtk::Accessible. More...
enum class | Property { AUTOCOMPLETE , DESCRIPTION , HAS_POPUP , KEY_SHORTCUTS , LABEL , LEVEL , MODAL , MULTI_LINE , MULTI_SELECTABLE , ORIENTATION , PLACEHOLDER , READ_ONLY , REQUIRED , ROLE_DESCRIPTION , SORT , VALUE_MAX , VALUE_MIN , VALUE_NOW , VALUE_TEXT }
| The possible accessible properties of a Gtk::Accessible. More...
enum class | Relation { ACTIVE_DESCENDANT , COL_COUNT , COL_INDEX , COL_INDEX_TEXT , COL_SPAN , CONTROLS , DESCRIBED_BY , DETAILS , ERROR_MESSAGE , FLOW_TO , LABELLED_BY , OWNS , POS_IN_SET , ROW_COUNT , ROW_INDEX , ROW_INDEX_TEXT , ROW_SPAN , SET_SIZE }
| The possible accessible relations of a Gtk::Accessible. More...
enum class | PlatformState { FOCUSABLE , FOCUSED , ACTIVE }
| The various platform states which can be queried using Gtk::Accessible::get_platform_state(). More...
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify
Public Types inherited from sigc::notifiable
typedef internal::func_destroy_notify | func_destroy_notify

## Public Member Functions
| Accessible (Accessible && src) noexcept
Accessible & | operator= (Accessible && src) noexcept
| ~Accessible () noexcept override
GtkAccessible * | gobj ()
| Provides access to the underlying C GObject. More...
const GtkAccessible * | gobj () const
| Provides access to the underlying C GObject. More...
Glib::RefPtr< ATContext > | get_at_context ()
| Retrieves the accessible implementation for the given `Gtk::Accessible`. More...
Glib::RefPtr< const ATContext > | get_at_context () const
| Retrieves the accessible implementation for the given `Gtk::Accessible`. More...
bool | get_platform_state (PlatformState state) const
| Query a platform state, such as focus. More...
Glib::RefPtr< Accessible > | get_accessible_parent ()
| Retrieves the accessible parent for an accessible object. More...
Glib::RefPtr< const Accessible > | get_accessible_parent () const
| Retrieves the accessible parent for an accessible object. More...
void | set_accessible_parent (const Glib::RefPtr< Accessible > & parent, const Glib::RefPtr< Accessible > & next_sibling)
| Sets the parent and sibling of an accessible object. More...
Glib::RefPtr< Accessible > | get_first_accessible_child ()
| Retrieves the first accessible child of an accessible object. More...
Glib::RefPtr< const Accessible > | get_first_accessible_child () const
| Retrieves the first accessible child of an accessible object. More...
Glib::RefPtr< Accessible > | get_next_accessible_sibling ()
| Retrieves the next accessible sibling of an accessible object. More...
Glib::RefPtr< const Accessible > | get_next_accessible_sibling () const
| Retrieves the next accessible sibling of an accessible object. More...
void | update_next_accessible_sibling (const Glib::RefPtr< Accessible > & new_sibling)
| Updates the next accessible sibling of self. More...
bool | get_bounds (int & x, int & y, int & width, int & height) const
| Queries the coordinates and dimensions of this accessible. More...
Role | get_accessible_role () const
| Retrieves the accessible role of an accessible object. More...
void | update_state (State state, const Glib::ValueBase & value)
| Updates an accessible state. More...
void | update_property (Property property, const Glib::ValueBase & value)
| Updates an accessible property. More...
void | update_relation (Relation relation, const Glib::ValueBase & value)
| Updates an accessible relation. More...
void | reset_state (State state)
| Resets the accessible state to its default value. More...
void | reset_property (Property property)
| Resets the accessible property to its default value. More...
void | reset_relation (Relation relation)
| Resets the accessible relation to its default value. More...
Glib::PropertyProxy< Role > | property_accessible_role ()
| The accessible role of the given `Gtk::Accessible` implementation. More...
Glib::PropertyProxy_ReadOnly< Role > | property_accessible_role () const
| The accessible role of the given `Gtk::Accessible` implementation. More...
Public Member Functions inherited from Glib::Interface
| Interface ()
| Interface (Interface &&src) noexcept
Interface & | operator= (Interface &&src) noexcept
| Interface (const Glib::Interface_Class &interface_class)
| Interface (GObject *castitem)
| ~Interface () noexcept override
| Interface (const Interface &)=delete
Interface & | operator= (const Interface &)=delete
GObject * | gobj ()
const GObject * | gobj () const
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase &)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
PropertyType | get_property (const Glib::ustring &property_name) const
sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot)
sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src) noexcept
| ~trackable ()
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src) noexcept
void | remove_destroy_notify_callback (notifiable *data) const

## 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. More...

## Protected Member Functions
| Accessible ()
| You should derive from this class to use it. More...
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
| ObjectBase (ObjectBase &&src) noexcept
ObjectBase & | operator= (ObjectBase &&src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject *castitem)
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gtk::Accessible > | wrap (GtkAccessible * object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

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:

- a “role”, represented by a value of the Gtk::Accessible::Role enumeration
- an “attribute”, represented by a set of Gtk::Accessible::State, Gtk::Accessible::Property and Gtk::Accessible::Relation values

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().

Since gtkmm 3.98:

## Constructor & Destructor Documentation

## ◆ Accessible() [1/2]

Gtk::Accessible::Accessible | ( |  | ) |
| protected

You should derive from this class to use it.

## ◆ Accessible() [2/2]

Gtk::Accessible::Accessible | ( | Accessible && | src | ) |
| noexcept

## ◆ ~Accessible()

Gtk::Accessible::~Accessible | ( |  | ) |
| override noexcept

## Member Function Documentation

## ◆ add_interface()

static void Gtk::Accessible::add_interface | ( | GType | gtype_implementer | ) |
| static

## ◆ get_accessible_parent() [1/2]

Glib::RefPtr<Accessible> Gtk::Accessible::get_accessible_parent | ( |  | ) |

Retrieves the accessible parent for an accessible object.

This function returns `nullptr` for top level widgets.

Since gtkmm 4.10:

Returns
  The accessible parent.

## ◆ get_accessible_parent() [2/2]

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.

Since gtkmm 4.10:

Returns
  The accessible parent.

## ◆ get_accessible_role()

Role Gtk::Accessible::get_accessible_role | ( |  | ) | const

Retrieves the accessible role of an accessible object.

Returns
  The accessible role.

## ◆ get_at_context() [1/2]

Glib::RefPtr<ATContext> Gtk::Accessible::get_at_context | ( |  | ) |

Retrieves the accessible implementation for the given `Gtk::Accessible`.

Since gtkmm 4.10:

Returns
  The accessible implementation object.

## ◆ get_at_context() [2/2]

Glib::RefPtr<const ATContext> Gtk::Accessible::get_at_context | ( |  | ) | const

Retrieves the accessible implementation for the given `Gtk::Accessible`.

Since gtkmm 4.10:

Returns
  The accessible implementation object.

## ◆ get_bounds()

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.

Since gtkmm 4.10:

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.

## ◆ get_first_accessible_child() [1/2]

Glib::RefPtr<Accessible> Gtk::Accessible::get_first_accessible_child | ( |  | ) |

Retrieves the first accessible child of an accessible object.

since: 4.10

Returns
  The first accessible child.

## ◆ get_first_accessible_child() [2/2]

Glib::RefPtr<const Accessible> Gtk::Accessible::get_first_accessible_child | ( |  | ) | const

Retrieves the first accessible child of an accessible object.

since: 4.10

Returns
  The first accessible child.

## ◆ get_next_accessible_sibling() [1/2]

Glib::RefPtr<Accessible> Gtk::Accessible::get_next_accessible_sibling | ( |  | ) |

Retrieves the next accessible sibling of an accessible object.

since: 4.10

Returns
  The next accessible sibling.

## ◆ get_next_accessible_sibling() [2/2]

Glib::RefPtr<const Accessible> Gtk::Accessible::get_next_accessible_sibling | ( |  | ) | const

Retrieves the next accessible sibling of an accessible object.

since: 4.10

Returns
  The next accessible sibling.

## ◆ get_platform_state()

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.

Since gtkmm 4.10:

Parameters

  state | Platform state to query.

Returns
  The value of state for the accessible.

## ◆ get_type()

static GType Gtk::Accessible::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

GtkAccessible* Gtk::Accessible::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GtkAccessible* Gtk::Accessible::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ operator=()

Accessible& Gtk::Accessible::operator= | ( | Accessible && | src | ) |
| noexcept

## ◆ property_accessible_role() [1/2]

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

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_accessible_role() [2/2]

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

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ reset_property()

void Gtk::Accessible::reset_property | ( | Property | property | ) |

Resets the accessible property to its default value.

Parameters

  property | A `Gtk::Accessible::Property`.

## ◆ reset_relation()

void Gtk::Accessible::reset_relation | ( | Relation | relation | ) |

Resets the accessible relation to its default value.

Parameters

  relation | A `Gtk::Accessible::Relation`.

## ◆ reset_state()

void Gtk::Accessible::reset_state | ( | State | state | ) |

Resets the accessible state to its default value.

Parameters

  state | A `Gtk::Accessible::State`.

## ◆ set_accessible_parent()

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.

Since gtkmm 4.10:

Parameters

  parent | The parent accessible object.
  next_sibling | The sibling accessible object.

## ◆ update_next_accessible_sibling()

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.

Since gtkmm 4.10:

Parameters

  new_sibling | The new next accessible sibling to set.

## ◆ update_property()

void Gtk::Accessible::update_property | ( | Property | property,
|  | const Glib::ValueBase & | value
| ) |  |

Updates an accessible property.

This function should be called by Gtk::Widget types whenever an accessible property change must be communicated to assistive technologies.

Parameters

  property | A Gtk::Accessible::Property.
  value | A Glib::ValueBase.

## ◆ update_relation()

void Gtk::Accessible::update_relation | ( | Relation | relation,
|  | const Glib::ValueBase & | value
| ) |  |

Updates an accessible relation.

This function should be called by Gtk::Widget types whenever an accessible relation change must be communicated to assistive technologies.

Parameters

  relation | A Gtk::Accessible::Relation.
  value | A Glib::ValueBase.

## ◆ update_state()

void Gtk::Accessible::update_state | ( | State | state,
|  | const Glib::ValueBase & | value
| ) |  |

Updates an accessible state.

This function should be called by Gtk::Widget types whenever an accessible state change must be communicated to assistive technologies.

Parameters

  state | A Gtk::Accessible::State.
  value | A Glib::ValueBase.

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gtk::Accessible > wrap | ( | GtkAccessible * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

A Glib::wrap() method for this object.

Parameters

  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.

Returns
  A C++ instance that wraps this C instance.