Added Li Yuan <li.yuan@sun.com> to MAINTAINERS list for atk, gail,
[platform/core/uifw/at-spi2-atk.git] / cspi / spi.h
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001, 2002 Sun Microsystems Inc.,
6  * Copyright 2001, 2002 Ximian, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef _SPI_H
25 #define _SPI_H
26
27 #include <cspi/spi-impl.h>
28 /*
29  * Definitions for AccessibleRole, AccessibleState,
30  * and event listeners.
31  */
32 #include <cspi/spi-roletypes.h>
33 #include <cspi/spi-statetypes.h>
34 #include <cspi/spi-listener.h>
35
36 /*
37  * Auxiliary typedefs and mask definitions
38  */
39 #include <libspi/keymasks.h>
40
41 #ifdef  __cplusplus
42 extern "C" {
43 #endif
44
45 /**
46  *AccessibleTextBoundaryType:
47  *@SPI_TEXT_BOUNDARY_CHAR: Delimiter is the current character's bounds.
48  *@SPI_TEXT_BOUNDARY_CURSOR_POS: Delimiter is the current text caret position.
49  *@SPI_TEXT_BOUNDARY_WORD_START: Bounds run from the first character of a word to the first 
50  * character of the following word (i.e. including trailing whitespace, if any) within the text object.
51  *@SPI_TEXT_BOUNDARY_WORD_END: Bounds run from the last character of a word to the last 
52  * character of the following word (i.e. including leading whitespace) within the text object.
53  *@SPI_TEXT_BOUNDARY_SENTENCE_START: Bounds run from the first character of a sentence to the first 
54  * character of the next sentence in the text object.
55  *@SPI_TEXT_BOUNDARY_SENTENCE_END: Bounds run from the last character of a sentence to the last 
56  * character of the next sentence in the text object.
57  *@SPI_TEXT_BOUNDARY_LINE_START: Bounds span one line of text, with the line delimiter at the end of the
58  * bounds, if present, within the current text object.
59  *@SPI_TEXT_BOUNDARY_LINE_END: Bounds span one line of text, including a preceding line delimiter
60  * if present within the current text object.
61  *@SPI_TEXT_BOUNDARY_ATTRIBUTE_RANGE: Bounds span the run, relative to the specified offset and
62  * text accessor API rules, over which the attributes of the text object are invariant.  
63  *
64  *Text boundary types used for specifying boundaries for regions of text.
65  **/
66 typedef enum
67 {
68   SPI_TEXT_BOUNDARY_CHAR,
69   SPI_TEXT_BOUNDARY_CURSOR_POS,
70   SPI_TEXT_BOUNDARY_WORD_START,
71   SPI_TEXT_BOUNDARY_WORD_END,
72   SPI_TEXT_BOUNDARY_SENTENCE_START,
73   SPI_TEXT_BOUNDARY_SENTENCE_END,
74   SPI_TEXT_BOUNDARY_LINE_START,
75   SPI_TEXT_BOUNDARY_LINE_END,
76   SPI_TEXT_BOUNDARY_ATTRIBUTE_RANGE
77 } AccessibleTextBoundaryType;
78
79 /**
80  *AccessibleTextClipType
81  *@SPI_TEXT_CLIP_NONE: No clipping to be done
82  *@SPI_TEXT_CLIP_MIN: Text clipped by min coordinate is omitted
83  *@SPI_TEXT_CLIP_MAX: Text clipped by max coordinate is omitted
84  *@SPI_TEXT_CLIP_BOTH: Only text fully within mix/max bound is retained
85  *
86  *Describes the type of clipping required.
87  **/
88 typedef enum
89 {
90   SPI_TEXT_CLIP_NONE,
91   SPI_TEXT_CLIP_MIN,
92   SPI_TEXT_CLIP_MAX,
93   SPI_TEXT_CLIP_BOTH
94 } AccessibleTextClipType;
95
96 /**
97  *AccessibleRelationType:
98  *@SPI_RELATION_NULL: Not used, this is an invalid value for this enumeration.
99  *@SPI_RELATION_LABEL_FOR: Indicates an object is a label for one or more target objects.
100  *@SPI_RELATION_LABELED_BY: Indicates an object is labelled by one or more target objects.
101  *@SPI_RELATION_CONTROLLED_BY: Indicates an object controlled by one or more target objects.
102  *@SPI_RELATION_CONTROLLER_FOR: Indicates an object is an controller for one or more target objects.
103  *@SPI_RELATION_MEMBER_OF: Indicates an object is a member of a group of one or
104 more target objects.
105  *@SPI_RELATION_NODE_CHILD_OF: Indicates an object is a cell in a treetable which is displayed because a cell in the same column is expanded and identifies that cell.
106  *@SPI_RELATION_EXTENDED: This value indicates that a relation other than those pre-specified by this version of AT-SPI
107  * is present.
108  *@SPI_RELATION_FLOWS_TO: Indicates that the object has content that flows logically to another
109  *  AtkObject in a sequential way, (for instance text-flow).
110  *@SPI_RELATION_FLOWS_FROM: Indicates that the object has content that flows logically from
111  *  another AtkObject in a sequential way, (for instance text-flow).
112  *@SPI_RELATION_SUBWINDOW_OF: Indicates a subwindow attached to a component but otherwise has no connection in the UI heirarchy to that component.
113  *@SPI_RELATION_EMBEDS: Indicates that the object visually embeds
114  *  another object's content, i.e. this object's content flows around
115  *  another's content.
116  *@SPI_RELATION_EMBEDDED_BY: Inverse of %SPI_RELATION_EMBEDS, indicates that
117  *  this object's content is visualy embedded in another object.
118  *@SPI_RELATION_POPUP_FOR: Indicates that an object is a popup for another object.
119  *@SPI_RELATION_PARENT_WINDOW_OF: Indicates that an object is a parent window of another object.
120  *@SPI_RELATION_DESCRIBED_BY: Indicates that another object provides descriptive information about this object; more verbose than %SPI_RELATION_LABELLED_BY.
121  *@SPI_RELATION_DESCRIPTION_FOR: Indicates that an object provides descriptive information about another object; more verbose than %SPI_RELATION_LABEL_FOR.
122  *@SPI_RELATION_LAST_DEFINED: Do not use, this is an implementation detail used
123  *  to identify the size of this enumeration.
124  *
125  *Describes the type of the relation
126  **/
127 typedef enum
128 {
129   SPI_RELATION_NULL,
130   SPI_RELATION_LABEL_FOR,
131   SPI_RELATION_LABELED_BY,
132   SPI_RELATION_CONTROLLER_FOR,
133   SPI_RELATION_CONTROLLED_BY,
134   SPI_RELATION_MEMBER_OF,
135   SPI_RELATION_NODE_CHILD_OF,
136   SPI_RELATION_EXTENDED,
137   SPI_RELATION_FLOWS_TO,
138   SPI_RELATION_FLOWS_FROM,
139   SPI_RELATION_SUBWINDOW_OF,
140   SPI_RELATION_EMBEDS,
141   SPI_RELATION_EMBEDDED_BY,
142   SPI_RELATION_POPUP_FOR,
143   SPI_RELATION_PARENT_WINDOW_OF,
144   SPI_RELATION_DESCRIPTION_FOR,
145   SPI_RELATION_DESCRIBED_BY,
146   SPI_RELATION_LAST_DEFINED
147 } AccessibleRelationType;
148
149
150 /* don't change the order of these ! */
151 /**
152  *AccessibleCoordType:
153  *@SPI_COORD_TYPE_SCREEN: specifies xy coordinates relative to the screen
154  *@SPI_COORD_TYPE_WINDOW: specifies xy coordinates relative to an object's
155  * top-level window
156  *
157  *Specifies how xy coordinates are to be interpreted. Used by functions such
158  *as AccessibleComponent_getPosition() and AccessibleText_getCharacterExtents()
159  **/
160 typedef enum {
161   SPI_COORD_TYPE_SCREEN,
162   SPI_COORD_TYPE_WINDOW
163 } AccessibleCoordType;
164
165 /**
166  *AccessibleKeySynthType:
167  *@SPI_KEY_PRESS: Generates a keypress event (requires a subsequent #SPI_KEY_RELEASE event)
168  *@SPI_KEY_RELEASE: Generates a key-release event
169  *@SPI_KEY_PRESSRELEASE: Generates a key press/release event pair.
170  *@SPI_KEY_SYM: Injects a "keysym" event into the stream, as if a press/release pair occurred; allows 
171  * the user to specify the key via its symbolic name, as opposed to simulating a hardware press of a 
172  * specific key.
173  *@SPI_KEY_STRING: Injects one or more keysym events into the keyboard buffer, or directly inserts 
174  * a string value into the currently focussed text widget, if the widgets supports this.
175  * #SPI_KEY_STRING synthesis provides a shortcut for text substring insertion, and also allows the
176  * insertion of text which is not currently available via the current keyboard's keymap.
177  *
178  * Specifies the type of a generated event.
179  **/
180 typedef enum {
181   SPI_KEY_PRESS,
182   SPI_KEY_RELEASE, 
183   SPI_KEY_PRESSRELEASE,
184   SPI_KEY_SYM,
185   SPI_KEY_STRING
186 } AccessibleKeySynthType;
187
188 /**
189  *AccessibleKeyListenerSyncType:
190  *@SPI_KEYLISTENER_NOSYNC: Events may be delivered asynchronously, 
191  * which means in some cases they may already have been delivered to the 
192  * application before the AT client receives the notification.  
193  *@SPI_KEYLISTENER_SYNCHRONOUS: Events are delivered synchronously, before the 
194  * currently focussed application sees them.  
195  *@SPI_KEYLISTENER_CANCONSUME: Events may be consumed by the AT client.  Presumes and
196  * requires #SPI_KEYLISTENER_SYNCHRONOUS, incompatible with #SPI_KEYLISTENER_NOSYNC.
197  *@SPI_KEYLISTENER_ALL_WINDOWS: Events are received not from the application toolkit layer, but
198  * from the device driver or windowing system subsystem; such notifications are 'global' in the 
199  * sense that they are not broken or defeated by applications that participate poorly
200  * in the accessibility APIs, or not at all; however because of the intrusive nature of
201  * such snooping, it can have side-effects on certain older platforms.  If unconditional
202  * event notifications, even when inaccessible or "broken" applications have focus, are not
203  * required, it may be best to avoid this enum value/flag.
204  *
205  *Specified the tyupe of a key listener event.
206  * Certain of the values above can and should be bitwise-'OR'ed
207  * together, observing the compatibility limitations specified in the description of
208  * each value.  For instance, #SPI_KEYLISTENER_ALL_WINDOWS | #SPI_KEYLISTENER_CANCONSUME is
209  * a commonly used combination which gives the AT complete control over the delivery of matching
210  * events.  However, such filters should be used sparingly as they may have a negative impact on 
211  * system performance.
212  **/
213 typedef enum {
214   SPI_KEYLISTENER_NOSYNC = 0,
215   SPI_KEYLISTENER_SYNCHRONOUS = 1,
216   SPI_KEYLISTENER_CANCONSUME = 2,
217   SPI_KEYLISTENER_ALL_WINDOWS = 4
218 } AccessibleKeyListenerSyncType;
219
220
221 /**
222  *AccessibleStreamableContentSeekType
223  *@SPI_STREAM_SEEK_SET: seek from the 'top' of the streamable
224  *@SPI_STREAM_SEEK_CUR: seek from the current position in the stream
225  *@SPI_STREAM_SEEK_END: seek from the end of the stream (if known)
226  *
227  *The seek type for a specified offset in AccessibleStreamableContent_seek.
228  **/
229 typedef enum
230 {
231   SPI_STREAM_SEEK_SET,
232   SPI_STREAM_SEEK_CUR,
233   SPI_STREAM_SEEK_END
234 } AccessibleStreamableContentSeekType;
235
236 /**
237  * SPIException:
238  * @type: private
239  * @source: private
240  * @ev: private
241  * @code: private
242  * @desc: private
243  *
244  * An opaque object encapsulating information about thrown exceptions.
245  **/
246 typedef struct _SPIException SPIException;
247
248 /**
249  * SPIExceptionHandler:
250  * @err: points to the SPIException opaque object.
251  * @is_fatal: indicates whether the exception is a fatal error or not.
252  *
253  * A function type for functions to be called when exceptions occur.
254  *
255  * Returns 
256  **/
257 typedef SPIBoolean (*SPIExceptionHandler) (SPIException *err, SPIBoolean is_fatal);
258
259 /**
260  * SPIExceptionCode:
261  * @SPI_EXCEPTION_UNSPECIFIED: An exception of unknown type, or which doesn't fit the other types.
262  * @SPI_EXCEPTION_DISCONNECT: Communication with the object or service has been disconnected;
263  * this usually means that the object or service has died or exited.
264  * @SPI_EXCEPTION_NO_IMPL: The object or service is missing the implementation for a request.
265  * @SPI_EXCEPTION_IO: The communications channel has become corrupted, blocked, or is otherwise in a bad state.
266  * @SPI_EXCEPTION_BAD_DATA: The data received or sent over the interface has been identified as 
267  * improperly formatted or otherwise fails to match the expectations.
268  *
269  * Exception codes indicating what's gone wrong in an AT-SPI call.
270  **/
271 typedef enum {
272         SPI_EXCEPTION_UNSPECIFIED,
273         SPI_EXCEPTION_DISCONNECT,
274         SPI_EXCEPTION_NO_IMPL,
275         SPI_EXCEPTION_IO,
276         SPI_EXCEPTION_BAD_DATA
277 } SPIExceptionCode;
278
279 /**
280  * SPIExceptionType:
281  * @SPI_EXCEPTION_SOURCE_UNSPECIFIED: Don't know or can't tell where the problem is
282  * @SPI_EXCEPTION_SOURCE_ACCESSIBLE: The source of an event or query (i.e. an app) has thrown the exception.
283  * @SPI_EXCEPTION_SOURCE_REGISTRY: The AT-SPI registry has thrown the exception or cannot be reached.
284  * @SPI_EXCEPTION_SOURCE_DEVICE: The device event subsystem has encountered an error condition.
285  *
286  * The general source of the failure, i.e. whether the app, registry, or device system has encountered trouble.
287  **/
288 typedef enum {
289         SPI_EXCEPTION_SOURCE_UNSPECIFIED,
290         SPI_EXCEPTION_SOURCE_ACCESSIBLE,
291         SPI_EXCEPTION_SOURCE_REGISTRY,
292         SPI_EXCEPTION_SOURCE_DEVICE
293 } SPIExceptionType;
294
295 typedef unsigned long AccessibleKeyEventMask;
296 typedef unsigned long AccessibleDeviceEventMask;
297 /**
298  * SPIRect:
299  * @x: The position of the minimum x value of the rectangle (i.e. left hand corner)
300  * @y: The position of the minimum y value of the rectangle's bounds.
301  * @width: Width of the rectangle in pixels.
302  * @height: Height of the rectangle in pixels.
303  *
304  * A structure encapsulating a rectangle. 
305  **/
306 typedef struct {
307         long x;
308         long y;
309         long width;
310         long height;
311 } SPIRect;
312
313 /**
314  *AccessibleComponentLayer:
315  *@SPI_LAYER_INVALID: The layer cannot be determined or is somehow undefined.
316  *@SPI_LAYER_BACKGROUND: Component belongs to the destop background.
317  *@SPI_LAYER_CANVAS: Component is a canvas backdrop or drawing area.
318  *@SPI_LAYER_WIDGET: Component is a 'normal' widget.
319  *@SPI_LAYER_MDI: Component is drawn in the MDI layer and may have valid
320  *                         Z-information relative to other MDI-layer components.
321  *@SPI_LAYER_POPUP: Component is in the popup layer, above other widgets and
322  *                         MDI components.
323  *@SPI_LAYER_OVERLAY: Component is in the overlay plane - this value is reserved
324  *                         for future use.
325  *@SPI_LAYER_WINDOW: Component is in the window layer and have valid Z-information
326  *                   relative to other window-layer components.
327  *@SPI_LAYER_LAST_DEFINED: Used to determine the last valid value in the enum,
328  *                         should not be encountered.   
329  *
330  * Describes the layer of a component.
331  *
332  * These enumerated "layer values" are used when determining which UI
333  * rendering layer a component is drawn into, which can help in making
334  * determinations of when components occlude one another.
335  **/
336 typedef enum {
337     SPI_LAYER_INVALID,
338     SPI_LAYER_BACKGROUND,
339     SPI_LAYER_CANVAS,
340     SPI_LAYER_WIDGET,
341     SPI_LAYER_MDI,
342     SPI_LAYER_POPUP,
343     SPI_LAYER_OVERLAY,
344     SPI_LAYER_WINDOW,
345     SPI_LAYER_LAST_DEFINED      
346 } AccessibleComponentLayer;
347
348
349 /**
350  * AccessibleTextRange:
351  * @start: the first nominal character position within the range.
352  * @end: the first nominal character position following the range.
353  * @content: The actual text content between @start and @end, as a UTF-8 string.
354  *
355  * Structure which encapsulates a text range - must be associated with an
356  *          AccessibleText-implementing object.
357  **/
358 typedef struct _AccessibleTextRange
359 {
360   long int        start;
361   long int        end;
362   char           *contents;
363 } AccessibleTextRange;
364
365 /**
366  * AccessibleKeySet:
367  * @keysyms:
368  * @keycodes:
369  * @len:
370  *
371  * Structure containing identifying information about a set of keycode or
372  *        keysyms.
373  **/
374 typedef struct _AccessibleKeySet
375 {
376   unsigned long  *keysyms;
377   unsigned short *keycodes;
378   char          **keystrings;
379   short           len;
380 } AccessibleKeySet;
381
382 /*
383  * A special value for an AccessibleKeySet type, which tacitly
384  * includes all keycodes and keyvals for the specified modifier set.
385  */
386 #define SPI_KEYSET_ALL_KEYS NULL
387
388 typedef unsigned long AccessibleModifierMaskType;
389 /**
390  *AccessibleKeyMaskType:
391  *
392  *AccessibleKeyMaskType is a mask which is a set of key event modifiers
393  *which is specified in SPI_registerAccessibleKeystrokeListener.
394  **/
395
396 typedef AccessibleModifierMaskType AccessibleKeyMaskType;
397
398 typedef struct _AccessibleAttributeSet
399 {
400     int len;
401     char **attributes;
402 } AccessibleAttributeSet;
403
404 /* Basic SPI initialization and event loop function prototypes */
405
406 int              SPI_init         (void);
407 void             SPI_event_main   (void);
408 void             SPI_event_quit   (void);
409 SPIBoolean       SPI_eventIsReady (void);
410 AccessibleEvent *SPI_nextEvent    (SPIBoolean waitForEvent);
411 int              SPI_exit         (void);
412
413 /* Event Listener creation and support.  */
414
415 void                      SPI_freeAccessibleKeySet (
416                                                    AccessibleKeySet         *keyset);
417 AccessibleKeySet        * SPI_createAccessibleKeySet (
418                                                    int                       len,
419                                                    const char               *keysyms,
420                                                    short                    *keycodes,
421                                                    const char              **keystrings);
422 AccessibleEventListener * SPI_createAccessibleEventListener (
423                                                    AccessibleEventListenerCB callback,
424                                                    void                     *user_data);
425 SPIBoolean                AccessibleEventListener_addCallback (
426                                                    AccessibleEventListener  *listener,
427                                                    AccessibleEventListenerCB callback,
428                                                    void                     *user_data);
429 SPIBoolean                AccessibleEventListener_removeCallback (
430                                                    AccessibleEventListener  *listener,
431                                                    AccessibleEventListenerCB callback);
432 void                      AccessibleEventListener_unref (
433                                                    AccessibleEventListener  *listener);
434
435 /* Device Event Listener creation and support.  */
436
437 /* First four are deprecated in favor of the last four; really just a re-name */
438
439 AccessibleKeystrokeListener * SPI_createAccessibleKeystrokeListener (
440                                         AccessibleKeystrokeListenerCB callback,
441                                         void                         *user_data);
442 SPIBoolean                    AccessibleKeystrokeListener_addCallback (
443                                         AccessibleKeystrokeListener  *listener,
444                                         AccessibleKeystrokeListenerCB callback,
445                                         void                         *user_data);
446 SPIBoolean                    AccessibleKeystrokeListener_removeCallback (
447                                         AccessibleKeystrokeListener *listener,
448                                         AccessibleKeystrokeListenerCB callback);
449 void                          AccessibleKeystrokeListener_unref (
450                                         AccessibleKeystrokeListener *listener);
451
452 AccessibleDeviceListener   * SPI_createAccessibleDeviceListener (
453                                         AccessibleDeviceListenerCB callback,
454                                         void                      *user_data);
455 SPIBoolean                    AccessibleDeviceListener_addCallback (
456                                         AccessibleDeviceListener  *listener,
457                                         AccessibleDeviceListenerCB callback,
458                                         void                      *user_data);
459 SPIBoolean                    AccessibleDeviceListener_removeCallback (
460                                         AccessibleDeviceListener  *listener,
461                                         AccessibleDeviceListenerCB callback);
462 void                          AccessibleDeviceListener_unref (
463                                         AccessibleDeviceListener *listener);
464
465 /* Global functions serviced by the registry */
466
467 SPIBoolean SPI_registerGlobalEventListener           (
468                                        AccessibleEventListener *listener,
469                                        const char              *eventType);
470 SPIBoolean SPI_deregisterGlobalEventListener         (
471                                        AccessibleEventListener *listener,
472                                        const char              *eventType);
473 SPIBoolean SPI_deregisterGlobalEventListenerAll      (
474                                        AccessibleEventListener *listener);
475 SPIBoolean SPI_registerAccessibleKeystrokeListener   (
476                                        AccessibleKeystrokeListener *listener,
477                                        AccessibleKeySet             *keys,
478                                        AccessibleKeyMaskType         modmask,
479                                        AccessibleKeyEventMask        eventmask,
480                                        AccessibleKeyListenerSyncType sync_type);
481 SPIBoolean SPI_deregisterAccessibleKeystrokeListener (
482                                        AccessibleKeystrokeListener *listener,
483                                        AccessibleKeyMaskType        modmask);
484
485 SPIBoolean SPI_registerDeviceEventListener   (
486                                        AccessibleDeviceListener   *listener,
487                                        AccessibleDeviceEventMask   eventmask,
488                                        void                       *filter);
489 SPIBoolean SPI_deregisterDeviceEventListener (
490                                        AccessibleDeviceListener   *listener,
491                                        void                       *filter);
492
493 int         SPI_getDesktopCount                  (void);
494 Accessible *SPI_getDesktop                       (int i);
495 int         SPI_getDesktopList                   (Accessible ***desktop_list);
496 void        SPI_freeDesktopList                  (Accessible  **desktop_list);
497
498 SPIBoolean  SPI_generateKeyboardEvent            (long int                    keyval,
499                                                   char                       *keystring,
500                                                   AccessibleKeySynthType      synth_type);
501
502 SPIBoolean  SPI_generateMouseEvent               (long int x, long int y, char *name);
503
504 /* Accessible function prototypes  */
505
506 void                 Accessible_ref              (Accessible *obj);
507 void                 Accessible_unref            (Accessible *obj);
508 char *               Accessible_getName          (Accessible *obj);
509 char *               Accessible_getDescription   (Accessible *obj);
510 Accessible *         Accessible_getParent        (Accessible *obj);
511 long                 Accessible_getChildCount    (Accessible *obj);
512 Accessible *         Accessible_getChildAtIndex  (Accessible *obj,
513                                                   long int    childIndex);
514 long                 Accessible_getIndexInParent (Accessible *obj);
515 AccessibleRelation **Accessible_getRelationSet   (Accessible *obj);
516 AccessibleRole       Accessible_getRole          (Accessible *obj);
517 char *               Accessible_getRoleName      (Accessible *obj);
518 char *               Accessible_getLocalizedRoleName (Accessible *obj);
519 AccessibleStateSet * Accessible_getStateSet      (Accessible *obj);
520 AccessibleAttributeSet *Accessible_getAttributes (Accessible *obj);
521 AccessibleApplication *Accessible_getHostApplication (Accessible *obj);
522
523 /* Interface query methods */
524
525 SPIBoolean Accessible_isAction            (Accessible *obj);
526 SPIBoolean Accessible_isApplication       (Accessible *obj);
527 SPIBoolean Accessible_isComponent         (Accessible *obj);
528 SPIBoolean Accessible_isDocument          (Accessible *obj);
529 SPIBoolean Accessible_isEditableText      (Accessible *obj);
530 SPIBoolean Accessible_isHypertext         (Accessible *obj);
531 SPIBoolean Accessible_isImage             (Accessible *obj);
532 SPIBoolean Accessible_isSelection         (Accessible *obj);
533 SPIBoolean Accessible_isStreamableContent (Accessible *obj);
534 SPIBoolean Accessible_isTable             (Accessible *obj);
535 SPIBoolean Accessible_isText              (Accessible *obj);
536 SPIBoolean Accessible_isValue             (Accessible *obj);
537
538 AccessibleAction *            Accessible_getAction            (Accessible *obj);
539 AccessibleApplication *       Accessible_getApplication       (Accessible *obj);
540 AccessibleComponent *         Accessible_getComponent         (Accessible *obj);
541 AccessibleDocument *          Accessible_getDocument          (Accessible *obj);
542 AccessibleEditableText *      Accessible_getEditableText      (Accessible *obj);
543 AccessibleHypertext *         Accessible_getHypertext         (Accessible *obj);
544 AccessibleImage *             Accessible_getImage             (Accessible *obj);
545 AccessibleSelection *         Accessible_getSelection         (Accessible *obj);
546 AccessibleStreamableContent * Accessible_getStreamableContent (Accessible *obj);
547 AccessibleTable *             Accessible_getTable             (Accessible *obj);
548 AccessibleText *              Accessible_getText              (Accessible *obj);
549 AccessibleValue *             Accessible_getValue             (Accessible *obj);
550 AccessibleUnknown *           Accessible_queryInterface       (Accessible *obj,
551                                                    const char *interface_name);
552
553 /* AccessibleAction function prototypes  */
554
555 void       AccessibleAction_ref            (AccessibleAction *obj);
556 void       AccessibleAction_unref          (AccessibleAction *obj);
557 long       AccessibleAction_getNActions    (AccessibleAction *obj);
558 char      *AccessibleAction_getName        (AccessibleAction *obj,
559                                             long int          i);
560 char      *AccessibleAction_getDescription (AccessibleAction *obj,
561                                             long int          i);
562 SPIBoolean AccessibleAction_doAction       (AccessibleAction *obj,
563                                             long int          i);
564 char      *AccessibleAction_getKeyBinding  (AccessibleAction *obj,
565                                             long int          i);
566
567 /* AccessibleApplication function prototypes  */
568
569 void       AccessibleApplication_ref            (AccessibleApplication *obj);
570 void       AccessibleApplication_unref          (AccessibleApplication *obj);
571 char      *AccessibleApplication_getToolkitName (AccessibleApplication *obj);
572 char      *AccessibleApplication_getVersion     (AccessibleApplication *obj);
573 long       AccessibleApplication_getID          (AccessibleApplication *obj);
574 char      *AccessibleApplication_getLocale      (AccessibleApplication *obj, int lc_category);
575 SPIBoolean AccessibleApplication_pause          (AccessibleApplication *obj);
576 SPIBoolean AccessibleApplication_resume         (AccessibleApplication *obj);
577
578 /* AccessibleComponent function prototypes */
579
580 void        AccessibleComponent_ref         (AccessibleComponent *obj);
581 void        AccessibleComponent_unref       (AccessibleComponent *obj);
582 SPIBoolean  AccessibleComponent_contains    (AccessibleComponent *obj,
583                                              long int             x,
584                                              long int             y,
585                                              AccessibleCoordType  ctype);
586 Accessible *AccessibleComponent_getAccessibleAtPoint (
587                                              AccessibleComponent *obj,
588                                              long int             x,
589                                              long int             y,
590                                              AccessibleCoordType  ctype);
591 void        AccessibleComponent_getExtents  (AccessibleComponent *obj,
592                                              long int            *x,
593                                              long int            *y,
594                                              long int            *width,
595                                              long int            *height,
596                                              AccessibleCoordType  ctype);
597 void        AccessibleComponent_getPosition (AccessibleComponent *obj,
598                                              long int            *x,
599                                              long int            *y,
600                                              AccessibleCoordType  ctype);
601 void        AccessibleComponent_getSize     (AccessibleComponent *obj,
602                                              long int            *width,
603                                              long int            *height);
604 AccessibleComponentLayer
605             AccessibleComponent_getLayer    (AccessibleComponent *obj);
606 SPIBoolean  AccessibleComponent_grabFocus   (AccessibleComponent *obj);
607 short       AccessibleComponent_getMDIZOrder(AccessibleComponent *obj);
608 double      AccessibleComponent_getAlpha    (AccessibleComponent *obj);
609
610 /* AccessibleDocument function prototypes  */
611
612 void        AccessibleDocument_ref               (AccessibleDocument *obj);
613 void        AccessibleDocument_unref             (AccessibleDocument *obj);
614 char       *AccessibleDocument_getLocale         (AccessibleDocument *obj);
615 char       *AccessibleDocument_getAttributeValue (AccessibleDocument *obj,
616                                                   char *attribute);
617 AccessibleAttributeSet *AccessibleDocument_getAttributes     (AccessibleDocument *obj);
618
619 /* AccessibleEditableText function prototypes  */
620
621 void
622 AccessibleEditableText_ref (AccessibleEditableText *obj);
623
624 void
625 AccessibleEditableText_unref (AccessibleEditableText *obj);
626
627 SPIBoolean
628 AccessibleEditableText_setAttributes (AccessibleEditableText *obj,
629                                       const char *attributes,
630                                       long int startOffset,
631                                       long int endOffset);
632
633 SPIBoolean
634 AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
635                                         const char *newContents);
636
637 SPIBoolean
638 AccessibleEditableText_insertText (AccessibleEditableText *obj,
639                                    long int position,
640                                    const char *text,
641                                    long int length);
642
643 SPIBoolean
644 AccessibleEditableText_copyText (AccessibleText *obj,
645                                  long int startPos,
646                                  long int endPos);
647
648 SPIBoolean
649 AccessibleEditableText_cutText (AccessibleEditableText *obj,
650                                 long int startPos,
651                                 long int endPos);
652
653 SPIBoolean
654 AccessibleEditableText_deleteText (AccessibleEditableText *obj,
655                                    long int startPos,
656                                    long int endPos);
657
658 SPIBoolean
659 AccessibleEditableText_pasteText (AccessibleEditableText *obj,
660                                   long int position);
661
662 /*
663  *
664  * AccessibleHyperlink function prototypes
665  *
666  */
667 void
668 AccessibleHyperlink_ref (AccessibleHyperlink *obj);
669 void
670 AccessibleHyperlink_unref (AccessibleHyperlink *obj);
671
672 long
673 AccessibleHyperlink_getNAnchors (AccessibleHyperlink *obj);
674
675 char *
676 AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
677                             long int i);
678
679 Accessible *
680 AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
681                                long int i);
682
683 void
684 AccessibleHyperlink_getIndexRange (AccessibleHyperlink *obj,
685                                    long int *startIndex,
686                                    long int *endIndex);
687
688 SPIBoolean
689 AccessibleHyperlink_isValid (AccessibleHyperlink *obj);
690
691 /*
692  *
693  * AccessibleHypertext function prototypes
694  *
695  */
696
697 void
698 AccessibleHypertext_ref (AccessibleHypertext *obj);
699
700 void
701 AccessibleHypertext_unref (AccessibleHypertext *obj);
702
703 long
704 AccessibleHypertext_getNLinks (AccessibleHypertext *obj);
705
706 AccessibleHyperlink *
707 AccessibleHypertext_getLink (AccessibleHypertext *obj,
708                              long int linkIndex);
709
710 long
711 AccessibleHypertext_getLinkIndex (AccessibleHypertext *obj,
712                                   long int characterOffset);
713
714 /*
715  *
716  * AccessibleImage function prototypes
717  *
718  */
719
720 void
721 AccessibleImage_ref (AccessibleImage *obj);
722
723 void
724 AccessibleImage_unref (AccessibleImage *obj);
725
726 char *
727 AccessibleImage_getImageDescription (AccessibleImage *obj);
728
729 void
730 AccessibleImage_getImageSize (AccessibleImage *obj,
731                               long int *width,
732                               long int *height);
733
734 void
735 AccessibleImage_getImagePosition (AccessibleImage *obj,
736                                   long int *x,
737                                   long int *y,
738                                   AccessibleCoordType ctype);
739
740 void
741 AccessibleImage_getImageExtents (AccessibleImage *obj,
742                                  long int *x,
743                                  long int *y,
744                                  long int *width,
745                                  long int *height,
746                                  AccessibleCoordType ctype);
747 char *
748 AccessibleImage_getImageLocale  (AccessibleImage *obj);
749
750 /*
751  *
752  * AccessibleRelation function prototypes
753  *
754  */
755
756 void AccessibleRelation_ref   (AccessibleRelation *obj);
757 void AccessibleRelation_unref (AccessibleRelation *obj);
758
759 AccessibleRelationType
760 AccessibleRelation_getRelationType (AccessibleRelation *obj);
761
762 int
763 AccessibleRelation_getNTargets (AccessibleRelation *obj);
764
765 Accessible *
766 AccessibleRelation_getTarget (AccessibleRelation *obj, int i);
767
768
769 /*
770  *
771  * AccessibleSelection function prototypes
772  *
773  */
774
775 void AccessibleSelection_ref   (AccessibleSelection *obj);
776 void AccessibleSelection_unref (AccessibleSelection *obj);
777
778 long
779 AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj);
780
781 Accessible *
782 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
783                                       long int selectedChildIndex);
784
785 SPIBoolean
786 AccessibleSelection_selectChild (AccessibleSelection *obj,
787                                  long int childIndex);
788
789 SPIBoolean
790 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
791                                            long int selectedChildIndex);
792
793 SPIBoolean
794 AccessibleSelection_deselectChild (AccessibleSelection *obj,
795                                    long int childIndex);
796
797 SPIBoolean
798 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
799                                      long int childIndex);
800
801 SPIBoolean
802 AccessibleSelection_selectAll (AccessibleSelection *obj);
803
804 SPIBoolean
805 AccessibleSelection_clearSelection (AccessibleSelection *obj);
806
807
808 /*
809  *
810  * AccessibleStateSet function prototypes
811  *
812  */
813
814 void AccessibleStateSet_ref   (AccessibleStateSet *obj);
815 void AccessibleStateSet_unref (AccessibleStateSet *obj);
816
817 SPIBoolean
818 AccessibleStateSet_contains (AccessibleStateSet *obj,
819                              AccessibleState state);
820
821 void
822 AccessibleStateSet_add (AccessibleStateSet *obj,
823                         AccessibleState state);
824
825 void
826 AccessibleStateSet_remove (AccessibleStateSet *obj,
827                            AccessibleState state);
828
829 SPIBoolean
830 AccessibleStateSet_equals (AccessibleStateSet *obj,
831                            AccessibleStateSet *obj2);
832
833 AccessibleStateSet *
834 AccessibleStateSet_compare (AccessibleStateSet *obj,
835                             AccessibleStateSet *obj2);
836
837 SPIBoolean
838 AccessibleStateSet_isEmpty (AccessibleStateSet *obj);
839
840 void
841 AccessibleStreamableContent_ref (AccessibleStreamableContent *obj);
842 void
843 AccessibleStreamableContent_unref (AccessibleStreamableContent *obj);
844 char **
845 AccessibleStreamableContent_getContentTypes (AccessibleStreamableContent *obj);
846
847 void
848 AccessibleStreamableContent_freeContentTypesList (AccessibleStreamableContent *obj,
849                                                  char **content_types);
850 #define AccessibleStreamableContent_freeContentTypeList(a, b) AccessibleStreamableContent_freeContentTypesList(a,b)
851
852 SPIBoolean
853 AccessibleStreamableContent_open (AccessibleStreamableContent *obj,
854                                   const char *content_type);
855 SPIBoolean
856 AccessibleStreamableContent_close (AccessibleStreamableContent *obj);
857
858 long
859 AccessibleStreamableContent_seek (AccessibleStreamableContent *obj,
860                                   long int offset,
861                                   AccessibleStreamableContentSeekType seek_type);
862 SPIBoolean
863 AccessibleStreamableContent_read (AccessibleStreamableContent *obj,
864                                   void *buff,
865                                   long int nbytes,
866                                   unsigned int read_type);
867 /*
868  *
869  * AccessibleTable function prototypes
870  *
871  */
872
873 void AccessibleTable_ref   (AccessibleTable *obj);
874 void AccessibleTable_unref (AccessibleTable *obj);
875
876 Accessible *
877 AccessibleTable_getCaption (AccessibleTable *obj);
878
879 Accessible *
880 AccessibleTable_getSummary (AccessibleTable *obj);
881
882 long
883 AccessibleTable_getNRows (AccessibleTable *obj);
884
885 long
886 AccessibleTable_getNColumns (AccessibleTable *obj);
887
888 Accessible *
889 AccessibleTable_getAccessibleAt (AccessibleTable *obj,
890                                  long int row,
891                                  long int column);
892
893 long
894 AccessibleTable_getIndexAt (AccessibleTable *obj,
895                             long int row,
896                             long int column);
897
898 long
899 AccessibleTable_getRowAtIndex (AccessibleTable *obj,
900                                long int index);
901
902 long
903 AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
904                                   long int index);
905
906 char *
907 AccessibleTable_getRowDescription (AccessibleTable *obj,
908                                    long int row);
909
910 char *
911 AccessibleTable_getColumnDescription (AccessibleTable *obj,
912                                       long int column);
913
914 long
915 AccessibleTable_getRowExtentAt (AccessibleTable *obj,
916                                 long int row,
917                                 long int column);
918
919 long
920 AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
921                                    long int row,
922                                    long int column);
923
924 SPIBoolean
925 AccessibleTable_getRowColumnExtentsAtIndex (AccessibleTable *obj,
926                                             long int index, long int *row, long int *col, 
927                                             long int *row_extents, long int *col_extents, 
928                                             long int *is_selected);
929
930 Accessible *
931 AccessibleTable_getRowHeader (AccessibleTable *obj,
932                               long int row);
933
934 Accessible *
935 AccessibleTable_getColumnHeader (AccessibleTable *obj,
936                                  long int column);
937
938 long
939 AccessibleTable_getNSelectedRows (AccessibleTable *obj);
940
941 long
942 AccessibleTable_getSelectedRows (AccessibleTable *obj,
943                                  long int **selectedRows);
944
945 long
946 AccessibleTable_getNSelectedColumns (AccessibleTable *obj);
947
948 long
949 AccessibleTable_getSelectedColumns (AccessibleTable *obj,
950                                     long int **selectedColumns);
951
952 SPIBoolean
953 AccessibleTable_isRowSelected (AccessibleTable *obj,
954                                long int row);
955
956 SPIBoolean
957 AccessibleTable_isColumnSelected (AccessibleTable *obj,
958                                   long int column);
959
960 SPIBoolean
961 AccessibleTable_isSelected (AccessibleTable *obj,
962                             long int row,
963                             long int column);
964
965 SPIBoolean
966 AccessibleTable_addRowSelection (AccessibleTable *obj,
967                                  long int row);
968 SPIBoolean
969 AccessibleTable_addColumnSelection (AccessibleTable *obj,
970                                     long int column);
971
972 SPIBoolean
973 AccessibleTable_removeRowSelection (AccessibleTable *obj,
974                                     long int row);
975 SPIBoolean
976 AccessibleTable_removeColumnSelection (AccessibleTable *obj,
977                                        long int column);
978
979 /*
980  *
981  * AccessibleText function prototypes
982  *
983  */
984
985 void AccessibleText_ref   (AccessibleText *obj);
986 void AccessibleText_unref (AccessibleText *obj);
987
988 long
989 AccessibleText_getCharacterCount (AccessibleText *obj);
990
991 char *
992 AccessibleText_getText (AccessibleText *obj,
993                         long int startOffset,
994                         long int endOffset);
995
996 long
997 AccessibleText_getCaretOffset (AccessibleText *obj);
998
999 char *
1000 AccessibleText_getAttributes (AccessibleText *obj,
1001                                  long int offset,
1002                                  long int *startOffset,
1003                                  long int *endOffset);
1004
1005 char *
1006 AccessibleText_getDefaultAttributes (AccessibleText *obj);
1007
1008 SPIBoolean
1009 AccessibleText_setCaretOffset (AccessibleText *obj,
1010                                long int newOffset);
1011
1012 char *
1013 AccessibleText_getTextBeforeOffset (AccessibleText *obj,
1014                                     long int offset,
1015                                     AccessibleTextBoundaryType type,
1016                                     long int *startOffset,
1017                                     long int *endOffset);
1018
1019 char *
1020 AccessibleText_getTextAtOffset (AccessibleText *obj,
1021                                 long int offset,
1022                                 AccessibleTextBoundaryType type,
1023                                 long int *startOffset,
1024                                 long int *endOffset);
1025
1026 char *
1027 AccessibleText_getTextAfterOffset (AccessibleText *obj,
1028                                    long int offset,
1029                                    AccessibleTextBoundaryType type,
1030                                    long int *startOffset,
1031                                    long int *endOffset);
1032
1033 unsigned long
1034 AccessibleText_getCharacterAtOffset (AccessibleText *obj,
1035                                      long int offset);
1036
1037 void
1038 AccessibleText_getCharacterExtents (AccessibleText *obj,
1039                                     long int offset,
1040                                     long int *x,
1041                                     long int *y,
1042                                     long int *width,
1043                                     long int *height,
1044                                     AccessibleCoordType type);
1045
1046 void
1047 AccessibleText_getRangeExtents (AccessibleText *obj,
1048                                 long int startOffset,
1049                                 long int endOffset,
1050                                 long int *x,
1051                                 long int *y,
1052                                 long int *width,
1053                                 long int *height,
1054                                 AccessibleCoordType type);
1055
1056 AccessibleTextRange **
1057 AccessibleText_getBoundedRanges (AccessibleText *obj,
1058                                  long int x,
1059                                  long int y,
1060                                  long int width,
1061                                  long int height,
1062                                  AccessibleCoordType type,
1063                                  AccessibleTextClipType clipTypeX,
1064                                  AccessibleTextClipType clipTypeY);
1065
1066 void
1067 AccessibleTextRange_freeRanges (AccessibleTextRange **ranges);
1068
1069 long
1070 AccessibleText_getOffsetAtPoint (AccessibleText *obj,
1071                                  long int x,
1072                                  long int y,
1073                                  AccessibleCoordType type);
1074
1075 long
1076 AccessibleText_getNSelections (AccessibleText *obj);
1077
1078 void
1079 AccessibleText_getSelection (AccessibleText *obj,
1080                              long int selectionNum,
1081                              long int *startOffset,
1082                              long int *endOffset);
1083
1084
1085 SPIBoolean
1086 AccessibleText_addSelection (AccessibleText *obj,
1087                              long int startOffset,
1088                              long int endOffset);
1089
1090 SPIBoolean
1091 AccessibleText_removeSelection (AccessibleText *obj,
1092                                 long int selectionNum);
1093
1094 SPIBoolean
1095 AccessibleText_setSelection (AccessibleText *obj,
1096                              long int selectionNum,
1097                              long int startOffset,
1098                              long int endOffset);
1099 AccessibleAttributeSet *
1100 AccessibleText_getAttributeRun  (AccessibleText *obj,
1101                                  long int offset,
1102                                  long int *startOffset,
1103                                  long int *endOffset,
1104                                  long int includeDefaults);
1105 AccessibleAttributeSet *
1106 AccessibleText_getDefaultAttributeSet (AccessibleText *obj);
1107
1108 /* AccessibleValue Function Prototypes:  */
1109
1110 void       AccessibleValue_ref             (AccessibleValue *obj);
1111 void       AccessibleValue_unref           (AccessibleValue *obj);
1112 double     AccessibleValue_getMinimumValue (AccessibleValue *obj);
1113 double     AccessibleValue_getCurrentValue (AccessibleValue *obj);
1114 double     AccessibleValue_getMaximumValue (AccessibleValue *obj);
1115 SPIBoolean AccessibleValue_setCurrentValue (AccessibleValue *obj,
1116                                             double           newValue);
1117 double     AccessibleValue_getMinimumIncrement (AccessibleValue *obj);
1118
1119 /* Persistance and lifecycle control for AccessibleEvents. */
1120 SPIBoolean AccessibleEvent_ref (const AccessibleEvent *e);
1121 void AccessibleEvent_unref (const AccessibleEvent *e);
1122
1123 /*
1124  * Prototypes for accessor functions, to obtain context
1125  * information for accessible events.
1126  */
1127
1128 char*                  AccessibleEvent_getSourceName (const AccessibleEvent *e);
1129 AccessibleRole         AccessibleEvent_getSourceRole (const AccessibleEvent *e);
1130 AccessibleApplication* AccessibleEvent_getSourceApplication (const AccessibleEvent *e);
1131 SPIBoolean             AccessibleEvent_getSourceDetails (const AccessibleEvent *e, char **name, 
1132                                                          AccessibleRole *role, 
1133                                                          AccessibleApplication **app);
1134
1135 char*        AccessibleTextChangedEvent_getChangeString (const AccessibleEvent *e);
1136 Accessible * AccessibleChildChangedEvent_getChildAccessible (const AccessibleEvent *e);
1137
1138 Accessible * AccessibleParentChangedEvent_getParentAccessible (const AccessibleEvent *e);
1139
1140 char*        AccessibleTextSelectionChangedEvent_getSelectionString (const AccessibleEvent *e);
1141
1142 char*        AccessibleWindowEvent_getTitleString (const AccessibleEvent *e);
1143
1144 Accessible * AccessibleActiveDescendantChangedEvent_getActiveDescendant (const AccessibleEvent *e);
1145
1146 Accessible * AccessibleTableSummaryChangedEvent_getSummaryAccessible (const AccessibleEvent *e); 
1147
1148 Accessible * AccessibleTableHeaderChangedEvent_getHeaderAccessible (const AccessibleEvent *e);
1149
1150 char *       AccessibleTableCaptionChangedEvent_getCaptionString (const AccessibleEvent *e);
1151
1152 char *       AccessibleTableRowDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e);
1153
1154 char *       AccessibleTableColumnDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e);
1155
1156 char *       AccessibleDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e);
1157
1158 char *       AccessibleNameChangedEvent_getNameString (const AccessibleEvent *e);
1159 SPIRect *    AccessibleBoundsChangedEvent_getNewBounds (const AccessibleEvent *e);
1160
1161 /* Misc methods and error handling */
1162 void SPI_freeString (char *s);
1163
1164 char* SPI_dupString (char *s);
1165
1166 void SPI_freeRect (SPIRect *r);
1167
1168 SPIBoolean SPI_exceptionHandlerPush (SPIExceptionHandler *handler);
1169
1170 SPIExceptionHandler* SPI_exceptionHandlerPop (void);
1171
1172 SPIExceptionType SPIException_getSourceType (SPIException *err);
1173
1174 SPIExceptionCode SPIException_getExceptionCode (SPIException *err);
1175
1176 Accessible* SPIAccessibleException_getSource (SPIException *err);
1177
1178 char* SPIException_getDescription (SPIException *err);
1179
1180 #ifdef  __cplusplus
1181 }
1182 #endif
1183
1184 #endif