2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #include <cspi/spi-private.h>
26 * AccessibleSelection_ref:
27 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
29 * Increment the reference count for an #AccessibleSelection object.
33 AccessibleSelection_ref (AccessibleSelection *obj)
35 cspi_object_ref (obj);
39 * AccessibleSelection_unref:
40 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
42 * Decrement the reference count for an #Accessible object.
46 AccessibleSelection_unref (AccessibleSelection *obj)
48 cspi_object_unref (obj);
52 * AccessibleSelection_getNSelectedChildren:
53 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
55 * Get the number of children of an #AccessibleSelection implementor which are
58 * Returns: a #long indicating the number of #Accessible children
59 * of the #AccessibleSelection implementor which are currently selected.
63 AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj)
67 cspi_return_val_if_fail (obj != NULL, -1);
70 Accessibility_Selection__get_nSelectedChildren (CSPI_OBJREF (obj),
73 cspi_return_val_if_ev ("getNSelectedChildren", -1);
79 * AccessibleSelection_getSelectedChild:
80 * @obj: a pointer to the #AccessibleSelection on which to operate.
81 * @selectedChildIndex: a #long indicating which of the selected
82 * children is specified.
84 * Get the i-th selected #Accessible child of an #AccessibleSelection.
85 * Note that @childIndex refers to the index in the list of 'selected'
86 * children and generally differs from that used in
87 * #Accessible_getChildAtIndex() or returned by
88 * #Accessible_getIndexInParent(). @selectedChildIndex must lie between 0
89 * and #AccessibleSelection_getNSelectedChildren()-1, inclusive.
91 * Returns: a pointer to a selected #Accessible child object,
92 * specified by @childIndex.
96 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
97 long int selectedChildIndex)
99 Accessibility_Accessible child;
101 cspi_return_val_if_fail (obj != NULL, NULL);
103 child = Accessibility_Selection_getSelectedChild (
105 (CORBA_long) selectedChildIndex, cspi_ev ());
107 return (Accessible *) cspi_object_add (child);
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,
129 cspi_return_val_if_fail (obj != NULL, FALSE);
132 Accessibility_Selection_selectChild (CSPI_OBJREF (obj),
133 (CORBA_long) childIndex, cspi_ev ());
135 cspi_return_val_if_ev ("selectChild", FALSE);
141 * AccessibleSelection_deselectSelectedChild:
142 * @obj: a pointer to the #AccessibleSelection on which to operate.
143 * @selectedChildIndex: a #long indicating which of the selected children
144 * of the #Accessible is to be selected.
146 * Remove a child to the selected children list of an #AccessibleSelection.
147 * Note that @childIndex is the index in the selected-children list,
148 * not the index in the parent container. @selectedChildIndex in this
149 * method, and @childIndex in #AccessibleSelection_selectChild
152 * Returns: #TRUE if the child was successfully deselected, #FALSE otherwise.
155 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
156 long int selectedChildIndex)
160 cspi_return_val_if_fail (obj != NULL, FALSE);
162 retval = Accessibility_Selection_deselectSelectedChild (
163 CSPI_OBJREF (obj), (CORBA_long) selectedChildIndex, cspi_ev ());
165 cspi_return_val_if_ev ("deselectSelectedChild", FALSE);
171 * AccessibleSelection_isChildSelected:
172 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
173 * @childIndex: an index into the #AccessibleSelection's list of children.
175 * Determine whether a particular child of an #AccessibleSelection implementor
176 * is currently selected. Note that @childIndex is the index into the
177 * standard #Accessible container's list of children.
179 * Returns: #TRUE if the specified child is currently selected,
183 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
188 cspi_return_val_if_fail (obj != NULL, FALSE);
190 retval = Accessibility_Selection_isChildSelected (
192 (CORBA_long) childIndex, cspi_ev ());
194 cspi_return_val_if_ev ("isChildSelected", FALSE);
196 return (SPIBoolean) retval;
200 * AccessibleSelection_selectAll:
201 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
203 * Attempt to select all of the children of an #AccessibleSelection implementor.
204 * Not all #AccessibleSelection implementors support this operation.
206 * Returns: #TRUE if successful, #FALSE otherwise.
210 AccessibleSelection_selectAll (AccessibleSelection *obj)
214 cspi_return_val_if_fail (obj != NULL, FALSE);
216 retval = Accessibility_Selection_selectAll (CSPI_OBJREF (obj), cspi_ev ());
218 cspi_return_val_if_ev ("selectAll", FALSE);
224 * AccessibleSelection_clearSelection:
225 * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
227 * Clear the current selection, removing all selected children from the
228 * specified #AccessibleSelection implementor's selection list.
230 * Returns: #TRUE if successful, #FALSE otherwise.
234 AccessibleSelection_clearSelection (AccessibleSelection *obj)
238 cspi_return_val_if_fail (obj != NULL, FALSE);
240 retval = Accessibility_Selection_clearSelection (CSPI_OBJREF (obj), cspi_ev ());
241 cspi_return_val_if_ev ("clearSelection", FALSE);