Added C binding for key synthesis, and a new test/demo program
[platform/core/uifw/at-spi2-atk.git] / cspi / spi.h
1
2 #ifndef _SPI_H
3 #define _SPI_H
4
5 /* Implementation private definitions */
6 #include "spi-impl.h"
7
8 /*
9  * Definitions for ACCESSIBLE_STATE , ACCESSIBLE_ROLE, AccessibleEvent,
10  *      and event listeners.
11  */
12
13 #include "spi-roletypes.h"
14 #include "spi-statetypes.h"
15 #include "spi-listener.h"
16
17 /*
18  *
19  * Enumerated type for text boundary types
20  *
21  */
22
23 typedef enum
24 {
25   TEXT_BOUNDARY_CHAR,
26   TEXT_BOUNDARY_CURSOR_POS,
27   TEXT_BOUNDARY_WORD_START,
28   TEXT_BOUNDARY_WORD_END,
29   TEXT_BOUNDARY_SENTENCE_START,
30   TEXT_BOUNDARY_SENTENCE_END,
31   TEXT_BOUNDARY_LINE_START,
32   TEXT_BOUNDARY_LINE_END,
33   TEXT_BOUNDARY_ATTRIBUTE_RANGE
34 } TEXT_BOUNDARY_TYPE;
35
36
37
38 /*
39  *
40  * Enumerated type for relation types
41  *
42  */
43
44 typedef enum
45 {
46   RELATION_LABEL_FOR,
47   RELATION_LABELED_BY,
48   RELATION_CONTROLLER_FOR,
49   RELATION_CONTROLLED_BY,
50   RELATION_MEMBER_OF
51 } RELATION_TYPE;
52
53
54 /* don't change the order of these ! */
55 typedef enum _AccessibleCoordType {
56   COORD_TYPE_SCREEN,
57   COORD_TYPE_WINDOW
58 } AccessibleCoordType;
59
60 typedef enum _KeyEventType {
61   KEY_PRESSED,
62   KEY_RELEASED
63 } KeyEventType;
64
65 typedef enum _KeySynthType {
66   KEY_PRESS,
67   KEY_RELEASE, 
68   KEY_PRESSRELEASE,
69   KEY_SYM
70 } KeySynthType;
71
72 typedef enum _KeyListenerSyncType {
73   KEYLISTENER_SYNCHRONOUS = 1,
74   KEYLISTENER_CANCONSUME = 2,
75   KEYLISTENER_ALLWINDOWS = 4
76 } KeyListenerSyncType;
77
78 typedef unsigned long KeyEventMask;
79
80 typedef struct _KeyStroke
81 {
82         long keyID;
83         short keycode;
84         KeyEventType type;
85         unsigned short modifiers;
86 } KeyStroke;
87
88 typedef struct _KeySet
89 {
90         unsigned long *keysyms;
91         unsigned short *keycodes;
92         short len;
93 } KeySet;
94
95 #define ALL_KEYS ((void *)NULL)
96
97 /*
98  *
99  * Basic SPI initialization and event loop function prototypes
100  *
101  */
102
103 /**
104  * SPI_init:
105  *
106  * Connects to the accessibility registry and initializes the SPI.
107  *
108  * Returns: 0 on success, otherwise an integer error code.
109  **/
110 int
111 SPI_init (void);
112
113 /**
114  * SPI_event_main:
115  * @isGNOMEApp: a #boolean indicating whether the client of the SPI
116  *              will use the Gnome event loop or not.
117  *
118  * Starts/enters the main event loop for the SPI services.
119  *
120  * (NOTE: This method does not return control, it is exited via a call to exit()
121  * from within an event handler).
122  *
123  **/
124 void
125 SPI_event_main (boolean isGNOMEApp);
126
127 /**
128  * SPI_event_is_ready:
129  *
130  * Checks to see if an SPI event is waiting in the event queue.
131  * Used by clients that don't wish to use SPI_event_main().
132  * Not Yet Implemented.
133  *
134  * Returns: #TRUE if an event is waiting, otherwise #FALSE.
135  *
136  **/
137 boolean
138 SPI_eventIsReady ();
139
140 /**
141  * SPI_nextEvent:
142  *
143  * Gets the next event in the SPI event queue; blocks if no event
144  * is pending.
145  * Used by clients that don't wish to use SPI_event_main().
146  * Not Yet Implemented.
147  *
148  * Returns: the next #AccessibleEvent in the SPI event queue.
149  *
150  **/
151 AccessibleEvent *
152 SPI_nextEvent (boolean waitForEvent);
153
154 /**
155  * SPI_exit:
156  *
157  * Disconnects from the Accessibility Registry and releases resources.
158  * Not Yet Implemented.
159  *
160  **/
161 void
162 SPI_exit (void);
163
164 /*
165  * Event Listener creation and support.
166  */
167
168 /**
169  * createEventListener:
170  * @callback : an #AccessibleEventListenerCB callback function, or NULL.
171  *
172  * Create a new #AccessibleEventListener with a specified callback function.
173  *
174  * Returns: a pointer to a newly-created #AccessibleEventListener.
175  *
176  **/
177 AccessibleEventListener *
178 createEventListener (AccessibleEventListenerCB callback);
179
180 /**
181  * EventListener_addCallback:
182  * @listener: the #AccessibleEventListener instance to modify.
183  * @callback: an #AccessibleEventListenerCB function pointer.
184  *
185  * Add an in-process callback function to an existing AccessibleEventListener.
186  *
187  * Returns: #TRUE if successful, otherwise #FALSE.
188  *
189  **/
190 boolean
191 EventListener_addCallback (AccessibleEventListener *listener,
192                            AccessibleEventListenerCB callback);
193
194 /**
195  * EventListener_removeCallback:
196  * @listener: the #AccessibleEventListener instance to modify.
197  * @callback: an #AccessibleEventListenerCB function pointer.
198  *
199  * Remove an in-process callback function from an existing AccessibleEventListener.
200  *
201  * Returns: #TRUE if successful, otherwise #FALSE.
202  *
203  **/
204 boolean
205 EventListener_removeCallback (AccessibleEventListener *listener,
206                               AccessibleEventListenerCB callback);
207
208 /**
209  * createKeyListener:
210  * @callback : an #KeystrokeListenerCB callback function, or NULL.
211  *
212  * Create a new #KeystrokeListener with a specified callback function.
213  *
214  * Returns: a pointer to a newly-created #KeystrokeListener.
215  *
216  **/
217 KeystrokeListener *
218 createKeystrokeListener (KeystrokeListenerCB callback);
219
220 /**
221  * KeystrokeListener_addCallback:
222  * @listener: the #KeystrokeListener instance to modify.
223  * @callback: an #KeystrokeListenerCB function pointer.
224  *
225  * Add an in-process callback function to an existing #KeystrokeListener.
226  *
227  * Returns: #TRUE if successful, otherwise #FALSE.
228  *
229  **/
230 boolean
231 KeystrokeListener_addCallback (KeystrokeListener *listener,
232                                KeystrokeListenerCB callback);
233
234 /**
235  * KeystrokeListener_removeCallback:
236  * @listener: the #KeystrokeListener instance to modify.
237  * @callback: an #KeystrokeListenerCB function pointer.
238  *
239  * Remove an in-process callback function from an existing #KeystrokeListener.
240  *
241  * Returns: #TRUE if successful, otherwise #FALSE.
242  *
243  **/
244 boolean
245 KeystrokeListener_removeCallback (KeystrokeListener *listener,
246                                   KeystrokeListenerCB callback);
247
248 /*
249  *
250  * Global functions serviced by the registry
251  *
252  */
253
254 /**
255  * registerGlobalEventListener:
256  * @listener: the #AccessibleEventListener to be registered against an event type.
257  * @callback: a character string indicating the type of events for which
258  *            notification is requested.  Format is
259  *            EventClass:major_type:minor_type:detail
260  *            where all subfields other than EventClass are optional.
261  *            EventClasses include "Focus", "Window", "Mouse",
262  *            and toolkit events (e.g. "Gtk", "AWT").
263  *            Examples: "focus:", "Gtk:GtkWidget:button_press_event".
264  *
265  * NOTE: this string may be UTF-8, but should not contain byte value 56 (ascii ':'),
266  *            except as a delimiter, since non-UTF-8 string delimiting
267  *            functions are used internally.  In general, listening to
268  *            toolkit-specific events is not recommended.
269  *
270  * Add an in-process callback function to an existing AccessibleEventListener.
271  *
272  * Returns: #TRUE if successful, otherwise #FALSE.
273  *
274  **/
275 boolean
276 registerGlobalEventListener (AccessibleEventListener *listener,
277                              char *eventType);
278
279 /**
280  * getDesktopCount:
281  *
282  * Get the number of virtual desktops.
283  * NOTE: currently multiple virtual desktops are not implemented, this
284  *       function always returns '1'.
285  *
286  * Returns: an integer indicating the number of active virtual desktops.
287  *
288  **/
289 int
290 getDesktopCount ();
291
292 /**
293  * getDesktop:
294  * @i: an integer indicating which of the accessible desktops is to be returned.
295  *
296  * Get the virtual desktop indicated by index @i.
297  * NOTE: currently multiple virtual desktops are not implemented, this
298  *       function always returns '1'.
299  *
300  * Returns: a pointer to the 'i-th' virtual desktop's #Accessible representation.
301  *
302  **/
303 Accessible*
304 getDesktop (int n);
305
306 /**
307  * getDesktopList:
308  * @list: a pointer to an array of #Accessible objects.
309  *
310  * Get the list of virtual desktops.  On return, @list will point
311  *     to a newly-created array of virtual desktop pointers.
312  *     It is the responsibility of the caller to free this array when
313  *     it is no longer needed.
314  *
315  * Not Yet Implemented.
316  *
317  * Returns: an integer indicating how many virtual desktops have been
318  *          placed in the list pointed to by parameter @list.
319  **/
320 int
321 getDesktopList (Accessible **list);
322
323 /**
324  * registerKeystrokeListener:
325  * @listener: a pointer to the #KeystrokeListener for which
326  *            keystroke events are requested.
327  *
328  * Not Yet Implemented.
329  *
330  **/
331 void
332 registerKeystrokeListener (KeystrokeListener *listener,
333                            KeySet *keys,
334                            KeyMaskType modmask,
335                            KeyEventMask eventmask,
336                            KeyListenerSyncType sync_type);
337
338 /**
339  * generateKeyEvent:
340  * @keycode: a #long indicating the keycode of the key event
341  *           being synthesized.
342  * @synth_type: a #KeySynthType indicating whether this should be a
343  *        KEY_PRESS, KEY_RELEASE, both (KEY_PRESSRELEASE), or
344  *        a press/release pair for a KEYSYM.
345  *
346  * Synthesize a keyboard event (as if a hardware keyboard event occurred in the
347  * current UI context).
348  *
349  **/
350 void
351 generateKeyEvent (long keyCode, KeySynthType synth_type);
352
353 /**
354  * generateMouseEvent:
355  * @x: a #long indicating the screen x coordinate of the mouse event.
356  * @y: a #long indicating the screen y coordinate of the mouse event.
357  * @name: a string indicating which mouse event to be synthesized
358  *        (e.g. "button1", "button2", "mousemove").
359  *
360  * Synthesize a mouse event at a specific screen coordinate.
361  * Not Yet Implemented.
362  *
363  **/
364 void
365 generateMouseEvent (long x, long y, char *name);
366
367 /*
368  *
369  * Accessible function prototypes
370  *
371  */
372
373 /**
374  * Accessible_ref:
375  * @obj: a pointer to the #Accessible object on which to operate.
376  *
377  * Increment the reference count for an #Accessible object.
378  *
379  * Returns: (no return code implemented yet).
380  *
381  **/
382 int
383 Accessible_ref (Accessible *obj);
384
385 /**
386  * Accessible_unref:
387  * @obj: a pointer to the #Accessible object on which to operate.
388  *
389  * Decrement the reference count for an #Accessible object.
390  *
391  * Returns: (no return code implemented yet).
392  *
393  **/
394 int
395 Accessible_unref (Accessible *obj);
396
397 /**
398  * Accessible_getName:
399  * @obj: a pointer to the #Accessible object on which to operate.
400  *
401  * Get the name of an #Accessible object.
402  *
403  * Returns: a UTF-8 string indicating the name of the #Accessible object.
404  *
405  **/
406 char *
407 Accessible_getName (Accessible *obj);
408
409 /**
410  * Accessible_getDescription:
411  * @obj: a pointer to the #Accessible object on which to operate.
412  *
413  * Get the description of an #Accessible object.
414  *
415  * Returns: a UTF-8 string describing the #Accessible object.
416  *
417  **/
418 char *
419 Accessible_getDescription (Accessible *obj);
420
421 /**
422  * Accessible_getParent:
423  * @obj: a pointer to the #Accessible object to query.
424  *
425  * Get an #Accessible object's parent container.
426  *
427  * Returns: a pointer to the #Accessible object which contains the given
428  *          #Accessible instance, or NULL if the @obj has no parent container.
429  *
430  **/
431 Accessible *
432 Accessible_getParent (Accessible *obj);
433
434 /**
435  * Accessible_getChildCount:
436  *
437  * @obj: a pointer to the #Accessible object on which to operate.
438  *
439  * Get the number of children contained by an #Accessible object.
440  *
441  * Returns: a #long indicating the number of #Accessible children
442  *          contained by an #Accessible object.
443  *
444  **/
445 long
446 Accessible_getChildCount (Accessible *obj);
447
448 /**
449  * Accessible_getChildAtIndex:
450  *
451  * @obj: a pointer to the #Accessible object on which to operate.
452  * @childIndex: a #long indicating which child is specified.
453  *
454  * Get the #Accessible child of an #Accessible object at a given index.
455  *
456  * Returns: a pointer to the #Accessible child object at index
457  *          @childIndex.
458  *
459  **/
460 Accessible *
461 Accessible_getChildAtIndex (Accessible *obj,
462                             long childIndex);
463
464 /**
465  * Accessible_getIndexInParent:
466  *
467  * @obj: a pointer to the #Accessible object on which to operate.
468  *
469  * Get the index of an #Accessible object in its containing #Accessible.
470  *
471  * Returns: a #long indicating the index of the #Accessible object
472  *          in its parent (i.e. containing) #Accessible instance,
473  *          or -1 if @obj has no containing parent.
474  *
475  **/
476 long
477 Accessible_getIndexInParent (Accessible *obj);
478
479 /**
480  * Accessible_getRelationSet:
481  *
482  * Not Yet Implemented.
483  *
484  **/
485 AccessibleRelation **
486 Accessible_getRelationSet (Accessible *obj);
487
488 /**
489  * Accessible_getRole:
490  * @obj: a pointer to the #Accessible object on which to operate.
491  *
492  * Get the UI role of an #Accessible object.
493  *
494  * Returns: a UTF-8 string indicating the UI role of the #Accessible object.
495  *
496  **/
497 char *
498 Accessible_getRole (Accessible *obj);
499
500 /**
501  * Accessible_getStateSet:
502  *
503  * Not Yet Implemented.
504  *
505  **/
506 AccessibleStateSet *
507 Accessible_getStateSet (Accessible *obj);
508
509 /* Interface query methods */
510
511 /**
512  * Accessible_isAction:
513  * @obj: a pointer to the #Accessible instance to query.
514  *
515  * Query whether the specified #Accessible implements #AccessibleAction.
516  * Not Yet Implemented.
517  *
518  * Returns: #TRUE if @obj implements the #AccessibleAction interface,
519  *          #FALSE otherwise.
520  **/
521 boolean
522 Accessible_isAction (Accessible *obj);
523
524 /**
525  * Accessible_isComponent:
526  * @obj: a pointer to the #Accessible instance to query.
527  *
528  * Query whether the specified #Accessible implements #AccessibleComponent.
529  *
530  * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
531  *          #FALSE otherwise.
532  **/
533 boolean
534 Accessible_isComponent (Accessible *obj);
535
536 /**
537  * Accessible_isEditableText:
538  * @obj: a pointer to the #Accessible instance to query.
539  *
540  * Query whether the specified #Accessible implements #AccessibleEditableText.
541  * Not Yet Implemented.
542  *
543  * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
544  *          #FALSE otherwise.
545  **/
546 boolean
547 Accessible_isEditableText (Accessible *obj);
548
549 /**
550  * Accessible_isHypertext:
551  * @obj: a pointer to the #Accessible instance to query.
552  *
553  * Query whether the specified #Accessible implements #AccessibleHypertext.
554  * Not Yet Implemented.
555  *
556  * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
557  *          #FALSE otherwise.
558  **/
559 boolean
560 Accessible_isHypertext (Accessible *obj);
561
562 /**
563  * Accessible_isImage:
564  * @obj: a pointer to the #Accessible instance to query.
565  *
566  * Query whether the specified #Accessible implements #AccessibleImage.
567  * Not Yet Implemented.
568  *
569  * Returns: #TRUE if @obj implements the #AccessibleImage interface,
570  *          #FALSE otherwise.
571 **/
572 boolean
573 Accessible_isImage (Accessible *obj);
574
575 /**
576   * Accessible_isSelection:
577  * @obj: a pointer to the #Accessible instance to query.
578  *
579  * Query whether the specified #Accessible implements #AccessibleSelection.
580  * Not Yet Implemented.
581  *
582  * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
583  *          #FALSE otherwise.
584 **/
585 boolean
586 Accessible_isSelection (Accessible *obj);
587
588 /**
589  * Accessible_isTable:
590  * @obj: a pointer to the #Accessible instance to query.
591  *
592  * Query whether the specified #Accessible implements #AccessibleTable.
593  * Not Yet Implemented.
594  *
595  * Returns: #TRUE if @obj implements the #AccessibleTable interface,
596  *          #FALSE otherwise.
597 **/
598 boolean
599 Accessible_isTable (Accessible *obj);
600
601 /**
602  * Accessible_isText:
603  * @obj: a pointer to the #Accessible instance to query.
604  *
605  * Query whether the specified #Accessible implements #AccessibleText.
606  * Not Yet Implemented.
607  *
608  * Returns: #TRUE if @obj implements the #AccessibleText interface,
609  *          #FALSE otherwise.
610 **/
611 boolean
612 Accessible_isText (Accessible *obj);
613
614 /**
615  * Accessible_getAction:
616  *
617  * Not Yet Implemented.
618  *
619  **/
620 AccessibleAction *
621 Accessible_getAction (Accessible *obj);
622
623 /**
624  * Accessible_getComponent:
625  * @obj: a pointer to the #Accessible instance to query.
626  *
627  * Get the #AccessibleComponent interface for an #Accessible.
628  *
629  * Returns: a pointer to an #AccessibleComponent interface instance, or
630  *          NULL if @obj does not implement #AccessibleComponent.
631  **/
632 AccessibleComponent *
633 Accessible_getComponent (Accessible *obj);
634
635 /**
636  * Accessible_getEditableText:
637  *
638  * Not Yet Implemented.
639  *
640  **/
641 AccessibleEditableText *
642 Accessible_getEditableText (Accessible *obj);
643
644 /**
645  * Accessible_getHypertext:
646  *
647  * Not Yet Implemented.
648  *
649  **/
650 AccessibleHypertext *
651 Accessible_getHypertext (Accessible *obj);
652
653 /**
654  * Accessible_getImage:
655  *
656  * Not Yet Implemented.
657  *
658  **/
659 AccessibleImage *
660 Accessible_getImage (Accessible *obj);
661
662 /**
663  * Accessible_getSelection:
664  *
665  * Not Yet Implemented.
666  *
667  **/
668 AccessibleSelection *
669 Accessible_getSelection (Accessible *obj);
670
671 /**
672  * Accessible_getTable:
673  *
674  * Not Yet Implemented.
675  *
676  **/
677 AccessibleTable *
678 Accessible_getTable (Accessible *obj);
679
680 /**
681  * Accessible_getText:
682  *
683  * Not Yet Implemented.
684  *
685  **/
686 AccessibleText *
687 Accessible_getText (Accessible *obj);
688
689 /**
690  * Accessible_queryInterface:
691  * @obj: a pointer to the #Accessible instance to query.
692  * @interface_name: a UTF-8 character string specifiying the requested interface.
693  *
694  * Query an #Accessible object to for a named interface.
695  *
696  * Returns: an instance of the named interface object, if it is implemented
697  *          by @obj, or NULL otherwise.
698  *
699  **/
700 GenericInterface *
701 Accessible_queryInterface (Accessible *obj, char *interface_name);
702
703 /*
704  *
705  * AccessibleAction function prototypes
706  *
707  */
708
709 int
710 AccessibleAction_ref (
711                       AccessibleAction *obj);
712
713 int
714 AccessibleAction_unref (AccessibleAction *obj);
715
716 long
717 AccessibleAction_getNActions (AccessibleAction *obj);
718
719 /**
720  * AccessibleAction_getDescription:
721  * @obj: a pointer to the #AccessibleAction to query.
722  *
723  * Get the description of 'i-th' action invokable on an
724  *      object implementing #AccessibleAction.
725  *
726  * Not Yet Implemented.
727  *
728  * Returns: a UTF-8 string describing the 'i-th' invokable action.
729  *
730  **/
731 char *
732 AccessibleAction_getDescription (AccessibleAction *obj,
733                                  long index);
734
735 boolean
736 AccessibleAction_doAction (AccessibleAction *obj,
737                            long index);
738
739 char *
740 AccessibleAction_getKeyBinding (AccessibleAction *obj,
741                                 long index);
742
743 /*
744  *
745  * AccessibleApplication function prototypes
746  *
747  */
748
749 /**
750  * AccessibleApplication_unref:
751  * @obj: a pointer to the #AccessibleApplication on which to operate.
752  *
753  * Decrement the reference count for an #AccessibleApplication.
754  *
755  * Returns: (no return code implemented yet).
756  *
757  **/
758 int
759 AccessibleApplication_ref (AccessibleApplication *obj);
760
761 /**
762  * AccessibleApplication_unref:
763  * @obj: a pointer to the #AccessibleApplication object on which to operate.
764  *
765  * Decrement the reference count for an #AccessibleApplication.
766  *
767  * Returns: (no return code implemented yet).
768  *
769  **/
770 int
771 AccessibleApplication_unref (AccessibleApplication *obj);
772
773 /**
774  * AccessibleApplication_getToolkitName:
775  * @obj: a pointer to the #AccessibleApplication to query.
776  *
777  * Get the name of the UI toolkit used by an #AccessibleApplication.
778  *
779  * Returns: a UTF-8 string indicating which UI toolkit is
780  *          used by an application.
781  *
782  **/
783 char *
784 AccessibleApplication_getToolkitName (AccessibleApplication *obj);
785
786 /**
787  * AccessibleApplication_getVersion:
788  * @obj: a pointer to the #AccessibleApplication being queried.
789  *
790  * Get the version of the at-spi bridge exported by an
791  *      #AccessibleApplication instance.
792  *
793  * Returns: a UTF-8 string indicating the application's
794  *          at-spi version.
795  *
796  **/
797 char *
798 AccessibleApplication_getVersion (AccessibleApplication *obj);
799
800 /**
801  * AccessibleApplication_getID:
802  * @obj: a pointer to the #AccessibleApplication being queried.
803  *
804  * Get the unique ID assigned by the Registry to an
805  *      #AccessibleApplication instance.
806  * (Not Yet Implemented by the registry).
807  *
808  * Returns: a unique #long integer associated with the application
809  *          by the Registry, or 0 if the application is not registered.
810  **/
811 long
812 AccessibleApplication_getID (AccessibleApplication *obj);
813
814 /**
815  * AccessibleApplication_pause:
816  *
817  * Attempt to pause the application (used when client event queue is
818  *  over-full).
819  * Not Yet Implemented.
820  *
821  * Returns: #TRUE if the application was paused successfully, #FALSE otherwise.
822  *
823  **/
824 boolean
825 AccessibleApplication_pause (AccessibleApplication *obj);
826
827 /**
828  * AccessibleApplication_pause:
829  *
830  * Attempt to resume the application (used after #AccessibleApplication_pause).
831  * Not Yet Implemented.
832  *
833  * Returns: #TRUE if application processing resumed successfully, #FALSE otherwise.
834  *
835  **/
836 boolean
837 AccessibleApplication_resume (AccessibleApplication *obj);
838
839 /*
840  *
841  * AccessibleComponent function prototypes
842  *
843  */
844
845 int
846 AccessibleComponent_ref (AccessibleComponent *obj);
847
848 int
849 AccessibleComponent_unref (AccessibleComponent *obj);
850
851 boolean
852 AccessibleComponent_contains (AccessibleComponent *obj,
853                               long x,
854                               long y,
855                               AccessibleCoordType ctype);
856
857 Accessible *
858 AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
859                                           long x,
860                                           long y,
861                                           AccessibleCoordType ctype);
862
863 /**
864  * AccessibleComponent_getExtents:
865  * @obj: a pointer to the #AccessibleComponent to query.
866  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
867  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
868  * @width: a pointer to a #long into which the x extents (width) will be returned.
869  * @height: a pointer to a #long into which the y extents (height) will be returned.
870  * @ctype: the desired coordinate system into which to return the results,
871  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
872  *
873  * Get the bounding box of the specified #AccessibleComponent.
874  *
875  **/
876 void
877 AccessibleComponent_getExtents (AccessibleComponent *obj,
878                                 long *x,
879                                 long *y,
880                                 long *width,
881                                 long *height,
882                                 AccessibleCoordType ctype);
883
884 void
885 AccessibleComponent_getPosition (AccessibleComponent *obj,
886                                  long *x,
887                                  long *y,
888                                  AccessibleCoordType ctype);
889
890 void
891 AccessibleComponent_getSize (AccessibleComponent *obj,
892                              long *width,
893                              long *height);
894
895 void
896 AccessibleComponent_grabFocus (AccessibleComponent *obj);
897
898 /*
899  *
900  * AccessibleEditableText function prototypes
901  *
902  */
903
904 int
905 AccessibleEditableText_ref (AccessibleEditableText *obj);
906
907 int
908 AccessibleEditableText_unref (AccessibleEditableText *obj);
909
910 boolean
911 AccessibleEditableText_setRunAttributes (AccessibleEditableText *obj,
912                                          const char *attributes,
913                                          long startPos, long endPos);
914
915 void
916 AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
917                                         const char *newContents);
918
919 void
920 AccessibleEditableText_insertText (AccessibleEditableText *obj,
921                                    long position,
922                                    char *text,
923                                    long length);
924
925 void
926 AccessibleEditableText_copyText (AccessibleText *obj,
927                                  long startPos,
928                                  long endPos);
929
930 void
931 AccessibleEditableText_cutText (AccessibleEditableText *obj,
932                                 long startPos,
933                                 long endPos);
934
935 void
936 AccessibleEditableText_deleteText (AccessibleEditableText *obj,
937                                    long startPos,
938                                    long endPos);
939
940 void
941 AccessibleEditableText_pasteText (AccessibleEditableText *obj,
942                                   long position);
943
944 /*
945  *
946  * AccessibleHyperlink function prototypes
947  *
948  */
949
950 int
951 AccessibleHyperlink_ref (AccessibleHyperlink *obj);
952
953 int
954 AccessibleHyperlink_unref (AccessibleHyperlink *obj);
955
956 long
957 AccessibleHyperlink_getNAnchors (AccessibleHyperlink *obj);
958
959 char *
960 AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
961                             long i);
962
963 Accessible
964 AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
965                                long i);
966
967 void
968 AccessibleHyperlink_getIndexRange (AccessibleHyperlink *obj,
969                                    long *startIndex,
970                                    long *endIndex);
971
972 boolean
973 AccessibleHyperlink_isValid (AccessibleHyperlink *obj);
974
975 /*
976  *
977  * AccessibleHypertext function prototypes
978  *
979  */
980
981 int
982 AccessibleHypertext_ref (AccessibleHypertext *obj);
983
984 int
985 AccessibleHypertext_unref (AccessibleHypertext *obj);
986
987 long
988 AccessibleHypertext_getNLinks (AccessibleHypertext *obj);
989
990 AccessibleHyperlink *
991 AccessibleHyperText_getLink (AccessibleHypertext *obj,
992                              long linkIndex);
993
994 long
995 AccessibleHypertext_getLinkIndex (AccessibleHypertext *obj,
996                                   long characterIndex);
997
998 /*
999  *
1000  * AccessibleImage function prototypes
1001  *
1002  */
1003
1004 int
1005 AccessibleImage_ref (AccessibleImage *obj);
1006
1007 int
1008 AccessibleImage_unref (AccessibleImage *obj);
1009
1010 char *
1011 AccessibleImage_getImageDescription (AccessibleImage *obj);
1012
1013 void
1014 AccessibleImage_getImageSize (AccessibleImage *obj,
1015                               long *width,
1016                               long *height);
1017
1018 void
1019 AccessibleImage_getImagePosition (AccessibleImage *obj,
1020                                   long *x,
1021                                   long *y,
1022                                   AccessibleCoordType ctype);
1023
1024 /*
1025  *
1026  * AccessibleRelation function prototypes
1027  *
1028  */
1029
1030 int
1031 AccessibleRelation_ref (AccessibleRelation *obj);
1032
1033 int
1034 AccessibleRelation_unref (AccessibleRelation *obj);
1035
1036 RELATION_TYPE
1037 AccessibleRelation_getRelationType (AccessibleRelation *obj);
1038
1039 Accessible *
1040 AccessibleRelation_getTarget (AccessibleRelation *obj);
1041
1042
1043
1044 /*
1045  *
1046  * AccessibleSelection function prototypes
1047  *
1048  */
1049
1050 int
1051 AccessibleSelection_ref (AccessibleSelection *obj);
1052
1053 int
1054 AccessibleSelection_unref (AccessibleSelection *obj);
1055
1056 long
1057 AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj);
1058
1059 Accessible *
1060 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
1061                                       long selectedChildIndex);
1062
1063 boolean
1064 AccessibleSelection_selectChild (AccessibleSelection *obj,
1065                                  long childIndex);
1066
1067 boolean
1068 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
1069                                            long selectedChildIndex);
1070
1071 boolean
1072 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
1073                                      long childIndex);
1074
1075 void
1076 AccessibleSelection_selectAll (AccessibleSelection *obj);
1077
1078 void
1079 AccessibleSelection_clearSelection (AccessibleSelection *obj);
1080
1081
1082 /*
1083  *
1084  * AccessibleStateSet function prototypes
1085  *
1086  */
1087
1088 int
1089 AccessibleStateSet_ref (AccessibleStateSet *obj);
1090
1091 int
1092 AccessibleStateSet_unref (AccessibleStateSet *obj);
1093
1094 boolean
1095 AccessibleStateSet_contains (AccessibleStateSet *obj,
1096                              ACCESSIBLE_STATE state);
1097
1098 void
1099 AccessibleStateSet_add (AccessibleStateSet *obj,
1100                         ACCESSIBLE_STATE state);
1101
1102 void
1103 AccessibleStateSet_remove (AccessibleStateSet *obj,
1104                            ACCESSIBLE_STATE state);
1105
1106 boolean
1107 AccessibleStateSet_equals (AccessibleStateSet *obj,
1108                            AccessibleStateSet *obj2);
1109
1110 void
1111 AccessibleStateSet_compare (AccessibleStateSet *obj,
1112                             AccessibleStateSet *obj2,
1113                             AccessibleStateSet **differenceSet);
1114
1115 boolean
1116 AccessibleStateSet_isEmpty (AccessibleStateSet *obj);
1117
1118
1119 /*
1120  *
1121  * AccessibleTable function prototypes
1122  *
1123  */
1124
1125 int
1126 AccessibleTable_ref (AccessibleTable *obj);
1127
1128 int
1129 AccessibleTable_unref (AccessibleTable *obj);
1130
1131 Accessible *
1132 AccessibleTable_getCaption (AccessibleTable *obj);
1133
1134 Accessible *
1135 AccessibleTable_getSummary (AccessibleTable *obj);
1136
1137 long
1138 AccessibleTable_getNRows (AccessibleTable *obj);
1139
1140 long
1141 AccessibleTable_getNColumns (AccessibleTable *obj);
1142
1143 Accessible *
1144 AccessibleTable_refAt (AccessibleTable *obj,
1145                                  long row,
1146                                  long column);
1147
1148 long
1149 AccessibleTable_getIndexAt (AccessibleTable *obj,
1150                             long row,
1151                             long column);
1152
1153 long
1154 AccessibleTable_getRowAtIndex (AccessibleTable *obj,
1155                                long index);
1156
1157 long
1158 AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
1159                                   long index);
1160
1161 char *
1162 AccessibleTable_getRowDescription (AccessibleTable *obj,
1163                                    long row);
1164
1165 char *
1166 AccessibleTable_getColumnDescription (AccessibleTable *obj,
1167                                       long column);
1168
1169 long
1170 AccessibleTable_getRowExtentAt (AccessibleTable *obj,
1171                                 long row,
1172                                 long column);
1173
1174 long
1175 AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
1176                                    long row,
1177                                    long column);
1178
1179 Accessible *
1180 AccessibleTable_getRowHeader (AccessibleTable *obj,
1181                               long row);
1182
1183 Accessible *
1184 AccessibleTable_getColumnHeader (AccessibleTable *obj,
1185                                  long column);
1186
1187 long
1188 AccessibleTable_getNSelectedRows (AccessibleTable *obj);
1189
1190 long
1191 AccessibleTable_getSelectedRows (AccessibleTable *obj,
1192                                  long **selectedRows);
1193
1194 long
1195 AccessibleTable_getNSelectedColumns (AccessibleTable *obj);
1196
1197 long
1198 AccessibleTable_getSelectedColumns (AccessibleTable *obj,
1199                                     long **selectedColumns);
1200
1201 boolean
1202 AccessibleTable_isRowSelected (AccessibleTable *obj,
1203                                long row);
1204
1205 boolean
1206 AccessibleTable_isColumnSelected (AccessibleTable *obj,
1207                                   long column);
1208
1209 boolean
1210 AccessibleTable_isSelected (AccessibleTable *obj,
1211                             long row,
1212                             long column);
1213
1214 /*
1215  *
1216  * AccessibleText function prototypes
1217  *
1218  */
1219
1220 int
1221 AccessibleText_ref (AccessibleText *obj);
1222
1223 int
1224 AccessibleText_unref (AccessibleText *obj);
1225
1226 long
1227 AccessibleText_getCharacterCount (AccessibleText *obj);
1228
1229 char *
1230 AccessibleText_getText (AccessibleText *obj,
1231                         long startOffset,
1232                         long endOffset);
1233
1234 long
1235 AccessibleText_getCaretOffset (AccessibleText *obj);
1236
1237 char *
1238 AccessibleText_getAttributes (AccessibleText *obj,
1239                                  long offset,
1240                                  long *startOffset,
1241                                  long *endOfset);
1242
1243
1244 boolean
1245 AccessibleText_setCaretOffset (AccessibleText *obj,
1246                                long newOffset);
1247
1248 char *
1249 AccessibleText_getTextBeforeOffset (AccessibleText *obj,
1250                                     long offset,
1251                                     TEXT_BOUNDARY_TYPE type,
1252                                     long *startOffset, long *endOffset);
1253
1254 char *
1255 AccessibleText_getTextAtOffset (AccessibleText *obj,
1256                                     long offset,
1257                                     TEXT_BOUNDARY_TYPE type,
1258                                 long *startOffset, long *endOffset);
1259
1260 char *
1261 AccessibleText_getTextAfterOffset (AccessibleText *obj,
1262                                     long offset,
1263                                     TEXT_BOUNDARY_TYPE type,
1264                                    long *startOffset, long *endOffset);
1265 unsigned long
1266 AccessibleText_getCharacterAtOffset (AccessibleText *obj,
1267                                      long offset);
1268
1269 void
1270 AccessibleText_getCharacterExtents (AccessibleText *obj,
1271                                     long offset,
1272                                     long *x,
1273                                     long *y,
1274                                     long *width,
1275                                     long *height, AccessibleCoordType type);
1276
1277 long
1278 AccessibleText_getOffsetAtPoint (AccessibleText *obj,
1279                                  long x,
1280                                  long y, AccessibleCoordType type);
1281
1282 long
1283 AccessibleText_getNSelections (AccessibleText *obj);
1284
1285 void
1286 AccessibleText_getSelection (AccessibleText *obj,
1287                              long selectionNum, long *startOffset,
1288                              long *endOffset);
1289
1290
1291 boolean
1292 AccessibleText_addSelection (AccessibleText *obj,
1293                              long startOffset, long endOffset);
1294
1295 boolean
1296 AccessibleText_removeSelection (AccessibleText *obj,
1297                                 long selectionNum);
1298
1299 boolean
1300 AccessibleText_setSelection (AccessibleText *obj,
1301                              long selectionNum,
1302                              long startOffset,
1303                              long endOffset);
1304
1305 /*
1306  *
1307  * AccessibleValue Function Prototypes:
1308  *
1309  */
1310
1311 float
1312 AccessibleValue_getMinimumValue (AccessibleValue *value);
1313
1314 float
1315 AccessibleValue_getCurrentValue (AccessibleValue *value);
1316
1317 float
1318 AccessibleValue_getMaximumValue (AccessibleValue *value);
1319
1320 boolean
1321 AccessibleValue_setCurrentValue (AccessibleValue *value,
1322                                  float newValue);
1323
1324 void
1325 spi_freeString (char *s);
1326
1327 #endif