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