Atk.Object - Classes - Atk 1.0 (original) (raw)
g Atk.Object Atk.Object GObject.Object GObject.Object GObject.Object->Atk.Object
Subclasses:
Atk.GObjectAccessible, Atk.NoOpObject, Atk.Plug, Atk.Socket
Methods¶
Inherited:
Structs:
add_relationship (relationship, target) |
---|
get_accessible_id () |
get_attributes () |
get_description () |
get_help_text () |
get_index_in_parent () |
get_layer () |
get_mdi_zorder () |
get_n_accessible_children () |
get_name () |
get_object_locale () |
get_parent () |
get_role () |
initialize (data) |
notify_state_change (state, value) |
peek_parent () |
ref_accessible_child (i) |
ref_relation_set () |
ref_state_set () |
remove_property_change_handler (handler_id) |
remove_relationship (relationship, target) |
set_accessible_id (id) |
set_description (description) |
set_help_text (help_text) |
set_name (name) |
set_parent (parent) |
set_role (role) |
Virtual Methods¶
Inherited:
do_active_descendant_changed (child) |
---|
do_children_changed (change_index, changed_child) |
do_focus_event (focus_in) |
do_get_attributes () |
do_get_description () |
do_get_index_in_parent () |
do_get_layer () |
do_get_mdi_zorder () |
do_get_n_children () |
do_get_name () |
do_get_object_locale () |
do_get_parent () |
do_get_role () |
do_initialize (data) |
do_property_change (values) |
do_ref_relation_set () |
do_ref_state_set () |
do_remove_property_change_handler (handler_id) |
do_set_description (description) |
do_set_name (name) |
do_set_parent (parent) |
do_set_role (role) |
do_state_change (name, state_set) |
do_visible_data_changed () |
Properties¶
Name | Type | Flags | Short Description |
---|---|---|---|
accessible-component-layer | int | r | The accessible layer of this object |
accessible-component-mdi-zorder | int | r | The accessible MDI value of this object |
accessible-description | str | r/w | Description of an object, formatted for assistive technology access |
accessible-help-text | str | r/w | Help text associated with the accessible |
accessible-hypertext-nlinks | int | r | The number of links which the current Atk.Hypertext has |
accessible-id | str | r/w | ID for the accessible; useful for automated testing |
accessible-name | str | r/w | Object instance’s name formatted for assistive technology access |
accessible-parent | Atk.Object | r/w | Parent of the current accessible as returned by Atk.Object.get_parent() |
accessible-role | Atk.Role | r/w | The accessible role of this object |
accessible-table-caption | str | r/w | Is used to notify that the table caption has changed; this property should not be used. accessible-table-caption-object should be used instead deprecated |
accessible-table-caption-object | Atk.Object | r/w | Is used to notify that the table caption has changed |
accessible-table-column-description | str | r/w | Is used to notify that the table column description has changed deprecated |
accessible-table-column-header | Atk.Object | r/w | Is used to notify that the table column header has changed deprecated |
accessible-table-row-description | str | r/w | Is used to notify that the table row description has changed deprecated |
accessible-table-row-header | Atk.Object | r/w | Is used to notify that the table row header has changed deprecated |
accessible-table-summary | Atk.Object | r/w | Is used to notify that the table summary has changed |
accessible-value | float | r/w | Is used to notify that the value has changed deprecated |
Signals¶
Inherited:
Name | Short Description |
---|---|
active-descendant-changed | The “active-descendant-changed” signal is emitted by an object which has the state Atk.StateType.MANAGES_DESCENDANTS when the focus object in the object changes. |
announcement | The “announcement” signal can be emitted to pass an announcement on to be read by a screen reader. |
attribute-changed | The “attribute-changed” signal should be emitted when one of an object’s attributes changes. |
children-changed | The signal “children-changed” is emitted when a child is added or removed from an object. |
focus-event | The signal “focus-event” is emitted when an object gained or lost focus. deprecated |
notification | The “notification” signal can be emitted to pass an announcement on to be read by a screen reader. |
property-change | The signal “property-change” is emitted when an object’s property value changes. |
state-change | The “state-change” signal is emitted when an object’s state changes. |
visible-data-changed | The “visible-data-changed” signal is emitted when the visual appearance of the object changed. |
Fields¶
Inherited:
Name | Type | Access | Description |
---|---|---|---|
accessible_parent | Atk.Object | r | |
description | str | r | |
layer | Atk.Layer | r | |
name | str | r | |
parent | GObject.Object | r | |
relation_set | Atk.RelationSet | r | |
role | Atk.Role | r |
Class Details¶
class Atk.Object(**kwargs)¶
Bases:
Abstract:
No
Structure:
The base object class for the Accessibility Toolkit API.
This class is the primary class for accessibility support via the Accessibility ToolKit (ATK). Objects which are instances ofAtk.Object (or instances of Atk.Object-derived types) are queried for properties which relate basic (and generic) properties of a UI component such as name and description. Instances of Atk.Objectmay also be queried as to whether they implement other ATK interfaces (e.g. Atk.Action, Atk.Component, etc.), as appropriate to the role which a given UI component plays in a user interface.
All UI components in an application which provide useful information or services to the user must provide correspondingAtk.Object instances on request (in GTK+, for instance, usually on a call to #gtk_widget_get_accessible ()), either via ATK support built into the toolkit for the widget class or ancestor class, or in the case of custom widgets, if the inherited Atk.Objectimplementation is insufficient, via instances of a new Atk.Objectsubclass.
See [class`AtkObjectFactory`], [class`AtkRegistry`]. (GTK+ users see also #GtkAccessible).
add_relationship(relationship, target)[source]¶
Parameters:
- relationship (Atk.RelationType) – The Atk.RelationType of the relation
- target (Atk.Object) – The Atk.Object which is to be the target of the relation.
Returns:
True if the relationship is added.
Return type:
Adds a relationship of the specified type with the specified target.
Returns:
a character string representing the accessible id of the object, orNone if no such string was set.
Return type:
Gets the accessible id of the accessible.
New in version 2.34.
Returns:
an #AtkAttributeSet consisting of all explicit properties/annotations applied to the object, or an empty set if the object has no name-value pair attributes assigned to it. This #atkattributeset should be freed by a call toAtk.Attribute.set_free().
Return type:
[object]
Get a list of properties applied to this object as a whole, as an #AtkAttributeSet consisting of name-value pairs. As such these attributes may be considered weakly-typed properties or annotations, as distinct from strongly-typed object data available via other get/set methods. Not all objects have explicit “name-value pair” #AtkAttributeSet properties.
New in version 1.12.
Returns:
a character string representing the accessible description of the accessible.
Return type:
Gets the accessible description of the accessible.
Returns:
a character string representing the help text or the object, orNone if no such string was set.
Return type:
Gets the help text associated with the accessible.
New in version 2.52.
get_index_in_parent()[source]¶
Returns:
an integer which is the index of the accessible in its parent
Return type:
Gets the 0-based index of this accessible in its parent; returns -1 if the accessible does not have an accessible parent.
Returns:
an Atk.Layer which is the layer of the accessible
Return type:
Gets the layer of the accessible.
Returns:
a int which is the zorder of the accessible, i.e. the depth at which the component is shown in relation to other components in the same container.
Return type:
Gets the zorder of the accessible. The value GObject.G_MININT will be returned if the layer of the accessible is not Atk.Layer.MDI.
get_n_accessible_children()[source]¶
Returns:
an integer representing the number of accessible children of the accessible.
Return type:
Gets the number of accessible children of the accessible.
Returns:
a character string representing the accessible name of the object.
Return type:
Gets the accessible name of the accessible.
Returns:
a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of self.
Return type:
Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of self.
New in version 2.8.
Returns:
an Atk.Object representing the accessible parent of the accessible
Return type:
Gets the accessible parent of the accessible. By default this is the one assigned with Atk.Object.set_parent(), but it is assumed that ATK implementors have ways to get the parent of the object without the need of assigning it manually withAtk.Object.set_parent(), and will return it with this method.
If you are only interested on the parent assigned withAtk.Object.set_parent(), use Atk.Object.peek_parent().
Returns:
an Atk.Role which is the role of the accessible
Return type:
Gets the role of the accessible.
Parameters:
data (object or None) – a object which identifies the object for which the Atk.Object was created.
This function is called when implementing subclasses of Atk.Object. It does initialization required for the new object. It is intended that this function should called only in the …_new() functions used to create an instance of a subclass of Atk.Object
notify_state_change(state, value)[source]¶
Parameters:
- state (int) – an #AtkState whose state is changed
- value (bool) – a bool which indicates whether the state is being set on or off
Emits a state-change signal for the specified state.
Note that as a general rule when the state of an existing object changes, emitting a notification is expected.
Returns:
an Atk.Object representing the accessible parent of the accessible if assigned
Return type:
Gets the accessible parent of the accessible, if it has been manually assigned with Atk.Object.set_parent. Otherwise, this function returns None.
This method is intended as an utility for ATK implementors, and not to be exposed to accessible tools. See Atk.Object.get_parent() for further reference.
ref_accessible_child(i)[source]¶
Parameters:
i (int) – a int representing the position of the child, starting from 0
Returns:
an Atk.Object representing the specified accessible child of the accessible.
Return type:
Gets a reference to the specified accessible child of the object. The accessible children are 0-based so the first accessible child is at index 0, the second at index 1 and so on.
Returns:
an Atk.RelationSet representing the relation set of the object.
Return type:
Gets the Atk.RelationSet associated with the object.
Returns:
a reference to an Atk.StateSet which is the state set of the accessible
Return type:
Gets a reference to the state set of the accessible; the caller must unreference it when it is no longer needed.
remove_property_change_handler(handler_id)[source]¶
Parameters:
handler_id (int) – a int which identifies the handler to be removed.
Removes a property change handler.
Deprecated since version 2.12: See atk_object_connect_property_change_handler()
remove_relationship(relationship, target)[source]¶
Parameters:
- relationship (Atk.RelationType) – The Atk.RelationType of the relation
- target (Atk.Object) – The Atk.Object which is the target of the relation to be removed.
Returns:
True if the relationship is removed.
Return type:
Removes a relationship of the specified type with the specified target.
set_accessible_id(id)[source]¶
Parameters:
id (str) – a character string to be set as the accessible id
Sets the accessible ID of the accessible. This is not meant to be presented to the user, but to be an ID which is stable over application development. Typically, this is the gtkbuilder ID. Such an ID will be available for instance to identify a given well-known accessible object for tailored screen reading, or for automatic regression testing.
New in version 2.34.
set_description(description)[source]¶
Parameters:
description (str) – a character string to be set as the accessible description
Sets the accessible description of the accessible. You can’t set the description to None. This is reserved for the initial value. In this aspect None is similar to Atk.Role.UNKNOWN. If you want to set the name to a empty value you can use “”.
set_help_text(help_text)[source]¶
Parameters:
help_text (str) – a character string to be set as the accessible’s help text
Sets the help text associated with the accessible. This can be used to expose context-sensitive information to help a user understand how to interact with the object. You can’t set the help text to None. This is reserved for the initial value. If you want to set the name to an empty value, you can use “”.
New in version 2.52.
Parameters:
name (str) – a character string to be set as the accessible name
Sets the accessible name of the accessible. You can’t set the name to None. This is reserved for the initial value. In this aspectNone is similar to Atk.Role.UNKNOWN. If you want to set the name to a empty value you can use “”.
Parameters:
parent (Atk.Object) – an Atk.Object to be set as the accessible parent
Sets the accessible parent of the accessible. parent can be None.
Parameters:
role (Atk.Role) – an Atk.Role to be set as the role
Sets the role of the accessible.
do_active_descendant_changed(child) virtual¶
Parameters:
do_children_changed(change_index, changed_child) virtual¶
Parameters:
do_focus_event(focus_in) virtual¶
Parameters:
focus_in (bool) –
The signal handler which is executed when there is a focus event for an object. This virtual function is deprecated since 2.9.4 and it should not be overriden. Use the Atk.Object ::state-change “focused” signal instead.
do_get_attributes() virtual¶
Returns:
an #AtkAttributeSet consisting of all explicit properties/annotations applied to the object, or an empty set if the object has no name-value pair attributes assigned to it. This #atkattributeset should be freed by a call toAtk.Attribute.set_free().
Return type:
[object]
Get a list of properties applied to this object as a whole, as an #AtkAttributeSet consisting of name-value pairs. As such these attributes may be considered weakly-typed properties or annotations, as distinct from strongly-typed object data available via other get/set methods. Not all objects have explicit “name-value pair” #AtkAttributeSet properties.
New in version 1.12.
do_get_description() virtual¶
Returns:
a character string representing the accessible description of the accessible.
Return type:
Gets the accessible description of the accessible.
do_get_index_in_parent() virtual¶
Returns:
an integer which is the index of the accessible in its parent
Return type:
Gets the 0-based index of this accessible in its parent; returns -1 if the accessible does not have an accessible parent.
do_get_layer() virtual¶
Returns:
an Atk.Layer which is the layer of the accessible
Return type:
Gets the layer of the accessible.
do_get_mdi_zorder() virtual¶
Returns:
a int which is the zorder of the accessible, i.e. the depth at which the component is shown in relation to other components in the same container.
Return type:
Gets the zorder of the accessible. The value GObject.G_MININT will be returned if the layer of the accessible is not Atk.Layer.MDI.
do_get_n_children() virtual¶
Return type:
do_get_name() virtual¶
Returns:
a character string representing the accessible name of the object.
Return type:
Gets the accessible name of the accessible.
do_get_object_locale() virtual¶
Returns:
a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of accessible.
Return type:
Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of accessible.
New in version 2.8.
do_get_parent() virtual¶
Returns:
an Atk.Object representing the accessible parent of the accessible
Return type:
Gets the accessible parent of the accessible. By default this is the one assigned with Atk.Object.set_parent(), but it is assumed that ATK implementors have ways to get the parent of the object without the need of assigning it manually withAtk.Object.set_parent(), and will return it with this method.
If you are only interested on the parent assigned withAtk.Object.set_parent(), use Atk.Object.peek_parent().
do_get_role() virtual¶
Returns:
an Atk.Role which is the role of the accessible
Return type:
Gets the role of the accessible.
do_initialize(data) virtual¶
Parameters:
data (object or None) – a object which identifies the object for which the Atk.Object was created.
This function is called when implementing subclasses of Atk.Object. It does initialization required for the new object. It is intended that this function should called only in the …_new() functions used to create an instance of a subclass of Atk.Object
do_property_change(values) virtual¶
Parameters:
values (Atk.PropertyValues) –
do_ref_relation_set() virtual¶
Returns:
an Atk.RelationSet representing the relation set of the object.
Return type:
Gets the Atk.RelationSet associated with the object.
do_ref_state_set() virtual¶
Returns:
a reference to an Atk.StateSet which is the state set of the accessible
Return type:
Gets a reference to the state set of the accessible; the caller must unreference it when it is no longer needed.
do_remove_property_change_handler(handler_id) virtual¶
Parameters:
handler_id (int) – a int which identifies the handler to be removed.
Removes a property change handler.
Deprecated since version 2.12: See atk_object_connect_property_change_handler()
do_set_description(description) virtual¶
Parameters:
description (str) – a character string to be set as the accessible description
Sets the accessible description of the accessible. You can’t set the description to None. This is reserved for the initial value. In this aspect None is similar to Atk.Role.UNKNOWN. If you want to set the name to a empty value you can use “”.
do_set_name(name) virtual¶
Parameters:
name (str) – a character string to be set as the accessible name
Sets the accessible name of the accessible. You can’t set the name to None. This is reserved for the initial value. In this aspectNone is similar to Atk.Role.UNKNOWN. If you want to set the name to a empty value you can use “”.
do_set_parent(parent) virtual¶
Parameters:
parent (Atk.Object) – an Atk.Object to be set as the accessible parent
Sets the accessible parent of the accessible. parent can be None.
do_set_role(role) virtual¶
Parameters:
role (Atk.Role) – an Atk.Role to be set as the role
Sets the role of the accessible.
do_state_change(name, state_set) virtual¶
Parameters:
do_visible_data_changed() virtual¶
Signal Details¶
Atk.Object.signals.active_descendant_changed(object, arg1)¶
Signal Name:
active-descendant-changed
Flags:
Parameters:
- object (Atk.Object) – The object which received the signal
- arg1 (Atk.Object) – the newly focused object.
The “active-descendant-changed” signal is emitted by an object which has the state Atk.StateType.MANAGES_DESCENDANTS when the focus object in the object changes. For instance, a table will emit the signal when the cell in the table which has focus changes.
Atk.Object.signals.announcement(object, arg1)¶
Signal Name:
announcement
Flags:
Parameters:
- object (Atk.Object) – The object which received the signal
- arg1 (str) – the text to be announced.
The “announcement” signal can be emitted to pass an announcement on to be read by a screen reader.
Depcrecated (2.50): Use Atk.Object ::notification instead.
New in version 2.46.
Atk.Object.signals.attribute_changed(object, arg1, arg2)¶
Signal Name:
attribute-changed
Flags:
Parameters:
- object (Atk.Object) – The object which received the signal
- arg1 (str) – the name of the attribute being modified, or None if not available.
- arg2 (str) – the attribute’s new value, or %null if not available.
The “attribute-changed” signal should be emitted when one of an object’s attributes changes.
New in version 2.52.
Atk.Object.signals.children_changed(object, arg1, arg2)¶
Signal Name:
children-changed
Flags:
Parameters:
- object (Atk.Object) – The object which received the signal
- arg1 (int) – The index of the added or removed child. The value can be -1. This is used if the value is not known by the implementor when the child is added/removed or irrelevant.
- arg2 (Atk.Object) – A object to the child Atk.Object which was added or removed. If the child was removed, it is possible that it is not available for the implementor. In that case this pointer can beNone.
The signal “children-changed” is emitted when a child is added or removed from an object. It supports two details: “add” and “remove”
Atk.Object.signals.focus_event(object, arg1)¶
Signal Name:
focus-event
Flags:
Parameters:
- object (Atk.Object) – The object which received the signal
- arg1 (bool) – a boolean value which indicates whether the object gained or lost focus.
The signal “focus-event” is emitted when an object gained or lost focus.
Deprecated since version 2.9.4: Use the Atk.Object ::state-change signal instead.
Atk.Object.signals.notification(object, arg1, arg2)¶
Signal Name:
notification
Flags:
Parameters:
- object (Atk.Object) – The object which received the signal
- arg1 (str) – the text to be announced.
- arg2 (int) – an Atk.Live specifying the politeness of the notification. Should be either Atk.Live.POLITE or Atk.Live.ASSERTIVE.
The “notification” signal can be emitted to pass an announcement on to be read by a screen reader.
New in version 2.50.
Atk.Object.signals.property_change(object, arg1)¶
Signal Name:
property-change
Flags:
Parameters:
- object (Atk.Object) – The object which received the signal
- arg1 (Atk.PropertyValues) – an Atk.PropertyValues containing the new value of the property which changed.
The signal “property-change” is emitted when an object’s property value changes. arg1 contains an Atk.PropertyValues with the name and the new value of the property whose value has changed. Note that, as with GObject.Object notify, getting this signal does not guarantee that the value of the property has actually changed; it may also be emitted when the setter of the property is called to reinstate the previous value.
Toolkit implementor note: ATK implementors should useGObject.Object.notify() to emit property-changed notifications. Atk.Object ::property-changed
is needed by the implementation of atk_add_global_event_listener() because GObject.Objectnotify doesn’t support emission hooks.
Atk.Object.signals.state_change(object, arg1, arg2)¶
Signal Name:
state-change
Flags:
Parameters:
- object (Atk.Object) – The object which received the signal
- arg1 (str) – The name of the state which has changed
- arg2 (bool) – A boolean which indicates whether the state has been set or unset.
The “state-change” signal is emitted when an object’s state changes. The detail value identifies the state type which has changed.
Atk.Object.signals.visible_data_changed(object)¶
Signal Name:
visible-data-changed
Flags:
Parameters:
object (Atk.Object) – The object which received the signal
The “visible-data-changed” signal is emitted when the visual appearance of the object changed.
Property Details¶
Atk.Object.props.accessible_component_layer¶
Name:
accessible-component-layer
Type:
Default Value:
0
Flags:
The accessible layer of this object
Atk.Object.props.accessible_component_mdi_zorder¶
Name:
accessible-component-mdi-zorder
Type:
Default Value:
-2147483648
Flags:
The accessible MDI value of this object
Atk.Object.props.accessible_description¶
Name:
accessible-description
Type:
Default Value:
Flags:
Description of an object, formatted for assistive technology access
Atk.Object.props.accessible_help_text¶
Name:
accessible-help-text
Type:
Default Value:
Flags:
Help text associated with the accessible
Atk.Object.props.accessible_hypertext_nlinks¶
Name:
accessible-hypertext-nlinks
Type:
Default Value:
0
Flags:
The number of links which the current Atk.Hypertext has
Atk.Object.props.accessible_id¶
Name:
accessible-id
Type:
Default Value:
Flags:
ID for the accessible; useful for automated testing
Atk.Object.props.accessible_name¶
Name:
accessible-name
Type:
Default Value:
Flags:
Object instance’s name formatted for assistive technology access
Atk.Object.props.accessible_parent¶
Name:
accessible-parent
Type:
Default Value:
Flags:
Parent of the current accessible as returned by Atk.Object.get_parent()
Atk.Object.props.accessible_role¶
Name:
accessible-role
Type:
Default Value:
Flags:
The accessible role of this object
Atk.Object.props.accessible_table_caption¶
Name:
accessible-table-caption
Type:
Default Value:
Flags:
Table caption.
Deprecated since version 1.3: Use table-caption-object instead.
Atk.Object.props.accessible_table_caption_object¶
Name:
accessible-table-caption-object
Type:
Default Value:
Flags:
Is used to notify that the table caption has changed
Atk.Object.props.accessible_table_column_description¶
Name:
accessible-table-column-description
Type:
Default Value:
Flags:
Accessible table column description.
Atk.Object.props.accessible_table_column_header¶
Name:
accessible-table-column-header
Type:
Default Value:
Flags:
Accessible table column header.
Atk.Object.props.accessible_table_row_description¶
Name:
accessible-table-row-description
Type:
Default Value:
Flags:
Accessible table row description.
Name:
accessible-table-row-header
Type:
Default Value:
Flags:
Accessible table row header.
Atk.Object.props.accessible_table_summary¶
Name:
accessible-table-summary
Type:
Default Value:
Flags:
Is used to notify that the table summary has changed
Atk.Object.props.accessible_value¶
Name:
accessible-value
Type:
Default Value:
0.0
Flags:
Numeric value of this object, in case being and Atk.Value.
Deprecated since version 2.12: Use Atk.Value.get_value_and_text() to get the value, and value-changed signal to be notified on their value changes.