6f5ff36c3eb27a5e97923c2621b04b1388c8252b
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_accessible.c
1 #include <stdlib.h> /* for malloc */
2 #include <cspi/spi-private.h>
3
4 static const char *role_names [] =
5 {
6   "<invalid>",
7   "accelerator label",
8   "alert",
9   "animation",
10   "arrow",
11   "calendar",
12   "canvas",
13   "check box",
14   "color chooser",
15   "column header",
16   "combo box",
17   "date editor",
18   "desktop icon",
19   "desktop frame",
20   "dialog",
21   "directory pane",
22   "file chooser",
23   "filler",
24   "focus traversable",
25   "font chooser",
26   "frame",
27   "glass pane",
28   "HTML container",
29   "icon",
30   "image",
31   "internal frame",
32   "label",
33   "layered pane",
34   "list",
35   "list item",
36   "menu",
37   "menubar",
38   "menu item",
39   "option pane",
40   "page tab",
41   "page tab list",
42   "panel",
43   "password text",
44   "popup menu",
45   "progress bar",
46   "pushbutton",
47   "radiobutton",
48   "radio menu item",
49   "root pane",
50   "row header",
51   "scrollbar",
52   "scrollpane",
53   "separator",
54   "slider",
55   "spin button",
56   "split pane",
57   "status bar",
58   "table",
59   "table cell",
60   "table column header",
61   "table row header",
62   "tearoff menu item",
63   "text",
64   "toggle button",
65   "toolbar",
66   "tooltip",
67   "tree",
68   "<unknown>",
69   "viewport",
70   "window",
71
72 };
73
74 #define MAX_ROLES (sizeof (role_names) / sizeof (char *))
75
76 static AccessibleRole
77 cspi_role_from_spi_role (Accessibility_Role role)
78 {
79   return role; /* FIXME: need to compare, equivalence not guaranteed */
80 }
81
82 /**
83  * AccessibleRole_getName:
84  * @role: an #AccessibleRole object to query.
85  *
86  * Get a localizeable string that indicates the name of an #AccessibleRole.
87  * Currently broken, do not use.
88  *
89  * Returns: a localizable string name for an #AccessibleRole enumerated type.
90  **/
91 char *
92 AccessibleRole_getName (AccessibleRole role)
93 {
94   if (role < MAX_ROLES)
95     {
96       return g_strdup (role_names [(int) role]);
97     }
98   else
99     {
100       return g_strdup ("");
101     }
102 }
103
104 /**
105  * Accessible_ref:
106  * @obj: a pointer to the #Accessible object on which to operate.
107  *
108  * Increment the reference count for an #Accessible object.
109  **/
110 void
111 Accessible_ref (Accessible *obj)
112 {
113   cspi_object_ref (obj);
114 }
115
116 /**
117  * Accessible_unref:
118  * @obj: a pointer to the #Accessible object on which to operate.
119  *
120  * Decrement the reference count for an #Accessible object.
121  **/
122 void
123 Accessible_unref (Accessible *obj)
124 {
125   cspi_object_unref (obj);
126 }
127
128 /**
129  * Accessible_getName:
130  * @obj: a pointer to the #Accessible object on which to operate.
131  *
132  * Get the name of an #Accessible object.
133  *
134  * Returns: a UTF-8 string indicating the name of the #Accessible object.
135  * or NULL on exception
136  **/
137 char *
138 Accessible_getName (Accessible *obj)
139 {
140   char *retval;
141
142   cspi_return_val_if_fail (obj != NULL, NULL);
143
144   retval = (char *)
145     Accessibility_Accessible__get_name (CSPI_OBJREF (obj), cspi_ev ());
146
147   cspi_return_val_if_ev ("getName", NULL); 
148
149   return retval;
150 }
151
152 /**
153  * Accessible_getDescription:
154  * @obj: a pointer to the #Accessible object on which to operate.
155  *
156  * Get the description of an #Accessible object.
157  *
158  * Returns: a UTF-8 string describing the #Accessible object.
159  * or NULL on exception
160  **/
161 char *
162 Accessible_getDescription (Accessible *obj)
163 {
164   char *retval;
165
166   cspi_return_val_if_fail (obj != NULL, NULL);
167
168   retval = (char *)
169     Accessibility_Accessible__get_description (CSPI_OBJREF (obj),
170                                                cspi_ev ());
171
172   cspi_return_val_if_ev ("getDescription", NULL); 
173
174   return retval;
175 }
176
177 /**
178  * Accessible_getParent:
179  * @obj: a pointer to the #Accessible object to query.
180  *
181  * Get an #Accessible object's parent container.
182  *
183  * Returns: a pointer tothe #Accessible object which contains the given
184  *          #Accessible instance, or NULL if the @obj has no parent container.
185  *
186  **/
187 Accessible *
188 Accessible_getParent (Accessible *obj)
189 {
190   Accessible *retval;
191
192   cspi_return_val_if_fail (obj != NULL, NULL);
193
194   retval = cspi_object_add (
195     Accessibility_Accessible__get_parent (CSPI_OBJREF (obj),
196                                           cspi_ev ()));
197
198   cspi_return_val_if_ev ("getParent", NULL); 
199
200   return retval;
201 }
202
203 /**
204  * Accessible_getChildCount:
205  * @obj: a pointer to the #Accessible object on which to operate.
206  *
207  * Get the number of children contained by an #Accessible object.
208  *
209  * Returns: a #long indicating the number of #Accessible children
210  *          contained by an #Accessible object. or -1 on exception
211  *
212  **/
213 long
214 Accessible_getChildCount (Accessible *obj)
215 {
216   long retval;
217
218   cspi_return_val_if_fail (obj != NULL, -1);
219
220   retval = (long) 
221     Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj),
222                                               cspi_ev ());
223
224   cspi_return_val_if_ev ("getChildCount", -1); 
225
226   return retval;
227 }
228
229 /**
230  * Accessible_getChildAtIndex:
231  * @obj: a pointer to the #Accessible object on which to operate.
232  * @childIndex: a #long indicating which child is specified.
233  *
234  * Get the #Accessible child of an #Accessible object at a given index.
235  *
236  * Returns: a pointer to the #Accessible child object at index
237  *          @childIndex. or NULL on exception
238  **/
239 Accessible *
240 Accessible_getChildAtIndex (Accessible *obj,
241                             long int    childIndex)
242 {
243   Accessible *retval;
244
245   cspi_return_val_if_fail (obj != NULL, NULL);
246
247   retval = cspi_object_add (
248     Accessibility_Accessible_getChildAtIndex (CSPI_OBJREF (obj),
249                                               childIndex, cspi_ev ()));
250
251   return retval;
252 }
253
254 /**
255  * Accessible_getIndexInParent:
256  * @obj: a pointer to the #Accessible object on which to operate.
257  *
258  * Get the index of an #Accessible object in its containing #Accessible.
259  *
260  * Returns: a #long indicating the index of the #Accessible object
261  *          in its parent (i.e. containing) #Accessible instance,
262  *          or -1 if @obj has no containing parent or on exception.
263  **/
264 long
265 Accessible_getIndexInParent (Accessible *obj)
266 {
267   long retval;
268
269   cspi_return_val_if_fail (obj != NULL, -1);
270
271   retval = (long)
272     Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
273
274   cspi_return_val_if_ev ("getIndexInparent", -1); 
275   return retval;
276 }
277
278 /**
279  * Accessible_getRelationSet:
280  * @obj: a pointer to the #Accessible object on which to operate.
281  *
282  * Get the set of #AccessibleRelation objects which describe this #Accessible object's
283  *       relationships with other #Accessible objects.
284  *
285  * Returns: an array of #AccessibleRelation pointers. or NULL on exception
286  **/
287 AccessibleRelation **
288 Accessible_getRelationSet (Accessible *obj)
289 {
290   int i;
291   int n_relations;
292   AccessibleRelation **relations;
293   Accessibility_RelationSet *relation_set;
294
295   cspi_return_val_if_fail (obj != NULL, NULL);
296
297   relation_set =
298     Accessibility_Accessible_getRelationSet (CSPI_OBJREF (obj), cspi_ev ());
299
300   cspi_return_val_if_ev ("getRelationSet", NULL); 
301   
302   /* this looks hack-ish, but it's based on the CORBA C bindings spec */
303   n_relations = relation_set->_length;
304   relations = malloc (sizeof (AccessibleRelation *) * n_relations);
305   
306   for (i = 0; i < n_relations; ++i)
307     {
308       relations[i] = cspi_object_add (CORBA_Object_duplicate (
309               relation_set->_buffer[i], cspi_ev ()));
310     }
311   relations[i] = CORBA_OBJECT_NIL;
312
313   CORBA_free (relation_set);
314
315   return relations;
316 }
317
318 /**
319  * Accessible_getRole:
320  * @obj: a pointer to the #Accessible object on which to operate.
321  *
322  * Get the UI role of an #Accessible object.
323  * A UTF-8 string describing this role can be obtained via Accessible_getRoleName ().
324  *
325  * Returns: the #AccessibleRole of the object.
326  *
327  **/
328 AccessibleRole
329 Accessible_getRole (Accessible *obj)
330 {
331   AccessibleRole retval;
332
333   cspi_return_val_if_fail (obj != NULL, SPI_ROLE_INVALID);
334
335   retval = 
336     Accessibility_Accessible_getRole (CSPI_OBJREF (obj), cspi_ev ());
337
338   cspi_return_val_if_ev ("getRole", SPI_ROLE_INVALID); 
339
340   return cspi_role_from_spi_role (retval);
341 }
342
343 /**
344  * Accessible_getRoleName:
345  * @obj: a pointer to the #Accessible object on which to operate.
346  *
347  * Get a UTF-8 string describing the role this object plays in the UI.
348  * This method will return useful values for roles that fall outside the
349  * enumeration used in Accessible_getRole ().
350  *
351  * Returns: a UTF-8 string specifying the role of this #Accessible object.
352  *
353  **/
354 char *
355 Accessible_getRoleName (Accessible *obj)
356 {
357   char *retval;
358
359   cspi_return_val_if_fail (obj != NULL, CORBA_string_dup ("invalid"));
360
361   retval = 
362     Accessibility_Accessible_getRoleName (CSPI_OBJREF (obj), cspi_ev ());
363
364   cspi_return_val_if_ev ("getRoleName", CORBA_string_dup ("invalid")); 
365
366   return retval;
367 }
368
369 /**
370  * Accessible_getStateSet:
371  * @obj: a pointer to the #Accessible object on which to operate.
372  *
373  * Not Yet Implemented.
374  *
375  * Returns: a pointer to an #AccessibleStateSet representing the object's current state.
376  **/
377 AccessibleStateSet *
378 Accessible_getStateSet (Accessible *obj)
379 {
380   return NULL;
381 }
382
383 /* Interface query methods */
384
385 /**
386  * Accessible_isAction:
387  * @obj: a pointer to the #Accessible instance to query.
388  *
389  * Query whether the specified #Accessible implements #AccessibleAction.
390  *
391  * Returns: #TRUE if @obj implements the #AccessibleAction interface,
392  *          #FALSE otherwise.
393  **/
394 SPIBoolean
395 Accessible_isAction (Accessible *obj)
396 {
397   return cspi_accessible_is_a (obj,
398                               "IDL:Accessibility/Action:1.0");
399 }
400
401 /**
402  * Accessible_isApplication:
403  * @obj: a pointer to the #Accessible instance to query.
404  *
405  * Query whether the specified #Accessible implements #AccessibleApplication.
406  *
407  * Returns: #TRUE if @obj implements the #AccessibleApplication interface,
408  *          #FALSE otherwise.
409  **/
410 SPIBoolean
411 Accessible_isApplication (Accessible *obj)
412 {
413   return cspi_accessible_is_a (obj,
414                               "IDL:Accessibility/Application:1.0");
415 }
416
417 /**
418  * Accessible_isComponent:
419  * @obj: a pointer to the #Accessible instance to query.
420  *
421  * Query whether the specified #Accessible implements #AccessibleComponent.
422  *
423  * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
424  *          #FALSE otherwise.
425  **/
426 SPIBoolean
427 Accessible_isComponent (Accessible *obj)
428 {
429   return cspi_accessible_is_a (obj,
430                               "IDL:Accessibility/Component:1.0");
431 }
432
433 /**
434  * Accessible_isEditableText:
435  * @obj: a pointer to the #Accessible instance to query.
436  *
437  * Query whether the specified #Accessible implements #AccessibleEditableText.
438  *
439  * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
440  *          #FALSE otherwise.
441  **/
442 SPIBoolean
443 Accessible_isEditableText (Accessible *obj)
444 {
445   return cspi_accessible_is_a (obj,
446                               "IDL:Accessibility/EditableText:1.0");
447 }
448
449 /**
450  * Accessible_isHypertext:
451  * @obj: a pointer to the #Accessible instance to query.
452  *
453  * Query whether the specified #Accessible implements #AccessibleHypertext.
454  *
455  * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
456  *          #FALSE otherwise.
457  **/
458 SPIBoolean
459 Accessible_isHypertext (Accessible *obj)
460 {
461   return cspi_accessible_is_a (obj,
462                               "IDL:Accessibility/Hypertext:1.0");
463 }
464
465 /**
466  * Accessible_isImage:
467  * @obj: a pointer to the #Accessible instance to query.
468  *
469  * Query whether the specified #Accessible implements #AccessibleImage.
470  *
471  * Returns: #TRUE if @obj implements the #AccessibleImage interface,
472  *          #FALSE otherwise.
473 **/
474 SPIBoolean
475 Accessible_isImage (Accessible *obj)
476 {
477   return cspi_accessible_is_a (obj,
478                               "IDL:Accessibility/Image:1.0");
479 }
480
481 /**
482  * Accessible_isSelection:
483  * @obj: a pointer to the #Accessible instance to query.
484  *
485  * Query whether the specified #Accessible implements #AccessibleSelection.
486  *
487  * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
488  *          #FALSE otherwise.
489 **/
490 SPIBoolean
491 Accessible_isSelection (Accessible *obj)
492 {
493   return cspi_accessible_is_a (obj,
494                               "IDL:Accessibility/Selection:1.0");
495 }
496
497 /**
498  * Accessible_isTable:
499  * @obj: a pointer to the #Accessible instance to query.
500  *
501  * Query whether the specified #Accessible implements #AccessibleTable.
502  *
503  * Returns: #TRUE if @obj implements the #AccessibleTable interface,
504  *          #FALSE otherwise.
505 **/
506 SPIBoolean
507 Accessible_isTable (Accessible *obj)
508 {
509   return cspi_accessible_is_a (obj,
510                               "IDL:Accessibility/Table:1.0");
511 }
512
513 /**
514  * Accessible_isText:
515  * @obj: a pointer to the #Accessible instance to query.
516  *
517  * Query whether the specified #Accessible implements #AccessibleText.
518  *
519  * Returns: #TRUE if @obj implements the #AccessibleText interface,
520  *          #FALSE otherwise.
521 **/
522 SPIBoolean
523 Accessible_isText (Accessible *obj)
524 {
525   return cspi_accessible_is_a (obj,
526                               "IDL:Accessibility/Text:1.0");
527 }
528
529 /**
530  * Accessible_isValue:
531  * @obj: a pointer to the #Accessible instance to query.
532  *
533  * Query whether the specified #Accessible implements #AccessibleValue.
534  *
535  * Returns: #TRUE if @obj implements the #AccessibleValue interface,
536  *          #FALSE otherwise.
537 **/
538 SPIBoolean
539 Accessible_isValue (Accessible *obj)
540 {
541   return cspi_accessible_is_a (obj,
542                               "IDL:Accessibility/Value:1.0");
543 }
544
545 /**
546  * Accessible_getApplication:
547  * @obj: a pointer to the #Accessible instance to query.
548  *
549  * Get the #AccessibleApplication interface for an #Accessible.
550  *
551  * Returns: a pointer to an #AccessibleApplication interface instance, or
552  *          NULL if @obj does not implement #AccessibleApplication.
553  **/
554 AccessibleApplication *
555 Accessible_getApplication (Accessible *obj)
556 {
557   return (AccessibleApplication *) Accessible_queryInterface (
558           obj, "IDL:Accessibility/Application:1.0");
559 }
560
561 /**
562  * Accessible_getAction:
563  * @obj: a pointer to the #Accessible instance to query.
564  *
565  * Get the #AccessibleAction interface for an #Accessible.
566  *
567  * Returns: a pointer to an #AccessibleAction interface instance, or
568  *          NULL if @obj does not implement #AccessibleAction.
569  **/
570 AccessibleAction *
571 Accessible_getAction (Accessible *obj)
572 {
573   return (AccessibleAction *) Accessible_queryInterface (
574           obj, "IDL:Accessibility/Action:1.0");
575 }
576
577 /**
578  * Accessible_getComponent:
579  * @obj: a pointer to the #Accessible instance to query.
580  *
581  * Get the #AccessibleComponent interface for an #Accessible.
582  *
583  * Returns: a pointer to an #AccessibleComponent interface instance, or
584  *          NULL if @obj does not implement #AccessibleComponent.
585  **/
586 AccessibleComponent *
587 Accessible_getComponent (Accessible *obj)
588 {
589   return (AccessibleComponent *) Accessible_queryInterface (
590           obj, "IDL:Accessibility/Component:1.0");
591 }
592
593 /**
594  * Accessible_getEditableText:
595  * @obj: a pointer to the #Accessible instance to query.
596  *
597  * Get the #AccessibleEditableText interface for an #Accessible.
598  *
599  * Returns: a pointer to an #AccessibleEditableText interface instance, or
600  *          NULL if @obj does not implement #AccessibleEditableText.
601  **/
602 AccessibleEditableText *
603 Accessible_getEditableText (Accessible *obj)
604 {
605   return (AccessibleEditableText *) Accessible_queryInterface (
606           obj, "IDL:Accessibility/EditableText:1.0");
607 }
608
609
610
611 /**
612  * Accessible_getHypertext:
613  * @obj: a pointer to the #Accessible instance to query.
614  *
615  * Get the #AccessibleHypertext interface for an #Accessible.
616  *
617  * Returns: a pointer to an #AccessibleHypertext interface instance, or
618  *          NULL if @obj does not implement #AccessibleHypertext.
619  **/
620 AccessibleHypertext *
621 Accessible_getHypertext (Accessible *obj)
622 {
623   return (AccessibleHypertext *) Accessible_queryInterface (
624           obj, "IDL:Accessibility/Hypertext:1.0");
625 }
626
627
628
629 /**
630  * Accessible_getImage:
631  * @obj: a pointer to the #Accessible instance to query.
632  *
633  * Get the #AccessibleImage interface for an #Accessible.
634  *
635  * Returns: a pointer to an #AccessibleImage interface instance, or
636  *          NULL if @obj does not implement #AccessibleImage.
637  **/
638 AccessibleImage *
639 Accessible_getImage (Accessible *obj)
640 {
641   return (AccessibleImage *) Accessible_queryInterface (
642           obj, "IDL:Accessibility/Image:1.0");
643 }
644
645
646
647 /**
648  * Accessible_getSelection:
649  * @obj: a pointer to the #Accessible instance to query.
650  *
651  * Get the #AccessibleSelection interface for an #Accessible.
652  *
653  * Returns: a pointer to an #AccessibleSelection interface instance, or
654  *          NULL if @obj does not implement #AccessibleSelection.
655  **/
656 AccessibleSelection *
657 Accessible_getSelection (Accessible *obj)
658 {
659   return (AccessibleSelection *) Accessible_queryInterface (
660           obj, "IDL:Accessibility/Selection:1.0");
661 }
662
663
664
665 /**
666  * Accessible_getTable:
667  * @obj: a pointer to the #Accessible instance to query.
668  *
669  * Get the #AccessibleTable interface for an #Accessible.
670  *
671  * Returns: a pointer to an #AccessibleTable interface instance, or
672  *          NULL if @obj does not implement #AccessibleTable.
673  **/
674 AccessibleTable *
675 Accessible_getTable (Accessible *obj)
676 {
677   return (AccessibleTable *) Accessible_queryInterface (
678           obj, "IDL:Accessibility/Table:1.0");
679 }
680
681 /**
682  * Accessible_getText:
683  * @obj: a pointer to the #Accessible instance to query.
684  *
685  * Get the #AccessibleText interface for an #Accessible.
686  *
687  * Returns: a pointer to an #AccessibleText interface instance, or
688  *          NULL if @obj does not implement #AccessibleText.
689  **/
690 AccessibleText *
691 Accessible_getText (Accessible *obj)
692 {
693   return (AccessibleText *) Accessible_queryInterface (
694           obj, "IDL:Accessibility/Text:1.0");
695 }
696
697
698
699 /**
700  * Accessible_getValue:
701  * @obj: a pointer to the #Accessible instance to query.
702  *
703  * Get the #AccessibleValue interface for an #Accessible.
704  *
705  * Returns: a pointer to an #AccessibleValue interface instance, or
706  *          NULL if @obj does not implement #AccessibleValue.
707  **/
708 AccessibleValue *
709 Accessible_getValue (Accessible *obj)
710 {
711   return (AccessibleValue *) Accessible_queryInterface (
712           obj, "IDL:Accessibility/Value:1.0");
713 }
714
715
716
717 /**
718  * Accessible_queryInterface:
719  * @obj: a pointer to the #Accessible instance to query.
720  * @interface_name: a UTF-8 character string specifiying the requested interface.
721  *
722  * Query an #Accessible object to for a named interface.
723  *
724  * Returns: an instance of the named interface object, if it is implemented
725  *          by @obj, or NULL otherwise.
726  *
727  **/
728 AccessibleUnknown *
729 Accessible_queryInterface (Accessible *obj,
730                            const char *interface_name)
731 {
732   Bonobo_Unknown iface;
733   
734   if (!obj)
735     {
736       return NULL;
737     }
738
739   iface = Accessibility_Accessible_queryInterface (CSPI_OBJREF (obj),
740                                                    interface_name,
741                                                    cspi_ev ());
742
743
744   cspi_return_val_if_ev ("queryInterface", NULL); 
745
746   /*
747    * FIXME: we need to be fairly sure that references are going
748    * to mach up if we are going to expose QueryInterface, ie. we
749    * can't allow people to do:
750    * b = a.qi ("b"); b.unref, b.unref to release a's reference.
751    * this should be no real problem though for this level of API
752    * user.
753    */
754
755   return cspi_object_add (iface);
756 }
757
758
759 /**
760  * AccessibleRelation_ref:
761  * @obj: a pointer to the #AccessibleRelation object on which to operate.
762  *
763  * Increment the reference count for an #AccessibleRelation object.
764  *
765  **/
766 void
767 AccessibleRelation_ref (AccessibleRelation *obj)
768 {
769   cspi_object_ref (obj);
770 }
771
772 /**
773  * AccessibleRelation_unref:
774  * @obj: a pointer to the #AccessibleRelation object on which to operate.
775  *
776  * Decrement the reference count for an #AccessibleRelation object.
777  *
778  **/
779 void
780 AccessibleRelation_unref (AccessibleRelation *obj)
781 {
782   cspi_object_unref (obj);
783 }
784
785 /**
786  * AccessibleRelation_getRelationType:
787  * @obj: a pointer to the #AccessibleRelation object to query.
788  *
789  * Get the type of relationship represented by an #AccessibleRelation.
790  *
791  * Returns: an #AccessibleRelationType indicating the type of relation
792  *         encapsulated in this #AccessibleRelation object.
793  *
794  **/
795 AccessibleRelationType
796 AccessibleRelation_getRelationType (AccessibleRelation *obj)
797 {
798   cspi_return_val_if_fail (obj != NULL, -1);
799   return 0;
800 }
801
802 /**
803  * AccessibleRelation_getNTargets:
804  * @obj: a pointer to the #AccessibleRelation object to query.
805  *
806  * Get the number of objects which this relationship has as its
807  *       target objects (the subject is the #Accessible from which this
808  *       #AccessibleRelation originated).
809  *
810  * Returns: a short integer indicating how many target objects which the
811  *       originating #Accessible object has the #AccessibleRelation
812  *       relationship with.
813  **/
814 int
815 AccessibleRelation_getNTargets (AccessibleRelation *obj)
816 {
817   cspi_return_val_if_fail (obj != NULL, -1);
818   return 0;
819 }
820
821 /**
822  * AccessibleRelation_getTarget:
823  * @obj: a pointer to the #AccessibleRelation object to query.
824  * @i: a (zero-index) integer indicating which (of possibly several) target is requested.
825  *
826  * Get the @i-th target of a specified #AccessibleRelation relationship.
827  *
828  * Returns: an #Accessible which is the @i-th object with which the
829  *      originating #Accessible has relationship specified in the
830  *      #AccessibleRelation object.
831  *
832  **/
833 Accessible *
834 AccessibleRelation_getTarget (AccessibleRelation *obj, int i)
835 {
836   cspi_return_val_if_fail (obj != NULL, NULL);
837   return NULL;
838 }
839
840 /**
841  * AccessibleStateSet_ref:
842  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
843  *
844  * Increment the reference count for an #AccessibleStateSet object.
845  *
846  **/
847 void
848 AccessibleStateSet_ref (AccessibleStateSet *obj)
849 {
850   cspi_object_ref (obj);
851 }
852
853 /**
854  * AccessibleStateSet_unref:
855  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
856  *
857  * Decrement the reference count for an #AccessibleStateSet object.
858  *
859  **/
860 void
861 AccessibleStateSet_unref (AccessibleStateSet *obj)
862 {
863   cspi_object_unref (obj);
864 }
865
866 /**
867  * AccessibleStateSet_contains:
868  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
869  * @state: an #AccessibleState for which the specified #AccessibleStateSet
870  *       will be queried.
871  *
872  * Determine whether a given #AccessibleStateSet includes a given state; that is,
873  *       whether @state is true for the stateset in question.
874  *
875  * Returns: #TRUE if @state is true/included in the given #AccessibleStateSet,
876  *          otherwise #FALSE.
877  *
878  **/
879 SPIBoolean
880 AccessibleStateSet_contains (AccessibleStateSet *obj,
881                              AccessibleState state)
882 {
883   CORBA_boolean retval;
884
885   cspi_return_val_if_fail (obj != NULL, FALSE);
886
887   retval = Accessibility_StateSet_contains (CSPI_OBJREF (obj),
888                                             state, cspi_ev ());
889
890   cspi_return_val_if_ev ("contains", FALSE);
891
892   return (SPIBoolean) retval;
893 }
894
895 /**
896  * AccessibleStateSet_add:
897  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
898  * @state: an #AccessibleState to be added to the specified #AccessibleStateSet
899  *
900  * Add a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
901  *       given state to #TRUE in the stateset.
902  *
903  **/
904 void
905 AccessibleStateSet_add (AccessibleStateSet *obj,
906                         AccessibleState state)
907 {
908   cspi_return_if_fail (obj != NULL);
909
910   Accessibility_StateSet_add (CSPI_OBJREF (obj), state, cspi_ev ());
911   cspi_check_ev ("add");
912 }
913
914 /**
915  * AccessibleStateSet_remove:
916  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
917  * @state: an #AccessibleState to be removed from the specified #AccessibleStateSet
918  *
919  * Remove a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
920  *       given state to #FALSE in the stateset.)
921  *
922  **/
923 void
924 AccessibleStateSet_remove (AccessibleStateSet *obj,
925                            AccessibleState state)
926 {
927   cspi_return_if_fail (obj != NULL);
928
929   Accessibility_StateSet_remove (CSPI_OBJREF (obj), state, cspi_ev ());
930   cspi_check_ev ("remove");
931 }
932
933 /**
934  * AccessibleStateSet_equals:
935  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
936  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
937  *
938  * Determine whether two instances of #AccessibleStateSet are equivalent (i.e.
939  *         consist of the same #AccessibleStates).  Useful for checking multiple
940  *         state variables at once; construct the target state then compare against it.
941  *
942  * @see AccessibleStateSet_compare().
943  *
944  * Returns: #TRUE if the two #AccessibleStateSets are equivalent,
945  *          otherwise #FALSE.
946  *
947  **/
948 SPIBoolean
949 AccessibleStateSet_equals (AccessibleStateSet *obj,
950                            AccessibleStateSet *obj2)
951 {
952   if (obj == obj2)
953     {
954       return TRUE;
955     }
956
957   cspi_return_val_if_fail (obj != NULL, FALSE);
958   cspi_return_val_if_fail (obj2 != NULL, FALSE);
959
960   return Accessibility_StateSet_equals (CSPI_OBJREF (obj),
961                                         CSPI_OBJREF (obj2), cspi_ev ());
962 }
963
964 /**
965  * AccessibleStateSet_compare:
966  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
967  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
968  *
969  * Determine the differences between two instances of #AccessibleStateSet.
970  * Not Yet Implemented.
971  *.
972  * @see AccessibleStateSet_equals().
973  *
974  * Returns: an #AccessibleStateSet object containing all states contained on one of
975  *          the two sets but not the other.
976  *
977  **/
978 AccessibleStateSet *
979 AccessibleStateSet_compare (AccessibleStateSet *obj,
980                             AccessibleStateSet *obj2)
981 {
982   cspi_return_val_if_fail (obj != NULL, NULL);
983   cspi_return_val_if_fail (obj2 != NULL, NULL);
984   return NULL;  
985 }
986
987 /**
988  * AccessibleStateSet_isEmpty:
989  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
990  *
991  * Determine whether a given #AccessibleStateSet is the empty set.
992  *
993  * Returns: #TRUE if the given #AccessibleStateSet contains no (true) states,
994  *          otherwise #FALSE.
995  *
996  **/
997 SPIBoolean
998 AccessibleStateSet_isEmpty (AccessibleStateSet *obj)
999 {
1000   cspi_return_val_if_fail (obj != NULL, FALSE);
1001   return TRUE;  
1002   /*  return Accessibility_StateSet_isEmpty (CSPI_OBJREF (obj), cspi_ev ());*/
1003 }
1004
1005