gtkmm 4.14.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:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

 Accessible (Accessible && src) noexcept
 
Accessibleoperator= (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< ATContextget_at_context ()
 Retrieves the accessible implementation for the given Gtk::Accessible. More...
 
Glib::RefPtr< const ATContextget_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< Accessibleget_accessible_parent ()
 Retrieves the accessible parent for an accessible object. More...
 
Glib::RefPtr< const Accessibleget_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< Accessibleget_first_accessible_child ()
 Retrieves the first accessible child of an accessible object. More...
 
Glib::RefPtr< const Accessibleget_first_accessible_child () const
 Retrieves the first accessible child of an accessible object. More...
 
Glib::RefPtr< Accessibleget_next_accessible_sibling ()
 Retrieves the next accessible sibling of an accessible object. More...
 
Glib::RefPtr< const Accessibleget_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...
 
void announce (const Glib::ustring & message, AnnouncementPriority priority)
 Requests the user's screen reader to announce the given message. More...
 
Glib::PropertyProxy< Roleproperty_accessible_role ()
 The accessible role of the given Gtk::Accessible implementation. More...
 
Glib::PropertyProxy_ReadOnly< Roleproperty_accessible_role () const
 The accessible role of the given Gtk::Accessible implementation. More...
 

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

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::Accessiblewrap (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:

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

Member Function Documentation

◆ add_interface()

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

◆ announce()

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.

Since gtkmm 4.14:
Parameters
messageThe string to announce.
priorityThe priority of the announcement.

◆ 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
xThe x coordinate of the top left corner of the accessible.
yThe y coordinate of the top left corner of the widget.
widthThe width of the accessible object.
heightThe 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
statePlatform 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
propertyA Gtk::Accessible::Property.

◆ reset_relation()

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

Resets the accessible relation to its default value.

Parameters
relationA Gtk::Accessible::Relation.

◆ reset_state()

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

Resets the accessible state to its default value.

Parameters
stateA 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
parentThe parent accessible object.
next_siblingThe 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_siblingThe 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
propertyA Gtk::Accessible::Property.
valueA 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
relationA Gtk::Accessible::Relation.
valueA 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
stateA Gtk::Accessible::State.
valueA 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
objectThe C instance.
take_copyFalse 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.