2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001, 2002 Sun Microsystems Inc.,
6 * Copyright 2001, 2002 Ximian, Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #include <cspi/spi-private.h>
27 * AccessibleSelection_ref:
28 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
30 * Increment the reference count for an #AccessibleSelection object.
34 AccessibleSelection_ref (AccessibleSelection *obj)
36 cspi_object_ref (obj);
40 * AccessibleSelection_unref:
41 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
43 * Decrement the reference count for an #Accessible object.
47 AccessibleSelection_unref (AccessibleSelection *obj)
49 cspi_object_unref (obj);
53 * AccessibleSelection_getNSelectedChildren:
54 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
56 * Get the number of children of an #AccessibleSelection implementor which are
59 * Returns: a #long indicating the number of #Accessible children
60 * of the #AccessibleSelection implementor which are currently selected.
64 AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj)
68 cspi_return_val_if_fail (obj != NULL, -1);
70 cspi_dbus_get_property (obj, spi_interface_selection, "nSelectedChildren", NULL, "i", &retval);
72 cspi_return_val_if_ev ("getNSelectedChildren", -1);
78 * AccessibleSelection_getSelectedChild:
79 * @obj: a pointer to the #AccessibleSelection on which to operate.
80 * @selectedChildIndex: a #long indicating which of the selected
81 * children is specified.
83 * Get the i-th selected #Accessible child of an #AccessibleSelection.
84 * Note that @childIndex refers to the index in the list of 'selected'
85 * children and generally differs from that used in
86 * #Accessible_getChildAtIndex() or returned by
87 * #Accessible_getIndexInParent(). @selectedChildIndex must lie between 0
88 * and #AccessibleSelection_getNSelectedChildren()-1, inclusive.
90 * Returns: a pointer to a selected #Accessible child object,
91 * specified by @childIndex.
95 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
96 long int selectedChildIndex)
98 dbus_int32_t d_selectedChildIndex = selectedChildIndex;
102 cspi_return_val_if_fail (obj != NULL, NULL);
104 cspi_dbus_call (obj, spi_interface_selection, "getSelectedChild", NULL, "i=>o", &d_selectedChildIndex, &path);
105 child = cspi_ref_related_accessible (obj, path);
111 * AccessibleSelection_selectChild:
112 * @obj: a pointer to the #AccessibleSelection on which to operate.
113 * @childIndex: a #long indicating which child of the #Accessible
116 * Add a child to the selected children list of an #AccessibleSelection.
117 * For #AccessibleSelection implementors that only allow
118 * single selections, this may replace the (single) current
121 * Returns: #TRUE if the child was successfully selected, #FALSE otherwise.
124 AccessibleSelection_selectChild (AccessibleSelection *obj,
127 dbus_int32_t d_childIndex = childIndex;
130 cspi_return_val_if_fail (obj != NULL, FALSE);
132 cspi_dbus_call (obj, spi_interface_selection, "selectChild", NULL, "i=>b", &d_childIndex, &retval);
134 cspi_return_val_if_ev ("selectChild", FALSE);
140 * AccessibleSelection_deselectSelectedChild:
141 * @obj: a pointer to the #AccessibleSelection on which to operate.
142 * @selectedChildIndex: a #long indicating which of the selected children
143 * of the #Accessible is to be selected.
145 * Remove a child to the selected children list of an #AccessibleSelection.
146 * Note that @childIndex is the index in the selected-children list,
147 * not the index in the parent container. @selectedChildIndex in this
148 * method, and @childIndex in #AccessibleSelection_selectChild
151 * Returns: #TRUE if the child was successfully deselected, #FALSE otherwise.
154 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
155 long int selectedChildIndex)
157 dbus_int32_t d_selectedChildIndex = selectedChildIndex;
160 cspi_return_val_if_fail (obj != NULL, FALSE);
162 cspi_dbus_call (obj, spi_interface_selection, "deselectSelectedChild", NULL, "i=>b", &d_selectedChildIndex, &retval);
164 cspi_return_val_if_ev ("deselectSelectedChild", FALSE);
170 * AccessibleSelection_deselectChild:
171 * @obj: a pointer to the #AccessibleSelection on which to operate.
172 * @childIndex: a #long indicating which of the children
173 * of the #Accessible is to be de-selected.
175 * Deselect a specific child of an #AccessibleSelection.
176 * Note that @childIndex is the index of the child
177 * in the parent container.
179 * See #AccessibleSelection_deselectSelectedChild
183 * Returns: #TRUE if the child was successfully deselected, #FALSE otherwise.
186 AccessibleSelection_deselectChild (AccessibleSelection *obj,
189 dbus_int32_t d_childIndex = childIndex;
192 cspi_return_val_if_fail (obj != NULL, FALSE);
194 cspi_dbus_call (obj, spi_interface_selection, "deselectChild", NULL, "i=>b", &d_childIndex, &retval);
196 cspi_return_val_if_ev ("deselectChild", FALSE);
202 * AccessibleSelection_isChildSelected:
203 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
204 * @childIndex: an index into the #AccessibleSelection's list of children.
206 * Determine whether a particular child of an #AccessibleSelection implementor
207 * is currently selected. Note that @childIndex is the index into the
208 * standard #Accessible container's list of children.
210 * Returns: #TRUE if the specified child is currently selected,
214 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
217 dbus_int32_t d_childIndex = childIndex;
220 cspi_return_val_if_fail (obj != NULL, FALSE);
222 cspi_dbus_call (obj, spi_interface_selection, "isChildSelected", NULL, "i=>b", &d_childIndex, &retval);
224 cspi_return_val_if_ev ("isChildSelected", FALSE);
230 * AccessibleSelection_selectAll:
231 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
233 * Attempt to select all of the children of an #AccessibleSelection implementor.
234 * Not all #AccessibleSelection implementors support this operation.
236 * Returns: #TRUE if successful, #FALSE otherwise.
240 AccessibleSelection_selectAll (AccessibleSelection *obj)
244 cspi_return_val_if_fail (obj != NULL, FALSE);
246 cspi_dbus_call (obj, spi_interface_selection, "selectAll", NULL, "=>b", &retval);
248 cspi_return_val_if_ev ("selectAll", FALSE);
254 * AccessibleSelection_clearSelection:
255 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
257 * Clear the current selection, removing all selected children from the
258 * specified #AccessibleSelection implementor's selection list.
260 * Returns: #TRUE if successful, #FALSE otherwise.
264 AccessibleSelection_clearSelection (AccessibleSelection *obj)
268 cspi_return_val_if_fail (obj != NULL, FALSE);
270 cspi_dbus_call (obj, spi_interface_selection, "clearSelection", NULL, "=>b", &retval);