Atk.Object¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
The accessible layer of this object |
||
r |
The accessible MDI value of this object |
||
r/w |
Description of an object, formatted for assistive technology access |
||
r/w |
Help text associated with the accessible |
||
r |
The number of links which the current |
||
r/w |
ID for the accessible; useful for automated testing |
||
r/w |
Object instance’s name formatted for assistive technology access |
||
r/w |
Parent of the current accessible as returned by |
||
r/w |
The accessible role of this object |
||
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 |
||
r/w |
Is used to notify that the table caption has changed |
||
r/w |
Is used to notify that the table column description has changed |
||
r/w |
Is used to notify that the table column header has changed |
||
r/w |
Is used to notify that the table row description has changed |
||
r/w |
Is used to notify that the table row header has changed |
||
r/w |
Is used to notify that the table summary has changed |
||
r/w |
Is used to notify that the value has changed |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The “active-descendant-changed” signal is emitted by an object which has the state |
|
The “announcement” signal can be emitted to pass an announcement on to be read by a screen reader. |
|
The “attribute-changed” signal should be emitted when one of an object’s attributes changes. |
|
The signal “children-changed” is emitted when a child is added or removed from an object. |
|
The signal “focus-event” is emitted when an object gained or lost focus. |
|
The “notification” signal can be emitted to pass an announcement on to be read by a screen reader. |
|
The signal “property-change” is emitted when an object’s property value changes. |
|
The “state-change” signal is emitted when an object’s state changes. |
|
The “visible-data-changed” signal is emitted when the visual appearance of the object changed. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
accessible_parent |
r |
||
description |
r |
||
layer |
r |
||
name |
r |
||
parent |
r |
||
relation_set |
r |
||
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 of
Atk.Object
(or instances ofAtk.Object
-derived types) are queried for properties which relate basic (and generic) properties of a UI component such as name and description. Instances ofAtk.Object
may 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 corresponding
Atk.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 inheritedAtk.Object
implementation is insufficient, via instances of a newAtk.Object
subclass.See [class`AtkObjectFactory`], [class`AtkRegistry`]. (GTK+ users see also #GtkAccessible).
- add_relationship(relationship, target)[source]¶
- Parameters:
relationship (
Atk.RelationType
) – TheAtk.RelationType
of the relationtarget (
Atk.Object
) – TheAtk.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.
- get_accessible_id()[source]¶
- Returns:
a character string representing the accessible id of the object, or
None
if no such string was set.- Return type:
Gets the accessible id of the accessible.
New in version 2.34.
- get_attributes()[source]¶
- 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 to
Atk.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.
- get_description()[source]¶
- Returns:
a character string representing the accessible description of the accessible.
- Return type:
Gets the accessible description of the accessible.
- get_help_text()[source]¶
- Returns:
a character string representing the help text or the object, or
None
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.
- get_layer()[source]¶
-
Gets the layer of the accessible.
Deprecated since version ???: Use
Atk.Component.get_layer
instead.
- get_mdi_zorder()[source]¶
- 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 notAtk.Layer.MDI
.Deprecated since version ???: Use
Atk.Component.get_mdi_zorder
instead.
- 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.
- get_name()[source]¶
- Returns:
a character string representing the accessible name of the object.
- Return type:
Gets the accessible name of the accessible.
- get_object_locale()[source]¶
- 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.
- get_parent()[source]¶
- 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 with
Atk.Object.set_parent
(), useAtk.Object.peek_parent
().
- initialize(data)[source]¶
- Parameters:
data (
object
orNone
) – aobject
which identifies the object for which theAtk.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 ofAtk.Object
- notify_state_change(state, value)[source]¶
- Parameters:
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.
- peek_parent()[source]¶
- 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 returnsNone
.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
) – aint
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.
- ref_relation_set()[source]¶
- Returns:
an
Atk.RelationSet
representing the relation set of the object.- Return type:
Gets the
Atk.RelationSet
associated with the object.
- ref_state_set()[source]¶
- 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]¶
-
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
) – TheAtk.RelationType
of the relationtarget (
Atk.Object
) – TheAtk.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 aspectNone
is similar toAtk.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.
New in version 2.52.
- set_name(name)[source]¶
- 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 toAtk.Role.UNKNOWN
. If you want to set the name to a empty value you can use “”.
- set_parent(parent)[source]¶
- Parameters:
parent (
Atk.Object
) – anAtk.Object
to be set as the accessible parent
Sets the accessible parent of the accessible. parent can be
None
.
- do_children_changed(change_index, changed_child) virtual¶
- 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 to
Atk.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¶
-
Gets the layer of the accessible.
Deprecated since version ???: Use
Atk.Component.get_layer
instead.
- 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 notAtk.Layer.MDI
.Deprecated since version ???: Use
Atk.Component.get_mdi_zorder
instead.
- 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 with
Atk.Object.set_parent
(), useAtk.Object.peek_parent
().
- do_get_role() virtual¶
-
Gets the role of the accessible.
- do_initialize(data) virtual¶
- Parameters:
data (
object
orNone
) – aobject
which identifies the object for which theAtk.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 ofAtk.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¶
-
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 aspectNone
is similar toAtk.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 toAtk.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
) – anAtk.Object
to be set as the accessible parent
Sets the accessible parent of the accessible. parent can be
None
.
- do_set_role(role) virtual¶
-
Sets the role of the accessible.
- 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 signalarg1 (
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 signalarg1 (
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 signalarg1 (
str
) – the name of the attribute being modified, orNone
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 signalarg1 (
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
) – Aobject
to the childAtk.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 signalarg1 (
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 signalarg1 (
str
) – the text to be announced.arg2 (
int
) – anAtk.Live
specifying the politeness of the notification. Should be eitherAtk.Live.POLITE
orAtk.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 signalarg1 (
Atk.PropertyValues
) – anAtk.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 withGObject.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 use
GObject.Object.notify
() to emit property-changed notifications.Atk.Object
::property-changed
is needed by the implementation of atk_add_global_event_listener() becauseGObject.Object
notify 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 signalarg1 (
str
) – The name of the state which has changedarg2 (
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¶
-
The accessible layer of this object
- Atk.Object.props.accessible_component_mdi_zorder¶
-
The accessible MDI value of this object
- Atk.Object.props.accessible_description¶
-
Description of an object, formatted for assistive technology access
- Atk.Object.props.accessible_help_text¶
-
Help text associated with the accessible
- Atk.Object.props.accessible_hypertext_nlinks¶
-
The number of links which the current
Atk.Hypertext
has
- Atk.Object.props.accessible_id¶
-
ID for the accessible; useful for automated testing
- Atk.Object.props.accessible_name¶
-
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
-
Table caption.
Deprecated since version 1.3: Use table-caption-object instead.
- 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¶
-
Accessible table column description.
Deprecated since version 2.12: Use
Atk.Table.get_column_description
() andAtk.Table.set_column_description
() instead.
- Atk.Object.props.accessible_table_column_header¶
- Name:
accessible-table-column-header
- Type:
- Default Value:
- Flags:
Accessible table column header.
Deprecated since version 2.12: Use
Atk.Table.get_column_header
() andAtk.Table.set_column_header
() instead.
- Atk.Object.props.accessible_table_row_description¶
-
Accessible table row description.
Deprecated since version 2.12: Use
Atk.Table.get_row_description
() andAtk.Table.set_row_description
() instead.
- Atk.Object.props.accessible_table_row_header¶
- Name:
accessible-table-row-header
- Type:
- Default Value:
- Flags:
Accessible table row header.
Deprecated since version 2.12: Use
Atk.Table.get_row_header
() andAtk.Table.set_row_header
() instead.
- 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¶
-
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.