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