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