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