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);
71 Accessibility_Selection__get_nSelectedChildren (CSPI_OBJREF (obj),
74 cspi_return_val_if_ev ("getNSelectedChildren", -1);
80 * AccessibleSelection_getSelectedChild:
81 * @obj: a pointer to the #AccessibleSelection on which to operate.
82 * @selectedChildIndex: a #long indicating which of the selected
83 * children is specified.
85 * Get the i-th selected #Accessible child of an #AccessibleSelection.
86 * Note that @childIndex refers to the index in the list of 'selected'
87 * children and generally differs from that used in
88 * #Accessible_getChildAtIndex() or returned by
89 * #Accessible_getIndexInParent(). @selectedChildIndex must lie between 0
90 * and #AccessibleSelection_getNSelectedChildren()-1, inclusive.
92 * Returns: a pointer to a selected #Accessible child object,
93 * specified by @childIndex.
97 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
98 long int selectedChildIndex)
100 Accessibility_Accessible child;
102 cspi_return_val_if_fail (obj != NULL, NULL);
104 child = Accessibility_Selection_getSelectedChild (
106 selectedChildIndex, cspi_ev ());
108 return cspi_object_add (child);
112 * AccessibleSelection_selectChild:
113 * @obj: a pointer to the #AccessibleSelection on which to operate.
114 * @childIndex: a #long indicating which child of the #Accessible
117 * Add a child to the selected children list of an #AccessibleSelection.
118 * For #AccessibleSelection implementors that only allow
119 * single selections, this may replace the (single) current
122 * Returns: #TRUE if the child was successfully selected, #FALSE otherwise.
125 AccessibleSelection_selectChild (AccessibleSelection *obj,
130 cspi_return_val_if_fail (obj != NULL, FALSE);
133 Accessibility_Selection_selectChild (CSPI_OBJREF (obj),
134 childIndex, cspi_ev ());
136 cspi_return_val_if_ev ("selectChild", FALSE);
142 * AccessibleSelection_deselectSelectedChild:
143 * @obj: a pointer to the #AccessibleSelection on which to operate.
144 * @selectedChildIndex: a #long indicating which of the selected children
145 * of the #Accessible is to be selected.
147 * Remove a child to the selected children list of an #AccessibleSelection.
148 * Note that @childIndex is the index in the selected-children list,
149 * not the index in the parent container. @selectedChildIndex in this
150 * method, and @childIndex in #AccessibleSelection_selectChild
153 * Returns: #TRUE if the child was successfully deselected, #FALSE otherwise.
156 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
157 long int selectedChildIndex)
161 cspi_return_val_if_fail (obj != NULL, FALSE);
163 retval = Accessibility_Selection_deselectSelectedChild (
164 CSPI_OBJREF (obj), selectedChildIndex, cspi_ev ());
166 cspi_return_val_if_ev ("deselectSelectedChild", FALSE);
172 * AccessibleSelection_deselectChild:
173 * @obj: a pointer to the #AccessibleSelection on which to operate.
174 * @childIndex: a #long indicating which of the children
175 * of the #Accessible is to be de-selected.
177 * Deselect a specific child of an #AccessibleSelection.
178 * Note that @childIndex is the index of the child
179 * in the parent container.
181 * See #AccessibleSelection_deselectSelectedChild
185 * Returns: #TRUE if the child was successfully deselected, #FALSE otherwise.
188 AccessibleSelection_deselectChild (AccessibleSelection *obj,
193 cspi_return_val_if_fail (obj != NULL, FALSE);
195 retval = Accessibility_Selection_deselectChild (
196 CSPI_OBJREF (obj), childIndex, cspi_ev ());
198 cspi_return_val_if_ev ("deselectChild", FALSE);
204 * AccessibleSelection_isChildSelected:
205 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
206 * @childIndex: an index into the #AccessibleSelection's list of children.
208 * Determine whether a particular child of an #AccessibleSelection implementor
209 * is currently selected. Note that @childIndex is the index into the
210 * standard #Accessible container's list of children.
212 * Returns: #TRUE if the specified child is currently selected,
216 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
221 cspi_return_val_if_fail (obj != NULL, FALSE);
223 retval = Accessibility_Selection_isChildSelected (
225 childIndex, cspi_ev ());
227 cspi_return_val_if_ev ("isChildSelected", FALSE);
233 * AccessibleSelection_selectAll:
234 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
236 * Attempt to select all of the children of an #AccessibleSelection implementor.
237 * Not all #AccessibleSelection implementors support this operation.
239 * Returns: #TRUE if successful, #FALSE otherwise.
243 AccessibleSelection_selectAll (AccessibleSelection *obj)
247 cspi_return_val_if_fail (obj != NULL, FALSE);
249 retval = Accessibility_Selection_selectAll (CSPI_OBJREF (obj), cspi_ev ());
251 cspi_return_val_if_ev ("selectAll", FALSE);
257 * AccessibleSelection_clearSelection:
258 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
260 * Clear the current selection, removing all selected children from the
261 * specified #AccessibleSelection implementor's selection list.
263 * Returns: #TRUE if successful, #FALSE otherwise.
267 AccessibleSelection_clearSelection (AccessibleSelection *obj)
271 cspi_return_val_if_fail (obj != NULL, FALSE);
273 retval = Accessibility_Selection_clearSelection (CSPI_OBJREF (obj), cspi_ev ());
274 cspi_return_val_if_ev ("clearSelection", FALSE);