2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = AtkObject.html
47 * - AtkStateSet* -> StateSet
53 private import atk
.atktypes
;
55 private import lib
.atk
;
57 private import glib
.Str
;
58 private import atk
.StateSet
;
62 * This class is the primary class for accessibility support via
63 * the Accessibility ToolKit (ATK). Objects which are instances
64 * of AtkObject (or instances of AtkObject-derived types) are
65 * queried for properties which relate basic (and generic) properties of a
66 * UI component such as name and description. Instances of AtkObject
67 * may also be queried as to whether they implement other ATK interfaces
68 * (e.g. AtkAction, AtkComponent, etc.), as appropriate to the role
69 * which a given UI component plays in a user interface.
70 * All UI components in an application which provide useful
71 * information or services to the user must provide corresponding
72 * AtkObject instances on request (in GTK+, for instance, usually
73 * on a call to #gtk_widget_get_accessible()), either via ATK support
74 * built into the toolkit for the widget class or ancestor class, or in
75 * the case of custom widgets, if the inherited AtkObject implementation
76 * is insufficient, via instances of a new AtkObject subclass.
78 private import gobject
.ObjectG
;
79 public class ObjectAtk
: ObjectG
82 /** the main Gtk struct */
83 protected AtkObject
* atkObject
;
86 public AtkObject
* getObjectAtkStruct()
92 /** the main Gtk struct as a void* */
93 protected void* getStruct()
95 return cast(void*)atkObject
;
99 * Sets our main struct and passes it to the parent class
101 public this (AtkObject
* atkObject
)
103 super(cast(GObject
*)atkObject
);
104 this.atkObject
= atkObject
;
110 // imports for the signal processing
111 private import gobject
.Signals
;
112 private import gdk
.gdktypes
;
113 int[char[]] connectedSignals
;
115 void delegate(gpointer
, ObjectAtk
)[] onActiveDescendantChangedListeners
;
116 void addOnActiveDescendantChanged(void delegate(gpointer
, ObjectAtk
) dlg
)
118 if ( !("active-descendant-changed" in connectedSignals
) )
122 "active-descendant-changed",
123 cast(GCallback
)&callBackActiveDescendantChanged
,
126 cast(ConnectFlags
)0);
127 connectedSignals
["active-descendant-changed"] = 1;
129 onActiveDescendantChangedListeners
~= dlg
;
131 extern(C
) static void callBackActiveDescendantChanged(AtkObject
* atkobjectStruct
, gpointer arg1
, ObjectAtk objectAtk
)
133 bit consumed
= false;
135 foreach ( void delegate(gpointer
, ObjectAtk
) dlg
; objectAtk
.onActiveDescendantChangedListeners
)
137 dlg(arg1
, objectAtk
);
143 void delegate(guint
, gpointer
, ObjectAtk
)[] onChildrenChangedListeners
;
144 void addOnChildrenChanged(void delegate(guint
, gpointer
, ObjectAtk
) dlg
)
146 if ( !("children-changed" in connectedSignals
) )
151 cast(GCallback
)&callBackChildrenChanged
,
154 cast(ConnectFlags
)0);
155 connectedSignals
["children-changed"] = 1;
157 onChildrenChangedListeners
~= dlg
;
159 extern(C
) static void callBackChildrenChanged(AtkObject
* atkobjectStruct
, guint arg1
, gpointer arg2
, ObjectAtk objectAtk
)
161 bit consumed
= false;
163 foreach ( void delegate(guint
, gpointer
, ObjectAtk
) dlg
; objectAtk
.onChildrenChangedListeners
)
165 dlg(arg1
, arg2
, objectAtk
);
171 void delegate(gboolean
, ObjectAtk
)[] onFocusListeners
;
172 void addOnFocus(void delegate(gboolean
, ObjectAtk
) dlg
)
174 if ( !("focus-event" in connectedSignals
) )
179 cast(GCallback
)&callBackFocus
,
182 cast(ConnectFlags
)0);
183 connectedSignals
["focus-event"] = 1;
185 onFocusListeners
~= dlg
;
187 extern(C
) static void callBackFocus(AtkObject
* atkobjectStruct
, gboolean arg1
, ObjectAtk objectAtk
)
189 bit consumed
= false;
191 foreach ( void delegate(gboolean
, ObjectAtk
) dlg
; objectAtk
.onFocusListeners
)
193 dlg(arg1
, objectAtk
);
199 void delegate(gpointer
, ObjectAtk
)[] onPropertyChangeListeners
;
200 void addOnPropertyChange(void delegate(gpointer
, ObjectAtk
) dlg
)
202 if ( !("property-change" in connectedSignals
) )
207 cast(GCallback
)&callBackPropertyChange
,
210 cast(ConnectFlags
)0);
211 connectedSignals
["property-change"] = 1;
213 onPropertyChangeListeners
~= dlg
;
215 extern(C
) static void callBackPropertyChange(AtkObject
* atkobjectStruct
, gpointer arg1
, ObjectAtk objectAtk
)
217 bit consumed
= false;
219 foreach ( void delegate(gpointer
, ObjectAtk
) dlg
; objectAtk
.onPropertyChangeListeners
)
221 dlg(arg1
, objectAtk
);
227 void delegate(char[], gboolean
, ObjectAtk
)[] onStateChangeListeners
;
228 void addOnStateChange(void delegate(char[], gboolean
, ObjectAtk
) dlg
)
230 if ( !("state-change" in connectedSignals
) )
235 cast(GCallback
)&callBackStateChange
,
238 cast(ConnectFlags
)0);
239 connectedSignals
["state-change"] = 1;
241 onStateChangeListeners
~= dlg
;
243 extern(C
) static void callBackStateChange(AtkObject
* atkobjectStruct
, gchar
* arg1
, gboolean arg2
, ObjectAtk objectAtk
)
245 bit consumed
= false;
247 foreach ( void delegate(char[], gboolean
, ObjectAtk
) dlg
; objectAtk
.onStateChangeListeners
)
249 dlg(Str
.toString(arg1
), arg2
, objectAtk
);
255 void delegate(ObjectAtk
)[] onVisibleDataChangedListeners
;
256 void addOnVisibleDataChanged(void delegate(ObjectAtk
) dlg
)
258 if ( !("visible-data-changed" in connectedSignals
) )
262 "visible-data-changed",
263 cast(GCallback
)&callBackVisibleDataChanged
,
266 cast(ConnectFlags
)0);
267 connectedSignals
["visible-data-changed"] = 1;
269 onVisibleDataChangedListeners
~= dlg
;
271 extern(C
) static void callBackVisibleDataChanged(AtkObject
* atkobjectStruct
, ObjectAtk objectAtk
)
273 bit consumed
= false;
275 foreach ( void delegate(ObjectAtk
) dlg
; objectAtk
.onVisibleDataChangedListeners
)
287 * Registers the role specified by name.
289 * a character string describing the new role.
291 * an AtkRole for the new role.
293 public static AtkRole
atkRoleRegister(char[] name
)
295 // AtkRole atk_role_register (const gchar *name);
296 return atk_role_register(Str
.toStringz(name
));
305 * Gets a reference to an object's AtkObject implementation, if
306 * the object implements AtkObjectIface
308 * The GObject instance which should implement AtkImplementorIface
309 * if a non-null return value is required.
311 * a reference to an object's AtkObject implementation
313 public static AtkObject
* atkImplementorRefAccessible(AtkImplementor
* implementor
)
315 // AtkObject* atk_implementor_ref_accessible (AtkImplementor *implementor);
316 return atk_implementor_ref_accessible(implementor
);
320 * Gets the accessible name of the accessible.
324 * a character string representing the accessible name of the object.
326 public char[] getName()
328 // const gchar* atk_object_get_name (AtkObject *accessible);
329 return Str
.toString(atk_object_get_name(atkObject
) );
333 * Gets the accessible description of the accessible.
337 * a character string representing the accessible description
340 public char[] getDescription()
342 // const gchar* atk_object_get_description (AtkObject *accessible);
343 return Str
.toString(atk_object_get_description(atkObject
) );
347 * Gets the accessible parent of the accessible.
351 * a AtkObject representing the accessible parent of the accessible
353 public AtkObject
* getParent()
355 // AtkObject* atk_object_get_parent (AtkObject *accessible);
356 return atk_object_get_parent(atkObject
);
360 * Gets the number of accessible children of the accessible.
364 * an integer representing the number of accessible children
367 public int getNAccessibleChildren()
369 // gint atk_object_get_n_accessible_children (AtkObject *accessible);
370 return atk_object_get_n_accessible_children(atkObject
);
374 * Gets a reference to the specified accessible child of the object.
375 * The accessible children are 0-based so the first accessible child is
376 * at index 0, the second at index 1 and so on.
380 * a gint representing the position of the child, starting from 0
382 * an AtkObject representing the specified accessible child
385 public AtkObject
* refAccessibleChild(int i
)
387 // AtkObject* atk_object_ref_accessible_child (AtkObject *accessible, gint i);
388 return atk_object_ref_accessible_child(atkObject
, i
);
392 * Gets the AtkRelationSet associated with the object.
396 * an AtkRelationSet representing the relation set of the object.
398 public AtkRelationSet
* refRelationSet()
400 // AtkRelationSet* atk_object_ref_relation_set (AtkObject *accessible);
401 return atk_object_ref_relation_set(atkObject
);
406 * atk_object_get_layer is deprecated and should not be used in newly-written code. Use atk_component_get_layer instead.
407 * Gets the layer of the accessible.
412 * an AtkLayer which is the layer of the accessible
414 public AtkLayer
getLayer()
416 // AtkLayer atk_object_get_layer (AtkObject *accessible);
417 return atk_object_get_layer(atkObject
);
422 * atk_object_get_mdi_zorder is deprecated and should not be used in newly-written code. Use atk_component_get_mdi_zorder instead.
423 * Gets the zorder of the accessible. The value G_MININT will be returned
424 * if the layer of the accessible is not ATK_LAYER_MDI.
429 * a gint which is the zorder of the accessible, i.e. the depth at
430 * which the component is shown in relation to other components in the same
433 public int getMdiZorder()
435 // gint atk_object_get_mdi_zorder (AtkObject *accessible);
436 return atk_object_get_mdi_zorder(atkObject
);
440 * Gets the role of the accessible.
444 * an AtkRole which is the role of the accessible
446 public AtkRole
getRole()
448 // AtkRole atk_object_get_role (AtkObject *accessible);
449 return atk_object_get_role(atkObject
);
453 * Gets a reference to the state set of the accessible; the caller must
454 * unreference it when it is no longer needed.
458 * a reference to an AtkStateSet which is the state
459 * set of the accessible
461 public StateSet
refStateSet()
463 // AtkStateSet* atk_object_ref_state_set (AtkObject *accessible);
464 return new StateSet( atk_object_ref_state_set(atkObject
) );
468 * Gets the 0-based index of this accessible in its parent; returns -1 if the
469 * accessible does not have an accessible parent.
473 * an integer which is the index of the accessible in its parent
475 public int getIndexInParent()
477 // gint atk_object_get_index_in_parent (AtkObject *accessible);
478 return atk_object_get_index_in_parent(atkObject
);
482 * Sets the accessible name of the accessible.
486 * a character string to be set as the accessible name
488 public void setName(char[] name
)
490 // void atk_object_set_name (AtkObject *accessible, const gchar *name);
491 atk_object_set_name(atkObject
, Str
.toStringz(name
));
495 * Sets the accessible description of the accessible.
499 * a character string to be set as the accessible description
501 public void setDescription(char[] description
)
503 // void atk_object_set_description (AtkObject *accessible, const gchar *description);
504 atk_object_set_description(atkObject
, Str
.toStringz(description
));
508 * Sets the accessible parent of the accessible.
512 * an AtkObject to be set as the accessible parent
514 public void setParent(AtkObject
* parent
)
516 // void atk_object_set_parent (AtkObject *accessible, AtkObject *parent);
517 atk_object_set_parent(atkObject
, parent
);
521 * Sets the role of the accessible.
525 * an AtkRole to be set as the role
527 public void setRole(AtkRole role
)
529 // void atk_object_set_role (AtkObject *accessible, AtkRole role);
530 atk_object_set_role(atkObject
, role
);
534 * Specifies a function to be called when a property changes value.
538 * a function to be called when a property changes its value
540 * a guint which is the handler id used in
541 * atk_object_remove_property_change_handler()
543 public uint connectPropertyChangeHandler(AtkPropertyChangeHandler
* handler
)
545 // guint atk_object_connect_property_change_handler (AtkObject *accessible, AtkPropertyChangeHandler *handler);
546 return atk_object_connect_property_change_handler(atkObject
, handler
);
550 * Removes a property change handler.
554 * a guint which identifies the handler to be removed.
556 public void removePropertyChangeHandler(uint handlerId
)
558 // void atk_object_remove_property_change_handler (AtkObject *accessible, guint handler_id);
559 atk_object_remove_property_change_handler(atkObject
, handlerId
);
563 * Emits a state-change signal for the specified state.
567 * an AtkState whose state is changed
569 * a gboolean which indicates whether the state is being set on or off
571 public void notifyStateChange(AtkState state
, int value
)
573 // void atk_object_notify_state_change (AtkObject *accessible, AtkState state, gboolean value);
574 atk_object_notify_state_change(atkObject
, state
, value
);
578 * This function is called when implementing subclasses of AtkObject.
579 * It does initialization required for the new object. It is intended
580 * that this function should called only in the ..._new() functions used
581 * to create an instance of a subclass of AtkObject
585 * a gpointer which identifies the object for which the AtkObject was created.
587 public void initialize(void* data
)
589 // void atk_object_initialize (AtkObject *accessible, gpointer data);
590 atk_object_initialize(atkObject
, data
);
594 * Adds a relationship of the specified type with the specified target.
596 * The AtkObject to which an AtkRelation is to be added.
598 * The AtkRelationType of the relation
600 * The AtkObject which is to be the target of the relation.
602 * TRUE if the relationship is added.
604 public int addRelationship(AtkRelationType relationship
, AtkObject
* target
)
606 // gboolean atk_object_add_relationship (AtkObject *object, AtkRelationType relationship, AtkObject *target);
607 return atk_object_add_relationship(atkObject
, relationship
, target
);
611 * Removes a relationship of the specified type with the specified target.
613 * The AtkObject from which an AtkRelation is to be removed.
615 * The AtkRelationType of the relation
617 * The AtkObject which is the target of the relation to be removed.
619 * TRUE if the relationship is removed.
621 public int removeRelationship(AtkRelationType relationship
, AtkObject
* target
)
623 // gboolean atk_object_remove_relationship (AtkObject *object, AtkRelationType relationship, AtkObject *target);
624 return atk_object_remove_relationship(atkObject
, relationship
, target
);
628 * Get a list of properties applied to this object as a whole, as an AtkAttributeSet consisting of
629 * name-value pairs. As such these attributes may be considered weakly-typed properties or annotations,
630 * as distinct from strongly-typed object data available via other get/set methods.
631 * Not all objects have explicit "name-value pair" AtkAttributeSet properties.
636 * an AtkAttributeSet consisting of all explicit properties/annotations applied to
637 * the object, or an empty set if the object has no name-value pair attributes assigned to it.
640 public AtkAttributeSet
* getAttributes()
642 // AtkAttributeSet* atk_object_get_attributes (AtkObject *accessible);
643 return atk_object_get_attributes(atkObject
);
647 * Gets the description string describing the AtkRole role.
649 * The AtkRole whose name is required
651 * the string describing the AtkRole
653 public static char[] atkRoleGetName(AtkRole role
)
655 // const gchar* atk_role_get_name (AtkRole role);
656 return Str
.toString(atk_role_get_name(role
) );
660 * Gets the localized description string describing the AtkRole role.
662 * The AtkRole whose localized name is required
664 * the localized string describing the AtkRole
666 public static char[] atkRoleGetLocalizedName(AtkRole role
)
668 // const gchar* atk_role_get_localized_name (AtkRole role);
669 return Str
.toString(atk_role_get_localized_name(role
) );
673 * Get the AtkRole type corresponding to a rolew name.
675 * a string which is the (non-localized) name of an ATK role.
677 * the AtkRole enumerated type corresponding to the specified
679 * or ATK_ROLE_INVALID if no matching role is found.
681 * The "accessible-component-layer" property
682 * "accessible-component-layer" gint : Read
683 * The accessible layer of this object.
684 * Allowed values: >= 0
687 public static AtkRole
atkRoleForName(char[] name
)
689 // AtkRole atk_role_for_name (const gchar *name);
690 return atk_role_for_name(Str
.toStringz(name
));