4 #include <cspi/spi-impl.h>
6 * Definitions for AccessibleRole, AccessibleState,
7 * AccessibleEvent, and event listeners.
9 #include <cspi/spi-roletypes.h>
10 #include <cspi/spi-statetypes.h>
11 #include <cspi/spi-listener.h>
14 * Auxiliary typedefs and mask definitions
16 #include <libspi/keymasks.h>
23 * Enumerated type for text boundary types
27 SPI_TEXT_BOUNDARY_CHAR,
28 SPI_TEXT_BOUNDARY_CURSOR_POS,
29 SPI_TEXT_BOUNDARY_WORD_START,
30 SPI_TEXT_BOUNDARY_WORD_END,
31 SPI_TEXT_BOUNDARY_SENTENCE_START,
32 SPI_TEXT_BOUNDARY_SENTENCE_END,
33 SPI_TEXT_BOUNDARY_LINE_START,
34 SPI_TEXT_BOUNDARY_LINE_END,
35 SPI_TEXT_BOUNDARY_ATTRIBUTE_RANGE
36 } AccessibleTextBoundaryType;
40 * Enumerated type for relation types
46 SPI_RELATION_LABEL_FOR,
47 SPI_RELATION_LABELED_BY,
48 SPI_RELATION_CONTROLLER_FOR,
49 SPI_RELATION_CONTROLLED_BY,
50 SPI_RELATION_MEMBER_OF
51 } AccessibleRelationType;
54 /* don't change the order of these ! */
56 SPI_COORD_TYPE_SCREEN,
58 } AccessibleCoordType;
65 } AccessibleKeySynthType;
68 SPI_KEYLISTENER_NOSYNC = 0,
69 SPI_KEYLISTENER_SYNCHRONOUS = 1,
70 SPI_KEYLISTENER_CANCONSUME = 2,
71 SPI_KEYLISTENER_ALL_WINDOWS = 4
72 } AccessibleKeyListenerSyncType;
74 typedef unsigned long AccessibleKeyEventMask;
77 * AccessibleComponentLayer:
78 * @SPI_LAYER_INVALID: The layer cannot be determined or is somehow undefined.
79 * @SPI_LAYER_BACKGROUND: Component belongs to the destop background.
80 * @SPI_LAYER_CANVAS: Component is a canvas backdrop or drawing area.
81 * @SPI_LAYER_WIDGET: Component is a 'normal' widget.
82 * @SPI_LAYER_MDI: Component is drawn in the MDI layer and may have valid
83 * Z-information relative to other MDI-layer components.
84 * @SPI_LAYER_POPUP: Component is in the popup layer, above other widgets and
86 * @SPI_LAYER_OVERLAY: Component is in the overlay plane - this value is reserved
88 * @SPI_LAYER_LAST_DEFINED: Used to determine the last valid value in the enum,
89 * should not be encountered.
99 SPI_LAYER_LAST_DEFINED
100 } AccessibleComponentLayer;
109 * Structure containing identifying information about a set of keycode or
112 typedef struct _AccessibleKeySet
114 unsigned long *keysyms;
115 unsigned short *keycodes;
120 * SPI_KEYSET_ALL_KEYS:
121 * @SPI_KEYSET_ALL_KEYS: A special value for an AccessibleKeySet type, which tacitly
122 * includes all keycodes and keyvals for the specified modifier set.
124 #define SPI_KEYSET_ALL_KEYS NULL
126 typedef unsigned long AccessibleKeyMaskType;
129 /* Basic SPI initialization and event loop function prototypes */
132 void SPI_event_main (void);
133 void SPI_event_quit (void);
134 SPIBoolean SPI_eventIsReady (void);
135 AccessibleEvent *SPI_nextEvent (SPIBoolean waitForEvent);
138 /* Event Listener creation and support. */
140 AccessibleEventListener * SPI_createAccessibleEventListener (
141 AccessibleEventListenerCB callback,
143 SPIBoolean AccessibleEventListener_addCallback (
144 AccessibleEventListener *listener,
145 AccessibleEventListenerCB callback,
147 SPIBoolean AccessibleEventListener_removeCallback (
148 AccessibleEventListener *listener,
149 AccessibleEventListenerCB callback);
150 void AccessibleEventListener_unref (
151 AccessibleEventListener *listener);
153 /* Keystroke Listener creation and support. */
155 AccessibleKeystrokeListener * SPI_createAccessibleKeystrokeListener (
156 AccessibleKeystrokeListenerCB callback,
158 SPIBoolean AccessibleKeystrokeListener_addCallback (
159 AccessibleKeystrokeListener *listener,
160 AccessibleKeystrokeListenerCB callback,
162 SPIBoolean AccessibleKeystrokeListener_removeCallback (
163 AccessibleKeystrokeListener *listener,
164 AccessibleKeystrokeListenerCB callback);
165 void AccessibleKeystrokeListener_unref (
166 AccessibleKeystrokeListener *listener);
168 /* Global functions serviced by the registry */
170 SPIBoolean SPI_registerGlobalEventListener (
171 AccessibleEventListener *listener,
172 const char *eventType);
173 SPIBoolean SPI_deregisterGlobalEventListener (
174 AccessibleEventListener *listener,
175 const char *eventType);
176 SPIBoolean SPI_deregisterGlobalEventListenerAll (
177 AccessibleEventListener *listener);
178 SPIBoolean SPI_registerAccessibleKeystrokeListener (
179 AccessibleKeystrokeListener *listener,
180 AccessibleKeySet *keys,
181 AccessibleKeyMaskType modmask,
182 AccessibleKeyEventMask eventmask,
183 AccessibleKeyListenerSyncType sync_type);
184 SPIBoolean SPI_deregisterAccessibleKeystrokeListener (
185 AccessibleKeystrokeListener *listener,
186 AccessibleKeyMaskType modmask);
188 int SPI_getDesktopCount (void);
189 Accessible *SPI_getDesktop (int i);
190 int SPI_getDesktopList (Accessible **list);
192 SPIBoolean SPI_generateKeyEvent (long int keyval,
193 AccessibleKeySynthType synth_type);
194 SPIBoolean SPI_generateMouseEvent (long int x, long int y, char *name);
196 /* Accessible function prototypes */
198 void Accessible_ref (Accessible *obj);
199 void Accessible_unref (Accessible *obj);
200 char * Accessible_getName (Accessible *obj);
201 char * Accessible_getDescription (Accessible *obj);
202 Accessible * Accessible_getParent (Accessible *obj);
203 long Accessible_getChildCount (Accessible *obj);
204 Accessible * Accessible_getChildAtIndex (Accessible *obj,
205 long int childIndex);
206 long Accessible_getIndexInParent (Accessible *obj);
207 AccessibleRelation **Accessible_getRelationSet (Accessible *obj);
208 AccessibleRole Accessible_getRole (Accessible *obj);
209 char * Accessible_getRoleName (Accessible *obj);
210 AccessibleStateSet * Accessible_getStateSet (Accessible *obj);
212 /* Interface query methods */
214 SPIBoolean Accessible_isAction (Accessible *obj);
215 SPIBoolean Accessible_isApplication (Accessible *obj);
216 SPIBoolean Accessible_isComponent (Accessible *obj);
217 SPIBoolean Accessible_isEditableText (Accessible *obj);
218 SPIBoolean Accessible_isHypertext (Accessible *obj);
219 SPIBoolean Accessible_isImage (Accessible *obj);
220 SPIBoolean Accessible_isSelection (Accessible *obj);
221 SPIBoolean Accessible_isTable (Accessible *obj);
222 SPIBoolean Accessible_isText (Accessible *obj);
223 SPIBoolean Accessible_isValue (Accessible *obj);
225 AccessibleAction * Accessible_getAction (Accessible *obj);
226 AccessibleApplication * Accessible_getApplication (Accessible *obj);
227 AccessibleComponent * Accessible_getComponent (Accessible *obj);
228 AccessibleEditableText * Accessible_getEditableText (Accessible *obj);
229 AccessibleHypertext * Accessible_getHypertext (Accessible *obj);
230 AccessibleImage * Accessible_getImage (Accessible *obj);
231 AccessibleSelection * Accessible_getSelection (Accessible *obj);
232 AccessibleTable * Accessible_getTable (Accessible *obj);
233 AccessibleText * Accessible_getText (Accessible *obj);
234 AccessibleValue * Accessible_getValue (Accessible *obj);
235 AccessibleUnknown * Accessible_queryInterface (Accessible *obj,
236 const char *interface_name);
238 /* AccessibleAction function prototypes */
240 void AccessibleAction_ref (AccessibleAction *obj);
241 void AccessibleAction_unref (AccessibleAction *obj);
242 long AccessibleAction_getNActions (AccessibleAction *obj);
243 char *AccessibleAction_getName (AccessibleAction *obj,
245 char *AccessibleAction_getDescription (AccessibleAction *obj,
247 SPIBoolean AccessibleAction_doAction (AccessibleAction *obj,
249 char *AccessibleAction_getKeyBinding (AccessibleAction *obj,
252 /* AccessibleApplication function prototypes */
254 void AccessibleApplication_ref (AccessibleApplication *obj);
255 void AccessibleApplication_unref (AccessibleApplication *obj);
256 char *AccessibleApplication_getToolkitName (AccessibleApplication *obj);
257 char *AccessibleApplication_getVersion (AccessibleApplication *obj);
258 long AccessibleApplication_getID (AccessibleApplication *obj);
259 SPIBoolean AccessibleApplication_pause (AccessibleApplication *obj);
260 SPIBoolean AccessibleApplication_resume (AccessibleApplication *obj);
262 /* AccessibleComponent function prototypes */
264 void AccessibleComponent_ref (AccessibleComponent *obj);
265 void AccessibleComponent_unref (AccessibleComponent *obj);
266 SPIBoolean AccessibleComponent_contains (AccessibleComponent *obj,
269 AccessibleCoordType ctype);
270 Accessible *AccessibleComponent_getAccessibleAtPoint (
271 AccessibleComponent *obj,
274 AccessibleCoordType ctype);
275 void AccessibleComponent_getExtents (AccessibleComponent *obj,
280 AccessibleCoordType ctype);
281 void AccessibleComponent_getPosition (AccessibleComponent *obj,
284 AccessibleCoordType ctype);
285 void AccessibleComponent_getSize (AccessibleComponent *obj,
288 AccessibleComponentLayer
289 AccessibleComponent_getLayer (AccessibleComponent *obj);
290 void AccessibleComponent_grabFocus (AccessibleComponent *obj);
291 short AccessibleComponent_getMDIZOrder(AccessibleComponent *obj);
293 /* AccessibleEditableText function prototypes */
296 AccessibleEditableText_ref (AccessibleEditableText *obj);
299 AccessibleEditableText_unref (AccessibleEditableText *obj);
302 AccessibleEditableText_setAttributes (AccessibleEditableText *obj,
303 const char *attributes,
304 long int startOffset,
308 AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
309 const char *newContents);
312 AccessibleEditableText_insertText (AccessibleEditableText *obj,
318 AccessibleEditableText_copyText (AccessibleText *obj,
323 AccessibleEditableText_cutText (AccessibleEditableText *obj,
328 AccessibleEditableText_deleteText (AccessibleEditableText *obj,
333 AccessibleEditableText_pasteText (AccessibleEditableText *obj,
338 * AccessibleHyperlink function prototypes
342 AccessibleHyperlink_ref (AccessibleHyperlink *obj);
344 AccessibleHyperlink_unref (AccessibleHyperlink *obj);
347 AccessibleHyperlink_getNAnchors (AccessibleHyperlink *obj);
350 AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
354 AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
358 AccessibleHyperlink_getIndexRange (AccessibleHyperlink *obj,
359 long int *startIndex,
363 AccessibleHyperlink_isValid (AccessibleHyperlink *obj);
367 * AccessibleHypertext function prototypes
372 AccessibleHypertext_ref (AccessibleHypertext *obj);
375 AccessibleHypertext_unref (AccessibleHypertext *obj);
378 AccessibleHypertext_getNLinks (AccessibleHypertext *obj);
380 AccessibleHyperlink *
381 AccessibleHypertext_getLink (AccessibleHypertext *obj,
385 AccessibleHypertext_getLinkIndex (AccessibleHypertext *obj,
386 long int characterOffset);
390 * AccessibleImage function prototypes
395 AccessibleImage_ref (AccessibleImage *obj);
398 AccessibleImage_unref (AccessibleImage *obj);
401 AccessibleImage_getImageDescription (AccessibleImage *obj);
404 AccessibleImage_getImageSize (AccessibleImage *obj,
409 AccessibleImage_getImagePosition (AccessibleImage *obj,
412 AccessibleCoordType ctype);
415 AccessibleImage_getImageExtents (AccessibleImage *obj,
420 AccessibleCoordType ctype);
423 * AccessibleRelation function prototypes
427 void AccessibleRelation_ref (AccessibleRelation *obj);
428 void AccessibleRelation_unref (AccessibleRelation *obj);
430 AccessibleRelationType
431 AccessibleRelation_getRelationType (AccessibleRelation *obj);
434 AccessibleRelation_getNTargets (AccessibleRelation *obj);
437 AccessibleRelation_getTarget (AccessibleRelation *obj, int i);
442 * AccessibleSelection function prototypes
446 void AccessibleSelection_ref (AccessibleSelection *obj);
447 void AccessibleSelection_unref (AccessibleSelection *obj);
450 AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj);
453 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
454 long int selectedChildIndex);
457 AccessibleSelection_selectChild (AccessibleSelection *obj,
458 long int childIndex);
461 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
462 long int selectedChildIndex);
465 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
466 long int childIndex);
469 AccessibleSelection_selectAll (AccessibleSelection *obj);
472 AccessibleSelection_clearSelection (AccessibleSelection *obj);
477 * AccessibleStateSet function prototypes
481 void AccessibleStateSet_ref (AccessibleStateSet *obj);
482 void AccessibleStateSet_unref (AccessibleStateSet *obj);
485 AccessibleStateSet_contains (AccessibleStateSet *obj,
486 AccessibleState state);
489 AccessibleStateSet_add (AccessibleStateSet *obj,
490 AccessibleState state);
493 AccessibleStateSet_remove (AccessibleStateSet *obj,
494 AccessibleState state);
497 AccessibleStateSet_equals (AccessibleStateSet *obj,
498 AccessibleStateSet *obj2);
501 AccessibleStateSet_compare (AccessibleStateSet *obj,
502 AccessibleStateSet *obj2);
505 AccessibleStateSet_isEmpty (AccessibleStateSet *obj);
510 * AccessibleTable function prototypes
514 void AccessibleTable_ref (AccessibleTable *obj);
515 void AccessibleTable_unref (AccessibleTable *obj);
518 AccessibleTable_getCaption (AccessibleTable *obj);
521 AccessibleTable_getSummary (AccessibleTable *obj);
524 AccessibleTable_getNRows (AccessibleTable *obj);
527 AccessibleTable_getNColumns (AccessibleTable *obj);
530 AccessibleTable_getAccessibleAt (AccessibleTable *obj,
535 AccessibleTable_getIndexAt (AccessibleTable *obj,
540 AccessibleTable_getRowAtIndex (AccessibleTable *obj,
544 AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
548 AccessibleTable_getRowDescription (AccessibleTable *obj,
552 AccessibleTable_getColumnDescription (AccessibleTable *obj,
556 AccessibleTable_getRowExtentAt (AccessibleTable *obj,
561 AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
566 AccessibleTable_getRowHeader (AccessibleTable *obj,
570 AccessibleTable_getColumnHeader (AccessibleTable *obj,
574 AccessibleTable_getNSelectedRows (AccessibleTable *obj);
577 AccessibleTable_getSelectedRows (AccessibleTable *obj,
578 long int **selectedRows);
581 AccessibleTable_getNSelectedColumns (AccessibleTable *obj);
584 AccessibleTable_getSelectedColumns (AccessibleTable *obj,
585 long int **selectedColumns);
588 AccessibleTable_isRowSelected (AccessibleTable *obj,
592 AccessibleTable_isColumnSelected (AccessibleTable *obj,
596 AccessibleTable_isSelected (AccessibleTable *obj,
602 * AccessibleText function prototypes
606 void AccessibleText_ref (AccessibleText *obj);
607 void AccessibleText_unref (AccessibleText *obj);
610 AccessibleText_getCharacterCount (AccessibleText *obj);
613 AccessibleText_getText (AccessibleText *obj,
614 long int startOffset,
618 AccessibleText_getCaretOffset (AccessibleText *obj);
621 AccessibleText_getAttributes (AccessibleText *obj,
623 long int *startOffset,
624 long int *endOffset);
628 AccessibleText_setCaretOffset (AccessibleText *obj,
632 AccessibleText_getTextBeforeOffset (AccessibleText *obj,
634 AccessibleTextBoundaryType type,
635 long int *startOffset,
636 long int *endOffset);
639 AccessibleText_getTextAtOffset (AccessibleText *obj,
641 AccessibleTextBoundaryType type,
642 long int *startOffset,
643 long int *endOffset);
646 AccessibleText_getTextAfterOffset (AccessibleText *obj,
648 AccessibleTextBoundaryType type,
649 long int *startOffset,
650 long int *endOffset);
653 AccessibleText_getCharacterAtOffset (AccessibleText *obj,
657 AccessibleText_getCharacterExtents (AccessibleText *obj,
663 AccessibleCoordType type);
666 AccessibleText_getOffsetAtPoint (AccessibleText *obj,
669 AccessibleCoordType type);
672 AccessibleText_getNSelections (AccessibleText *obj);
675 AccessibleText_getSelection (AccessibleText *obj,
676 long int selectionNum,
677 long int *startOffset,
678 long int *endOffset);
682 AccessibleText_addSelection (AccessibleText *obj,
683 long int startOffset,
687 AccessibleText_removeSelection (AccessibleText *obj,
688 long int selectionNum);
691 AccessibleText_setSelection (AccessibleText *obj,
692 long int selectionNum,
693 long int startOffset,
696 /* AccessibleValue Function Prototypes: */
698 void AccessibleValue_ref (AccessibleValue *obj);
699 void AccessibleValue_unref (AccessibleValue *obj);
700 double AccessibleValue_getMinimumValue (AccessibleValue *obj);
701 double AccessibleValue_getCurrentValue (AccessibleValue *obj);
702 double AccessibleValue_getMaximumValue (AccessibleValue *obj);
703 SPIBoolean AccessibleValue_setCurrentValue (AccessibleValue *obj,
707 void SPI_freeString (char *s);