* cspi/Makefile.am:
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_accessible.c
1
2 /*
3  *
4  * Accessible function prototypes
5  *
6  */
7
8 /**
9  * Accessible_ref:
10  * @obj: a pointer to the #Accessible object on which to operate.
11  *
12  * Increment the reference count for an #Accessible object.
13  *
14  * Returns: (no return code implemented yet).
15  *
16  **/
17 int
18 Accessible_ref (Accessible *obj)
19 {
20   Accessibility_Accessible_ref (*obj, &ev);
21   return 0;
22 }
23
24
25 /**
26  * Accessible_unref:
27  * @obj: a pointer to the #Accessible object on which to operate.
28  *
29  * Decrement the reference count for an #Accessible object.
30  *
31  * Returns: (no return code implemented yet).
32  *
33  **/
34 int
35 Accessible_unref (Accessible *obj)
36 {
37   Accessibility_Accessible_unref (*obj, &ev);
38   return 0;
39 }
40
41 /**
42  * Accessible_getName:
43  * @obj: a pointer to the #Accessible object on which to operate.
44  *
45  * Get the name of an #Accessible object.
46  *
47  * Returns: a UTF-8 string indicating the name of the #Accessible object.
48  *
49  **/
50 char *
51 Accessible_getName (Accessible *obj)
52 {
53   return Accessibility_Accessible__get_name (*obj, &ev);
54 }
55
56 /**
57  * Accessible_getDescription:
58  * @obj: a pointer to the #Accessible object on which to operate.
59  *
60  * Get the description of an #Accessible object.
61  *
62  * Returns: a UTF-8 string describing the #Accessible object.
63  *
64  **/
65 char *
66 Accessible_getDescription (Accessible *obj)
67 {
68   return Accessibility_Accessible__get_description (*obj, &ev);
69 }
70
71 /**
72  * Accessible_getParent:
73  * @obj: a pointer to the #Accessible object to query.
74  *
75  * Get an #Accessible object's parent container.
76  *
77  * Returns: a pointer to the #Accessible object which contains the given
78  *          #Accessible instance, or NULL if the @obj has no parent container.
79  *
80  **/
81 Accessible *
82 Accessible_getParent (Accessible *obj)
83 {
84   return Obj_Add (Accessibility_Accessible__get_parent (*obj, &ev));
85 }
86
87 /**
88  * Accessible_getChildCount:
89  *
90  * @obj: a pointer to the #Accessible object on which to operate.
91  *
92  * Get the number of children contained by an #Accessible object.
93  *
94  * Returns: a #long indicating the number of #Accessible children
95  *          contained by an #Accessible object.
96  *
97  **/
98 long
99 Accessible_getChildCount (Accessible *obj)
100 {
101   return Accessibility_Accessible__get_childCount (*obj, &ev);
102 }
103
104 /**
105  * Accessible_getChildAtIndex:
106  *
107  * @obj: a pointer to the #Accessible object on which to operate.
108  * @childIndex: a #long indicating which child is specified.
109  *
110  * Get the #Accessible child of an #Accessible object at a given index.
111  *
112  * Returns: a pointer to the #Accessible child object at index
113  *          @childIndex.
114  *
115  **/
116 Accessible *
117 Accessible_getChildAtIndex (Accessible *obj,
118                             long childIndex)
119 {
120   return Obj_Add (Accessibility_Accessible_getChildAtIndex (*obj, childIndex, &ev));
121 }
122
123 /**
124  * Accessible_getIndexInParent:
125  *
126  * @obj: a pointer to the #Accessible object on which to operate.
127  *
128  * Get the index of an #Accessible object in its containing #Accessible.
129  *
130  * Returns: a #long indicating the index of the #Accessible object
131  *          in its parent (i.e. containing) #Accessible instance,
132  *          or -1 if @obj has no containing parent.
133  *
134  **/
135 long
136 Accessible_getIndexInParent (Accessible *obj)
137 {
138   return Accessibility_Accessible_getIndexInParent (*obj, &ev);
139 }
140
141 /**
142  * Accessible_getRelationSet:
143  *
144  * Not Yet Implemented.
145  *
146  * Returns: a pointer to an array of #AccessibleRelations.
147  *
148  **/
149 AccessibleRelation **
150 Accessible_getRelationSet (Accessible *obj)
151 {
152   return NULL;
153 }
154
155 /**
156  * Accessible_getRole:
157  * @obj: a pointer to the #Accessible object on which to operate.
158  *
159  * Get the UI role of an #Accessible object.
160  *
161  * Returns: a UTF-8 string indicating the UI role of the #Accessible object.
162  *
163  **/
164 char *
165 Accessible_getRole (Accessible *obj)
166 {
167   return "";
168 }
169
170 /**
171  * Accessible_getStateSet:
172  *
173  * Not Yet Implemented.
174  *
175  * Returns: a pointer to an #AccessibleStateSet representing the object's current state.
176  **/
177 AccessibleStateSet *
178 Accessible_getStateSet (Accessible *obj)
179 {
180   return NULL;
181 }
182
183 /* Interface query methods */
184
185 /**
186  * Accessible_isAction:
187  * @obj: a pointer to the #Accessible instance to query.
188  *
189  * Query whether the specified #Accessible implements #AccessibleAction.
190  * Not Yet Implemented.
191  *
192  * Returns: #TRUE if @obj implements the #AccessibleAction interface,
193  *          #FALSE otherwise.
194  **/
195 boolean
196 Accessible_isAction (Accessible *obj)
197 {
198   Bonobo_Unknown iface =
199     Accessibility_Accessible_queryInterface (*obj,
200                                              "IDL:Accessibility/Action:1.0",
201                                              &ev);
202   return (iface != NULL) ? TRUE : FALSE;
203 }
204
205 /**
206  * Accessible_isComponent:
207  * @obj: a pointer to the #Accessible instance to query.
208  *
209  * Query whether the specified #Accessible implements #AccessibleComponent.
210  *
211  * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
212  *          #FALSE otherwise.
213  **/
214 boolean
215 Accessible_isComponent (Accessible *obj)
216 {
217   Bonobo_Unknown iface =
218     Accessibility_Accessible_queryInterface (*obj,
219                                              "IDL:Accessibility/Component:1.0",
220                                              &ev);
221   return (iface != NULL) ? TRUE : FALSE;
222 }
223
224 /**
225  * Accessible_isEditableText:
226  * @obj: a pointer to the #Accessible instance to query.
227  *
228  * Query whether the specified #Accessible implements #AccessibleEditableText.
229  * Not Yet Implemented.
230  *
231  * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
232  *          #FALSE otherwise.
233  **/
234 boolean
235 Accessible_isEditableText (Accessible *obj)
236 {
237   Bonobo_Unknown iface =
238     Accessibility_Accessible_queryInterface (*obj,
239                                              "IDL:Accessibility/EditableText:1.0",
240                                              &ev);
241   return (iface != NULL) ? TRUE : FALSE;
242 }
243
244 /**
245  * Accessible_isHypertext:
246  * @obj: a pointer to the #Accessible instance to query.
247  *
248  * Query whether the specified #Accessible implements #AccessibleHypertext.
249  * Not Yet Implemented.
250  *
251  * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
252  *          #FALSE otherwise.
253  **/
254 boolean
255 Accessible_isHypertext (Accessible *obj)
256 {
257   Bonobo_Unknown iface =
258     Accessibility_Accessible_queryInterface (*obj,
259                                              "IDL:Accessibility/Hypertext:1.0",
260                                              &ev);
261   return (iface != NULL) ? TRUE : FALSE;
262 }
263
264 /**
265  * Accessible_isImage:
266  * @obj: a pointer to the #Accessible instance to query.
267  *
268  * Query whether the specified #Accessible implements #AccessibleImage.
269  * Not Yet Implemented.
270  *
271  * Returns: #TRUE if @obj implements the #AccessibleImage interface,
272  *          #FALSE otherwise.
273 **/
274 boolean
275 Accessible_isImage (Accessible *obj)
276 {
277   Bonobo_Unknown iface =
278     Accessibility_Accessible_queryInterface (*obj,
279                                              "IDL:Accessibility/Image:1.0",
280                                              &ev);
281   return (iface != NULL) ? TRUE : FALSE;
282 }
283
284 /**
285   * Accessible_isSelection:
286  * @obj: a pointer to the #Accessible instance to query.
287  *
288  * Query whether the specified #Accessible implements #AccessibleSelection.
289  * Not Yet Implemented.
290  *
291  * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
292  *          #FALSE otherwise.
293 **/
294 boolean
295 Accessible_isSelection (Accessible *obj)
296 {
297   Bonobo_Unknown iface =
298     Accessibility_Accessible_queryInterface (*obj,
299                                              "IDL:Accessibility/Selection:1.0",
300                                              &ev);
301   return (iface != NULL) ? TRUE : FALSE;
302 }
303
304 /**
305  * Accessible_isTable:
306  * @obj: a pointer to the #Accessible instance to query.
307  *
308  * Query whether the specified #Accessible implements #AccessibleTable.
309  * Not Yet Implemented.
310  *
311  * Returns: #TRUE if @obj implements the #AccessibleTable interface,
312  *          #FALSE otherwise.
313 **/
314 boolean
315 Accessible_isTable (Accessible *obj)
316 {
317   Bonobo_Unknown iface =
318     Accessibility_Accessible_queryInterface (*obj,
319                                              "IDL:Accessibility/Table:1.0",
320                                              &ev);
321   return (iface != NULL) ? TRUE : FALSE;
322 }
323
324 /**
325  * Accessible_isText:
326  * @obj: a pointer to the #Accessible instance to query.
327  *
328  * Query whether the specified #Accessible implements #AccessibleText.
329  * Not Yet Implemented.
330  *
331  * Returns: #TRUE if @obj implements the #AccessibleText interface,
332  *          #FALSE otherwise.
333 **/
334 boolean
335 Accessible_isText (Accessible *obj)
336 {
337   Bonobo_Unknown iface =
338     Accessibility_Accessible_queryInterface (*obj,
339                                              "IDL:Accessibility/Text:1.0",
340                                              &ev);
341   return (iface != NULL) ? TRUE : FALSE;
342 }
343
344 /**
345  * Accessible_getAction:
346  *
347  * Not Yet Implemented.
348  *
349  **/
350 AccessibleAction *
351 Accessible_getAction (Accessible *obj)
352 {
353   AccessibleComponent iface =
354     Accessibility_Accessible_queryInterface (*obj,
355                                              "IDL:Accessibility/Action:1.0",
356                                              &ev);
357   return Obj_Add (iface);
358 }
359
360 /**
361  * Accessible_getComponent:
362  * @obj: a pointer to the #Accessible instance to query.
363  *
364  * Get the #AccessibleComponent interface for an #Accessible.
365  *
366  * Returns: a pointer to an #AccessibleComponent interface instance, or
367  *          NULL if @obj does not implement #AccessibleComponent.
368  **/
369 AccessibleComponent *
370 Accessible_getComponent (Accessible *obj)
371 {
372   AccessibleComponent iface =
373     Accessibility_Accessible_queryInterface (*obj,
374                                              "IDL:Accessibility/Component:1.0",
375                                              &ev);
376   return Obj_Add (iface);
377 }
378
379 AccessibleEditableText *
380 Accessible_getEditableText (Accessible *obj)
381 {
382   AccessibleComponent iface =
383     Accessibility_Accessible_queryInterface (*obj,
384                                              "IDL:Accessibility/EditableText:1.0",
385                                              &ev);
386   return Obj_Add (iface);
387 }
388
389
390
391 AccessibleHypertext *
392 Accessible_getHypertext (Accessible *obj)
393 {
394   AccessibleComponent iface =
395     Accessibility_Accessible_queryInterface (*obj,
396                                              "IDL:Accessibility/Hypertext:1.0",
397                                              &ev);
398   return Obj_Add (iface);
399 }
400
401
402
403 AccessibleImage *
404 Accessible_getImage (Accessible *obj)
405 {
406   AccessibleComponent iface =
407     Accessibility_Accessible_queryInterface (*obj,
408                                              "IDL:Accessibility/Image:1.0",
409                                              &ev);
410   return Obj_Add (iface);
411 }
412
413
414
415 AccessibleSelection *
416 Accessible_getSelection (Accessible *obj)
417 {
418   AccessibleComponent iface =
419     Accessibility_Accessible_queryInterface (*obj,
420                                              "IDL:Accessibility/Selection:1.0",
421                                              &ev);
422   return Obj_Add (iface);
423 }
424
425
426
427 AccessibleTable *
428 Accessible_getTable (Accessible *obj)
429 {
430   AccessibleComponent iface =
431     Accessibility_Accessible_queryInterface (*obj,
432                                              "IDL:Accessibility/Table:1.0",
433                                              &ev);
434   return Obj_Add (iface);
435 }
436
437
438
439 AccessibleText *
440 Accessible_getText (Accessible *obj)
441 {
442   AccessibleComponent iface =
443     Accessibility_Accessible_queryInterface (*obj,
444                                              "IDL:Accessibility/Text:1.0",
445                                              &ev);
446   return Obj_Add (iface);
447 }
448
449
450
451 AccessibleValue *
452 Accessible_getValue (Accessible *obj)
453 {
454   AccessibleComponent iface =
455     Accessibility_Accessible_queryInterface (*obj,
456                                              "IDL:Accessibility/Value:1.0",
457                                              &ev);
458   return Obj_Add (iface);
459 }
460
461
462
463 /**
464  * Accessible_queryInterface:
465  * @obj: a pointer to the #Accessible instance to query.
466  * @interface_name: a UTF-8 character string specifiying the requested interface.
467  *
468  * Query an #Accessible object to for a named interface.
469  *
470  * Returns: an instance of the named interface object, if it is implemented
471  *          by @obj, or NULL otherwise.
472  *
473  **/
474 GenericInterface *
475 Accessible_queryInterface (Accessible *obj, char *interface_name)
476 {
477   GenericInterface iface;
478   iface = Accessibility_Accessible_queryInterface (*obj,
479                                                     interface_name,
480                                                     &ev);
481   return (iface != NULL) ? Obj_Add (iface) : NULL;
482 }
483