Renamed SpiAccessibleEventListener to (just) SpiEventListener.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_selection.c
1 /**
2  * AccessibleSelection_ref:
3  * @obj: a pointer to the #AccessibleSelecion implementor on which to operate.
4  *
5  * Increment the reference count for an #AccessibleSelection object.
6  *
7  * Returns: (no return code implemented yet).
8  *
9  **/
10 int
11 AccessibleSelection_ref (AccessibleSelection *obj)
12 {
13   Accessibility_Selection_ref (*obj, &ev);
14   return 0;
15 }
16
17
18 /**
19  * AccessibleSelection_unref:
20  * @obj: a pointer to the #AccessibleSelection implementor on which to operate. 
21  *
22  * Decrement the reference count for an #Accessible object.
23  *
24  * Returns: (no return code implemented yet).
25  *
26  **/
27 int
28 AccessibleSelection_unref (AccessibleSelection *obj)
29 {
30   Accessibility_Selection_unref (*obj, &ev);
31   return 0;
32 }
33
34
35
36 /**
37  * AccessibleSelection_getNSelectedChildren:
38  * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
39  *
40  * Get the number of children of an #AccessibleSelection implementor which are
41  *        currently selected.
42  *
43  * Returns: a #long indicating the number of #Accessible children
44  *        of the #AccessibleSelection implementor which are currently selected.
45  *
46  **/
47 long
48 AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj)
49 {
50   return (long)
51     Accessibility_Selection__get_nSelectedChildren (*obj, &ev);
52 }
53
54
55 /**
56  * AccessibleSelection_getSelectedChild:
57  * @obj: a pointer to the #AccessibleSelection on which to operate.
58  * @selectedChildIndex: a #long indicating which of the selected
59  *      children is specified.
60  *
61  * Get the i-th selected #Accessible child of an #AccessibleSelection.
62  *      Note that @childIndex refers to the index in the list of 'selected'
63  *      children and generally differs from that used in
64  *      #Accessible_getChildAtIndex() or returned by
65  *      #Accessible_getIndexInParent(). @selectedChildIndex must lie between 0
66  *      and #AccessibleSelection_getNSelectedChildren()-1, inclusive.
67  *
68  * Returns: a pointer to a selected #Accessible child object,
69  *          specified by @childIndex.
70  *
71  **/
72 Accessible *
73 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
74                                       long int selectedChildIndex)
75 {
76   Accessibility_Accessible child = 
77     Accessibility_Selection_getSelectedChild (*obj,
78                                               (CORBA_long) selectedChildIndex, &ev);
79   spi_warn_ev (&ev, "getSelectedChild");
80
81   return (Accessible *) ((CORBA_Object_is_nil (child, &ev)) ? NULL : Obj_Add (child));
82 }
83
84 /**
85  * AccessibleSelection_selectChild:
86  * @obj: a pointer to the #AccessibleSelection on which to operate.
87  * @childIndex: a #long indicating which child of the #Accessible
88  *              is to be selected.
89  *
90  * Add a child to the selected children list of an #AccessibleSelection.
91  *         For #AccessibleSelection implementors that only allow
92  *         single selections, this may replace the (single) current
93  *         selection.
94  *
95  * Returns: #TRUE if the child was successfully selected, #FALSE otherwise.
96  *
97  **/
98 boolean
99 AccessibleSelection_selectChild (AccessibleSelection *obj,
100                                  long int childIndex)
101 {
102   return (boolean)
103     Accessibility_Selection_selectChild (*obj,
104                                          (CORBA_long) childIndex, &ev);
105 }
106
107
108 /**
109  * AccessibleSelection_deselectSelectedChild:
110  * @obj: a pointer to the #AccessibleSelection on which to operate.
111  * @selectedChildIndex: a #long indicating which of the selected children
112  *              of the #Accessible is to be selected.
113  *
114  * Remove a child to the selected children list of an #AccessibleSelection.
115  *          Note that @childIndex is the index in the selected-children list,
116  *          not the index in the parent container.  @selectedChildIndex in this
117  *          method, and @childIndex in #AccessibleSelection_selectChild
118  *          are asymmettric.
119  *
120  * Returns: #TRUE if the child was successfully deselected, #FALSE otherwise.
121  *
122  **/
123 boolean
124 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
125                                            long int selectedChildIndex)
126 {
127   Accessibility_Selection_deselectSelectedChild (*obj,
128                                                  (CORBA_long) selectedChildIndex, &ev);
129 }
130
131
132
133 /**
134  * AccessibleSelection_isChildSelected:
135  * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
136  * @childIndex: an index into the #AccessibleSelection's list of children.
137  *
138  * Determine whether a particular child of an #AccessibleSelection implementor
139  *        is currently selected.  Note that @childIndex is the index into the
140  *        standard #Accessible container's list of children.
141  *
142  * Returns: #TRUE if the specified child is currently selected,
143  *          #FALSE otherwise.
144  *
145  **/
146 boolean
147 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
148                                      long int childIndex)
149 {
150   return (boolean)
151     Accessibility_Selection_isChildSelected (*obj,
152                                              (CORBA_long) childIndex, &ev);
153 }
154
155
156
157 /**
158  * AccessibleSelection_selectAll:
159  * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
160  *
161  * Attempt to select all of the children of an #AccessibleSelection implementor.
162  * Not all #AccessibleSelection implementors support this operation.
163  *
164  * Returns: #TRUE if successful, #FALSE otherwise.
165  *
166  **/
167 boolean
168 AccessibleSelection_selectAll (AccessibleSelection *obj)
169 {
170   Accessibility_Selection_selectAll (*obj, &ev);
171   return TRUE; /* TODO: change the bonobo method to return boolean */
172 }
173
174
175
176 /**
177  * AccessibleSelection_clearSelection:
178  * @obj: a pointer to the #AccessibleSelection implementor on which to operate.
179  *
180  * Clear the current selection, removing all selected children from the
181  *       specified #AccessibleSelection implementor's selection list.
182  *
183  **/
184 void
185 AccessibleSelection_clearSelection (AccessibleSelection *obj)
186 {
187   Accessibility_Selection_clearSelection (*obj, &ev);
188 }
189
190