2007-03-29 Ariel Rios <ariel@gnu.org>
[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 typedef struct _AccessibleRoleSet
405 {
406      int len;
407      AccessibleRole *roles;
408 } AccessibleRoleSet;
409
410
411 /* Basic SPI initialization and event loop function prototypes */
412
413 int              SPI_init         (void);
414 void             SPI_event_main   (void);
415 void             SPI_event_quit   (void);
416 SPIBoolean       SPI_eventIsReady (void);
417 AccessibleEvent *SPI_nextEvent    (SPIBoolean waitForEvent);
418 int              SPI_exit         (void);
419
420 /* Event Listener creation and support.  */
421
422 void                      SPI_freeAccessibleKeySet (
423                                                    AccessibleKeySet         *keyset);
424 AccessibleKeySet        * SPI_createAccessibleKeySet (
425                                                    int                       len,
426                                                    const char               *keysyms,
427                                                    short                    *keycodes,
428                                                    const char              **keystrings);
429 AccessibleEventListener * SPI_createAccessibleEventListener (
430                                                    AccessibleEventListenerCB callback,
431                                                    void                     *user_data);
432 SPIBoolean                AccessibleEventListener_addCallback (
433                                                    AccessibleEventListener  *listener,
434                                                    AccessibleEventListenerCB callback,
435                                                    void                     *user_data);
436 SPIBoolean                AccessibleEventListener_removeCallback (
437                                                    AccessibleEventListener  *listener,
438                                                    AccessibleEventListenerCB callback);
439 void                      AccessibleEventListener_unref (
440                                                    AccessibleEventListener  *listener);
441
442 /* Device Event Listener creation and support.  */
443
444 /* First four are deprecated in favor of the last four; really just a re-name */
445
446 AccessibleKeystrokeListener * SPI_createAccessibleKeystrokeListener (
447                                         AccessibleKeystrokeListenerCB callback,
448                                         void                         *user_data);
449 SPIBoolean                    AccessibleKeystrokeListener_addCallback (
450                                         AccessibleKeystrokeListener  *listener,
451                                         AccessibleKeystrokeListenerCB callback,
452                                         void                         *user_data);
453 SPIBoolean                    AccessibleKeystrokeListener_removeCallback (
454                                         AccessibleKeystrokeListener *listener,
455                                         AccessibleKeystrokeListenerCB callback);
456 void                          AccessibleKeystrokeListener_unref (
457                                         AccessibleKeystrokeListener *listener);
458
459 AccessibleDeviceListener   * SPI_createAccessibleDeviceListener (
460                                         AccessibleDeviceListenerCB callback,
461                                         void                      *user_data);
462 SPIBoolean                    AccessibleDeviceListener_addCallback (
463                                         AccessibleDeviceListener  *listener,
464                                         AccessibleDeviceListenerCB callback,
465                                         void                      *user_data);
466 SPIBoolean                    AccessibleDeviceListener_removeCallback (
467                                         AccessibleDeviceListener  *listener,
468                                         AccessibleDeviceListenerCB callback);
469 void                          AccessibleDeviceListener_unref (
470                                         AccessibleDeviceListener *listener);
471
472 /* Global functions serviced by the registry */
473
474 SPIBoolean SPI_registerGlobalEventListener           (
475                                        AccessibleEventListener *listener,
476                                        const char              *eventType);
477 SPIBoolean SPI_deregisterGlobalEventListener         (
478                                        AccessibleEventListener *listener,
479                                        const char              *eventType);
480 SPIBoolean SPI_deregisterGlobalEventListenerAll      (
481                                        AccessibleEventListener *listener);
482 SPIBoolean SPI_registerAccessibleKeystrokeListener   (
483                                        AccessibleKeystrokeListener *listener,
484                                        AccessibleKeySet             *keys,
485                                        AccessibleKeyMaskType         modmask,
486                                        AccessibleKeyEventMask        eventmask,
487                                        AccessibleKeyListenerSyncType sync_type);
488 SPIBoolean SPI_deregisterAccessibleKeystrokeListener (
489                                        AccessibleKeystrokeListener *listener,
490                                        AccessibleKeyMaskType        modmask);
491
492 SPIBoolean SPI_registerDeviceEventListener   (
493                                        AccessibleDeviceListener   *listener,
494                                        AccessibleDeviceEventMask   eventmask,
495                                        void                       *filter);
496 SPIBoolean SPI_deregisterDeviceEventListener (
497                                        AccessibleDeviceListener   *listener,
498                                        void                       *filter);
499
500 int         SPI_getDesktopCount                  (void);
501 Accessible *SPI_getDesktop                       (int i);
502 int         SPI_getDesktopList                   (Accessible ***desktop_list);
503 void        SPI_freeDesktopList                  (Accessible  **desktop_list);
504
505 SPIBoolean  SPI_generateKeyboardEvent            (long int                    keyval,
506                                                   char                       *keystring,
507                                                   AccessibleKeySynthType      synth_type);
508
509 SPIBoolean  SPI_generateMouseEvent               (long int x, long int y, char *name);
510
511 /* Accessible function prototypes  */
512
513 void                 Accessible_ref              (Accessible *obj);
514 void                 Accessible_unref            (Accessible *obj);
515 char *               Accessible_getName          (Accessible *obj);
516 char *               Accessible_getDescription   (Accessible *obj);
517 Accessible *         Accessible_getParent        (Accessible *obj);
518 long                 Accessible_getChildCount    (Accessible *obj);
519 Accessible *         Accessible_getChildAtIndex  (Accessible *obj,
520                                                   long int    childIndex);
521 long                 Accessible_getIndexInParent (Accessible *obj);
522 AccessibleRelation **Accessible_getRelationSet   (Accessible *obj);
523 AccessibleRole       Accessible_getRole          (Accessible *obj);
524 char *               Accessible_getRoleName      (Accessible *obj);
525 char *               Accessible_getLocalizedRoleName (Accessible *obj);
526 AccessibleStateSet * Accessible_getStateSet      (Accessible *obj);
527 AccessibleAttributeSet *Accessible_getAttributes (Accessible *obj);
528 AccessibleApplication *Accessible_getHostApplication (Accessible *obj);
529
530 /* Interface query methods */
531
532 SPIBoolean Accessible_isAction            (Accessible *obj);
533 SPIBoolean Accessible_isApplication       (Accessible *obj);
534 SPIBoolean Accessible_isComponent         (Accessible *obj);
535 SPIBoolean Accessible_isDocument          (Accessible *obj);
536 SPIBoolean Accessible_isEditableText      (Accessible *obj);
537 SPIBoolean Accessible_isHypertext         (Accessible *obj);
538 SPIBoolean Accessible_isImage             (Accessible *obj);
539 SPIBoolean Accessible_isSelection         (Accessible *obj);
540 SPIBoolean Accessible_isStreamableContent (Accessible *obj);
541 SPIBoolean Accessible_isTable             (Accessible *obj);
542 SPIBoolean Accessible_isText              (Accessible *obj);
543 SPIBoolean Accessible_isValue             (Accessible *obj);
544
545 AccessibleAction *            Accessible_getAction            (Accessible *obj);
546 AccessibleApplication *       Accessible_getApplication       (Accessible *obj);
547 AccessibleComponent *         Accessible_getComponent         (Accessible *obj);
548 AccessibleDocument *          Accessible_getDocument          (Accessible *obj);
549 AccessibleEditableText *      Accessible_getEditableText      (Accessible *obj);
550 AccessibleHypertext *         Accessible_getHypertext         (Accessible *obj);
551 AccessibleImage *             Accessible_getImage             (Accessible *obj);
552 AccessibleSelection *         Accessible_getSelection         (Accessible *obj);
553 AccessibleStreamableContent * Accessible_getStreamableContent (Accessible *obj);
554 AccessibleTable *             Accessible_getTable             (Accessible *obj);
555 AccessibleText *              Accessible_getText              (Accessible *obj);
556 AccessibleValue *             Accessible_getValue             (Accessible *obj);
557 AccessibleUnknown *           Accessible_queryInterface       (Accessible *obj,
558                                                    const char *interface_name);
559
560 /* AccessibleAction function prototypes  */
561
562 void       AccessibleAction_ref            (AccessibleAction *obj);
563 void       AccessibleAction_unref          (AccessibleAction *obj);
564 long       AccessibleAction_getNActions    (AccessibleAction *obj);
565 char      *AccessibleAction_getName        (AccessibleAction *obj,
566                                             long int          i);
567 char      *AccessibleAction_getDescription (AccessibleAction *obj,
568                                             long int          i);
569 SPIBoolean AccessibleAction_doAction       (AccessibleAction *obj,
570                                             long int          i);
571 char      *AccessibleAction_getKeyBinding  (AccessibleAction *obj,
572                                             long int          i);
573
574 /* AccessibleApplication function prototypes  */
575
576 void       AccessibleApplication_ref            (AccessibleApplication *obj);
577 void       AccessibleApplication_unref          (AccessibleApplication *obj);
578 char      *AccessibleApplication_getToolkitName (AccessibleApplication *obj);
579 char      *AccessibleApplication_getVersion     (AccessibleApplication *obj);
580 long       AccessibleApplication_getID          (AccessibleApplication *obj);
581 char      *AccessibleApplication_getLocale      (AccessibleApplication *obj, int lc_category);
582 SPIBoolean AccessibleApplication_pause          (AccessibleApplication *obj);
583 SPIBoolean AccessibleApplication_resume         (AccessibleApplication *obj);
584
585 /* AccessibleComponent function prototypes */
586
587 void        AccessibleComponent_ref         (AccessibleComponent *obj);
588 void        AccessibleComponent_unref       (AccessibleComponent *obj);
589 SPIBoolean  AccessibleComponent_contains    (AccessibleComponent *obj,
590                                              long int             x,
591                                              long int             y,
592                                              AccessibleCoordType  ctype);
593 Accessible *AccessibleComponent_getAccessibleAtPoint (
594                                              AccessibleComponent *obj,
595                                              long int             x,
596                                              long int             y,
597                                              AccessibleCoordType  ctype);
598 void        AccessibleComponent_getExtents  (AccessibleComponent *obj,
599                                              long int            *x,
600                                              long int            *y,
601                                              long int            *width,
602                                              long int            *height,
603                                              AccessibleCoordType  ctype);
604 void        AccessibleComponent_getPosition (AccessibleComponent *obj,
605                                              long int            *x,
606                                              long int            *y,
607                                              AccessibleCoordType  ctype);
608 void        AccessibleComponent_getSize     (AccessibleComponent *obj,
609                                              long int            *width,
610                                              long int            *height);
611 AccessibleComponentLayer
612             AccessibleComponent_getLayer    (AccessibleComponent *obj);
613 SPIBoolean  AccessibleComponent_grabFocus   (AccessibleComponent *obj);
614 short       AccessibleComponent_getMDIZOrder(AccessibleComponent *obj);
615 double      AccessibleComponent_getAlpha    (AccessibleComponent *obj);
616
617 /* AccessibleDocument function prototypes  */
618
619 void        AccessibleDocument_ref               (AccessibleDocument *obj);
620 void        AccessibleDocument_unref             (AccessibleDocument *obj);
621 char       *AccessibleDocument_getLocale         (AccessibleDocument *obj);
622 char       *AccessibleDocument_getAttributeValue (AccessibleDocument *obj,
623                                                   char *attribute);
624 AccessibleAttributeSet *AccessibleDocument_getAttributes     (AccessibleDocument *obj);
625
626 /* AccessibleEditableText function prototypes  */
627
628 void
629 AccessibleEditableText_ref (AccessibleEditableText *obj);
630
631 void
632 AccessibleEditableText_unref (AccessibleEditableText *obj);
633
634 SPIBoolean
635 AccessibleEditableText_setAttributes (AccessibleEditableText *obj,
636                                       const char *attributes,
637                                       long int startOffset,
638                                       long int endOffset);
639
640 SPIBoolean
641 AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
642                                         const char *newContents);
643
644 SPIBoolean
645 AccessibleEditableText_insertText (AccessibleEditableText *obj,
646                                    long int position,
647                                    const char *text,
648                                    long int length);
649
650 SPIBoolean
651 AccessibleEditableText_copyText (AccessibleText *obj,
652                                  long int startPos,
653                                  long int endPos);
654
655 SPIBoolean
656 AccessibleEditableText_cutText (AccessibleEditableText *obj,
657                                 long int startPos,
658                                 long int endPos);
659
660 SPIBoolean
661 AccessibleEditableText_deleteText (AccessibleEditableText *obj,
662                                    long int startPos,
663                                    long int endPos);
664
665 SPIBoolean
666 AccessibleEditableText_pasteText (AccessibleEditableText *obj,
667                                   long int position);
668
669 /*
670  *
671  * AccessibleHyperlink function prototypes
672  *
673  */
674 void
675 AccessibleHyperlink_ref (AccessibleHyperlink *obj);
676 void
677 AccessibleHyperlink_unref (AccessibleHyperlink *obj);
678
679 long
680 AccessibleHyperlink_getNAnchors (AccessibleHyperlink *obj);
681
682 char *
683 AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
684                             long int i);
685
686 Accessible *
687 AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
688                                long int i);
689
690 void
691 AccessibleHyperlink_getIndexRange (AccessibleHyperlink *obj,
692                                    long int *startIndex,
693                                    long int *endIndex);
694
695 SPIBoolean
696 AccessibleHyperlink_isValid (AccessibleHyperlink *obj);
697
698 /*
699  *
700  * AccessibleHypertext function prototypes
701  *
702  */
703
704 void
705 AccessibleHypertext_ref (AccessibleHypertext *obj);
706
707 void
708 AccessibleHypertext_unref (AccessibleHypertext *obj);
709
710 long
711 AccessibleHypertext_getNLinks (AccessibleHypertext *obj);
712
713 AccessibleHyperlink *
714 AccessibleHypertext_getLink (AccessibleHypertext *obj,
715                              long int linkIndex);
716
717 long
718 AccessibleHypertext_getLinkIndex (AccessibleHypertext *obj,
719                                   long int characterOffset);
720
721 /*
722  *
723  * AccessibleImage function prototypes
724  *
725  */
726
727 void
728 AccessibleImage_ref (AccessibleImage *obj);
729
730 void
731 AccessibleImage_unref (AccessibleImage *obj);
732
733 char *
734 AccessibleImage_getImageDescription (AccessibleImage *obj);
735
736 void
737 AccessibleImage_getImageSize (AccessibleImage *obj,
738                               long int *width,
739                               long int *height);
740
741 void
742 AccessibleImage_getImagePosition (AccessibleImage *obj,
743                                   long int *x,
744                                   long int *y,
745                                   AccessibleCoordType ctype);
746
747 void
748 AccessibleImage_getImageExtents (AccessibleImage *obj,
749                                  long int *x,
750                                  long int *y,
751                                  long int *width,
752                                  long int *height,
753                                  AccessibleCoordType ctype);
754 char *
755 AccessibleImage_getImageLocale  (AccessibleImage *obj);
756
757 /*
758  *
759  * AccessibleRelation function prototypes
760  *
761  */
762
763 void AccessibleRelation_ref   (AccessibleRelation *obj);
764 void AccessibleRelation_unref (AccessibleRelation *obj);
765
766 AccessibleRelationType
767 AccessibleRelation_getRelationType (AccessibleRelation *obj);
768
769 int
770 AccessibleRelation_getNTargets (AccessibleRelation *obj);
771
772 Accessible *
773 AccessibleRelation_getTarget (AccessibleRelation *obj, int i);
774
775
776 /*
777  *
778  * AccessibleSelection function prototypes
779  *
780  */
781
782 void AccessibleSelection_ref   (AccessibleSelection *obj);
783 void AccessibleSelection_unref (AccessibleSelection *obj);
784
785 long
786 AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj);
787
788 Accessible *
789 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
790                                       long int selectedChildIndex);
791
792 SPIBoolean
793 AccessibleSelection_selectChild (AccessibleSelection *obj,
794                                  long int childIndex);
795
796 SPIBoolean
797 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
798                                            long int selectedChildIndex);
799
800 SPIBoolean
801 AccessibleSelection_deselectChild (AccessibleSelection *obj,
802                                    long int childIndex);
803
804 SPIBoolean
805 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
806                                      long int childIndex);
807
808 SPIBoolean
809 AccessibleSelection_selectAll (AccessibleSelection *obj);
810
811 SPIBoolean
812 AccessibleSelection_clearSelection (AccessibleSelection *obj);
813
814
815 /*
816  *
817  * AccessibleStateSet function prototypes
818  *
819  */
820
821 void AccessibleStateSet_ref   (AccessibleStateSet *obj);
822 void AccessibleStateSet_unref (AccessibleStateSet *obj);
823
824 SPIBoolean
825 AccessibleStateSet_contains (AccessibleStateSet *obj,
826                              AccessibleState state);
827
828 void
829 AccessibleStateSet_add (AccessibleStateSet *obj,
830                         AccessibleState state);
831
832 void
833 AccessibleStateSet_remove (AccessibleStateSet *obj,
834                            AccessibleState state);
835
836 SPIBoolean
837 AccessibleStateSet_equals (AccessibleStateSet *obj,
838                            AccessibleStateSet *obj2);
839
840 AccessibleStateSet *
841 AccessibleStateSet_compare (AccessibleStateSet *obj,
842                             AccessibleStateSet *obj2);
843
844 SPIBoolean
845 AccessibleStateSet_isEmpty (AccessibleStateSet *obj);
846
847 void
848 AccessibleStreamableContent_ref (AccessibleStreamableContent *obj);
849 void
850 AccessibleStreamableContent_unref (AccessibleStreamableContent *obj);
851 char **
852 AccessibleStreamableContent_getContentTypes (AccessibleStreamableContent *obj);
853
854 void
855 AccessibleStreamableContent_freeContentTypesList (AccessibleStreamableContent *obj,
856                                                  char **content_types);
857 #define AccessibleStreamableContent_freeContentTypeList(a, b) AccessibleStreamableContent_freeContentTypesList(a,b)
858
859 SPIBoolean
860 AccessibleStreamableContent_open (AccessibleStreamableContent *obj,
861                                   const char *content_type);
862 SPIBoolean
863 AccessibleStreamableContent_close (AccessibleStreamableContent *obj);
864
865 long
866 AccessibleStreamableContent_seek (AccessibleStreamableContent *obj,
867                                   long int offset,
868                                   AccessibleStreamableContentSeekType seek_type);
869 SPIBoolean
870 AccessibleStreamableContent_read (AccessibleStreamableContent *obj,
871                                   void *buff,
872                                   long int nbytes,
873                                   unsigned int read_type);
874 /*
875  *
876  * AccessibleTable function prototypes
877  *
878  */
879
880 void AccessibleTable_ref   (AccessibleTable *obj);
881 void AccessibleTable_unref (AccessibleTable *obj);
882
883 Accessible *
884 AccessibleTable_getCaption (AccessibleTable *obj);
885
886 Accessible *
887 AccessibleTable_getSummary (AccessibleTable *obj);
888
889 long
890 AccessibleTable_getNRows (AccessibleTable *obj);
891
892 long
893 AccessibleTable_getNColumns (AccessibleTable *obj);
894
895 Accessible *
896 AccessibleTable_getAccessibleAt (AccessibleTable *obj,
897                                  long int row,
898                                  long int column);
899
900 long
901 AccessibleTable_getIndexAt (AccessibleTable *obj,
902                             long int row,
903                             long int column);
904
905 long
906 AccessibleTable_getRowAtIndex (AccessibleTable *obj,
907                                long int index);
908
909 long
910 AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
911                                   long int index);
912
913 char *
914 AccessibleTable_getRowDescription (AccessibleTable *obj,
915                                    long int row);
916
917 char *
918 AccessibleTable_getColumnDescription (AccessibleTable *obj,
919                                       long int column);
920
921 long
922 AccessibleTable_getRowExtentAt (AccessibleTable *obj,
923                                 long int row,
924                                 long int column);
925
926 long
927 AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
928                                    long int row,
929                                    long int column);
930
931 SPIBoolean
932 AccessibleTable_getRowColumnExtentsAtIndex (AccessibleTable *obj,
933                                             long int index, long int *row, long int *col, 
934                                             long int *row_extents, long int *col_extents, 
935                                             long int *is_selected);
936
937 Accessible *
938 AccessibleTable_getRowHeader (AccessibleTable *obj,
939                               long int row);
940
941 Accessible *
942 AccessibleTable_getColumnHeader (AccessibleTable *obj,
943                                  long int column);
944
945 long
946 AccessibleTable_getNSelectedRows (AccessibleTable *obj);
947
948 long
949 AccessibleTable_getSelectedRows (AccessibleTable *obj,
950                                  long int **selectedRows);
951
952 long
953 AccessibleTable_getNSelectedColumns (AccessibleTable *obj);
954
955 long
956 AccessibleTable_getSelectedColumns (AccessibleTable *obj,
957                                     long int **selectedColumns);
958
959 SPIBoolean
960 AccessibleTable_isRowSelected (AccessibleTable *obj,
961                                long int row);
962
963 SPIBoolean
964 AccessibleTable_isColumnSelected (AccessibleTable *obj,
965                                   long int column);
966
967 SPIBoolean
968 AccessibleTable_isSelected (AccessibleTable *obj,
969                             long int row,
970                             long int column);
971
972 SPIBoolean
973 AccessibleTable_addRowSelection (AccessibleTable *obj,
974                                  long int row);
975 SPIBoolean
976 AccessibleTable_addColumnSelection (AccessibleTable *obj,
977                                     long int column);
978
979 SPIBoolean
980 AccessibleTable_removeRowSelection (AccessibleTable *obj,
981                                     long int row);
982 SPIBoolean
983 AccessibleTable_removeColumnSelection (AccessibleTable *obj,
984                                        long int column);
985
986 /*
987  *
988  * AccessibleText function prototypes
989  *
990  */
991
992 void AccessibleText_ref   (AccessibleText *obj);
993 void AccessibleText_unref (AccessibleText *obj);
994
995 long
996 AccessibleText_getCharacterCount (AccessibleText *obj);
997
998 char *
999 AccessibleText_getText (AccessibleText *obj,
1000                         long int startOffset,
1001                         long int endOffset);
1002
1003 long
1004 AccessibleText_getCaretOffset (AccessibleText *obj);
1005
1006 char *
1007 AccessibleText_getAttributes (AccessibleText *obj,
1008                                  long int offset,
1009                                  long int *startOffset,
1010                                  long int *endOffset);
1011
1012 char *
1013 AccessibleText_getDefaultAttributes (AccessibleText *obj);
1014
1015 SPIBoolean
1016 AccessibleText_setCaretOffset (AccessibleText *obj,
1017                                long int newOffset);
1018
1019 char *
1020 AccessibleText_getTextBeforeOffset (AccessibleText *obj,
1021                                     long int offset,
1022                                     AccessibleTextBoundaryType type,
1023                                     long int *startOffset,
1024                                     long int *endOffset);
1025
1026 char *
1027 AccessibleText_getTextAtOffset (AccessibleText *obj,
1028                                 long int offset,
1029                                 AccessibleTextBoundaryType type,
1030                                 long int *startOffset,
1031                                 long int *endOffset);
1032
1033 char *
1034 AccessibleText_getTextAfterOffset (AccessibleText *obj,
1035                                    long int offset,
1036                                    AccessibleTextBoundaryType type,
1037                                    long int *startOffset,
1038                                    long int *endOffset);
1039
1040 unsigned long
1041 AccessibleText_getCharacterAtOffset (AccessibleText *obj,
1042                                      long int offset);
1043
1044 void
1045 AccessibleText_getCharacterExtents (AccessibleText *obj,
1046                                     long int offset,
1047                                     long int *x,
1048                                     long int *y,
1049                                     long int *width,
1050                                     long int *height,
1051                                     AccessibleCoordType type);
1052
1053 void
1054 AccessibleText_getRangeExtents (AccessibleText *obj,
1055                                 long int startOffset,
1056                                 long int endOffset,
1057                                 long int *x,
1058                                 long int *y,
1059                                 long int *width,
1060                                 long int *height,
1061                                 AccessibleCoordType type);
1062
1063 AccessibleTextRange **
1064 AccessibleText_getBoundedRanges (AccessibleText *obj,
1065                                  long int x,
1066                                  long int y,
1067                                  long int width,
1068                                  long int height,
1069                                  AccessibleCoordType type,
1070                                  AccessibleTextClipType clipTypeX,
1071                                  AccessibleTextClipType clipTypeY);
1072
1073 void
1074 AccessibleTextRange_freeRanges (AccessibleTextRange **ranges);
1075
1076 long
1077 AccessibleText_getOffsetAtPoint (AccessibleText *obj,
1078                                  long int x,
1079                                  long int y,
1080                                  AccessibleCoordType type);
1081
1082 long
1083 AccessibleText_getNSelections (AccessibleText *obj);
1084
1085 void
1086 AccessibleText_getSelection (AccessibleText *obj,
1087                              long int selectionNum,
1088                              long int *startOffset,
1089                              long int *endOffset);
1090
1091
1092 SPIBoolean
1093 AccessibleText_addSelection (AccessibleText *obj,
1094                              long int startOffset,
1095                              long int endOffset);
1096
1097 SPIBoolean
1098 AccessibleText_removeSelection (AccessibleText *obj,
1099                                 long int selectionNum);
1100
1101 SPIBoolean
1102 AccessibleText_setSelection (AccessibleText *obj,
1103                              long int selectionNum,
1104                              long int startOffset,
1105                              long int endOffset);
1106 AccessibleAttributeSet *
1107 AccessibleText_getAttributeRun  (AccessibleText *obj,
1108                                  long int offset,
1109                                  long int *startOffset,
1110                                  long int *endOffset,
1111                                  long int includeDefaults);
1112 AccessibleAttributeSet *
1113 AccessibleText_getDefaultAttributeSet (AccessibleText *obj);
1114
1115 /* AccessibleValue Function Prototypes:  */
1116
1117 void       AccessibleValue_ref             (AccessibleValue *obj);
1118 void       AccessibleValue_unref           (AccessibleValue *obj);
1119 double     AccessibleValue_getMinimumValue (AccessibleValue *obj);
1120 double     AccessibleValue_getCurrentValue (AccessibleValue *obj);
1121 double     AccessibleValue_getMaximumValue (AccessibleValue *obj);
1122 SPIBoolean AccessibleValue_setCurrentValue (AccessibleValue *obj,
1123                                             double           newValue);
1124 double     AccessibleValue_getMinimumIncrement (AccessibleValue *obj);
1125
1126 /* Persistance and lifecycle control for AccessibleEvents. */
1127 SPIBoolean AccessibleEvent_ref (const AccessibleEvent *e);
1128 void AccessibleEvent_unref (const AccessibleEvent *e);
1129
1130 /*
1131  * Prototypes for accessor functions, to obtain context
1132  * information for accessible events.
1133  */
1134
1135 char*                  AccessibleEvent_getSourceName (const AccessibleEvent *e);
1136 AccessibleRole         AccessibleEvent_getSourceRole (const AccessibleEvent *e);
1137 AccessibleApplication* AccessibleEvent_getSourceApplication (const AccessibleEvent *e);
1138 SPIBoolean             AccessibleEvent_getSourceDetails (const AccessibleEvent *e, char **name, 
1139                                                          AccessibleRole *role, 
1140                                                          AccessibleApplication **app);
1141
1142 char*        AccessibleTextChangedEvent_getChangeString (const AccessibleEvent *e);
1143 Accessible * AccessibleChildChangedEvent_getChildAccessible (const AccessibleEvent *e);
1144
1145 Accessible * AccessibleParentChangedEvent_getParentAccessible (const AccessibleEvent *e);
1146
1147 char*        AccessibleTextSelectionChangedEvent_getSelectionString (const AccessibleEvent *e);
1148
1149 char*        AccessibleWindowEvent_getTitleString (const AccessibleEvent *e);
1150
1151 Accessible * AccessibleActiveDescendantChangedEvent_getActiveDescendant (const AccessibleEvent *e);
1152
1153 Accessible * AccessibleTableSummaryChangedEvent_getSummaryAccessible (const AccessibleEvent *e); 
1154
1155 Accessible * AccessibleTableHeaderChangedEvent_getHeaderAccessible (const AccessibleEvent *e);
1156
1157 char *       AccessibleTableCaptionChangedEvent_getCaptionString (const AccessibleEvent *e);
1158
1159 char *       AccessibleTableRowDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e);
1160
1161 char *       AccessibleTableColumnDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e);
1162
1163 char *       AccessibleDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e);
1164
1165 char *       AccessibleNameChangedEvent_getNameString (const AccessibleEvent *e);
1166 SPIRect *    AccessibleBoundsChangedEvent_getNewBounds (const AccessibleEvent *e);
1167
1168 /* Misc methods and error handling */
1169 void SPI_freeString (char *s);
1170
1171 char* SPI_dupString (char *s);
1172
1173 void SPI_freeRect (SPIRect *r);
1174
1175 SPIBoolean SPI_exceptionHandlerPush (SPIExceptionHandler *handler);
1176
1177 SPIExceptionHandler* SPI_exceptionHandlerPop (void);
1178
1179 SPIExceptionType SPIException_getSourceType (SPIException *err);
1180
1181 SPIExceptionCode SPIException_getExceptionCode (SPIException *err);
1182
1183 Accessible* SPIAccessibleException_getSource (SPIException *err);
1184
1185 char* SPIException_getDescription (SPIException *err);
1186
1187 #ifdef  __cplusplus
1188 }
1189 #endif
1190
1191 #endif