Add atspi_accessible_get_reading_material
[platform/upstream/at-spi2-core.git] / atspi / atspi-types.h
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2002 Ximian, Inc.
6  *           2002 Sun Microsystems Inc.
7  *           
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #ifndef _ATSPI_TYPES_H_
26 #define _ATSPI_TYPES_H_
27
28 #include "glib-object.h"
29
30 #include "atspi-constants.h"
31
32 typedef struct _AtspiAccessible AtspiAccessible;
33 typedef struct _AtspiAction AtspiAction;
34 typedef struct _AtspiCollection AtspiCollection;
35 typedef struct _AtspiComponent AtspiComponent;
36 typedef struct _AtspiDocument AtspiDocument;
37 typedef struct _AtspiEditableText AtspiEditableText;
38 typedef struct _AtspiHyperlink AtspiHyperlink;
39 typedef struct _AtspiHypertext AtspiHypertext;
40 typedef struct _AtspiImage AtspiImage;
41 typedef struct _AtspiSelection AtspiSelection;
42 typedef struct _AtspiTable AtspiTable;
43 typedef struct _AtspiTableCell AtspiTableCell;
44 typedef struct _AtspiText AtspiText;
45 typedef struct _AtspiValue AtspiValue;
46 typedef struct _AtspiAccessibleReadingMaterial AtspiAccessibleReadingMaterial;
47
48 typedef guint AtspiControllerEventMask;
49
50 typedef guint AtspiKeyMaskType;
51
52 typedef guint AtspiKeyEventMask;
53 typedef guint AtspiDeviceEventMask;
54
55 // TODO: auto-generate the below structs
56 typedef struct _AtspiDeviceEvent AtspiDeviceEvent;
57 struct _AtspiDeviceEvent
58 {
59   AtspiEventType type;
60   guint id;
61   gushort hw_code;
62   gushort modifiers;
63   guint timestamp;
64   gchar * event_string;
65   gboolean is_text;
66 };
67
68 typedef struct _AtspiEventListenerMode AtspiEventListenerMode;
69 struct _AtspiEventListenerMode
70 {
71   gboolean synchronous;
72   gboolean preemptive;
73   gboolean global;
74 };
75
76 typedef struct _AtspiKeyDefinition AtspiKeyDefinition;
77 struct _AtspiKeyDefinition
78 {
79   gint keycode;
80   gint keysym;
81   gchar *keystring;
82   gint unused;
83 };
84
85 typedef struct _AtspiEvent AtspiEvent;
86 struct _AtspiEvent
87 {
88   gchar  *type;
89   AtspiAccessible  *source;
90   gint         detail1;
91   gint         detail2;
92   GValue any_data;
93 };
94
95 /**
96  * ATSPI_TYPE_DEVICE_EVENT:
97  * 
98  * The #GType for a boxed type holding a #AtspiDeviceEvent.
99  */
100 #define ATSPI_TYPE_DEVICE_EVENT (atspi_device_event_get_type ())
101
102 /**
103  * ATSPI_TYPE_EVENT:
104  * 
105  * The #GType for a boxed type holding a #AtspiEvent.
106  */
107 #define ATSPI_TYPE_EVENT (atspi_event_get_type ())
108
109 typedef void AtspiKeystrokeListener;
110
111 /**
112  * AtspiKeySet:
113  * @keysyms:
114  * @keycodes:
115  * @len:
116  *
117  * Structure containing identifying information about a set of keycode or
118  *        keysyms.
119  **/
120 typedef struct _AtspiKeySet
121 {
122   guint *keysyms;
123   gushort *keycodes;
124   gchar          **keystrings;
125   gshort           len;
126 } AtspiKeySet;
127
128 /**
129  *AtspiKeyListenerSyncType:
130   * @ATSPI_KEYLISTENER_NOSYNC: Events may be delivered asynchronously, 
131  * which means in some cases they may already have been delivered to the 
132  * application before the AT client receives the notification.  
133  * @ATSPI_KEYLISTENER_SYNCHRONOUS: Events are delivered synchronously, before the 
134  * currently focussed application sees them.  
135  * @ATSPI_KEYLISTENER_CANCONSUME: Events may be consumed by the AT client.  Presumes and
136  * requires #ATSPI_KEYLISTENER_SYNCHRONOUS, incompatible with #ATSPI_KEYLISTENER_NOSYNC.
137  * @ATSPI_KEYLISTENER_ALL_WINDOWS: Events are received not from the application toolkit layer, but
138  * from the device driver or windowing system subsystem; such notifications are 'global' in the 
139  * sense that they are not broken or defeated by applications that participate poorly
140  * in the accessibility APIs, or not at all; however because of the intrusive nature of
141  * such snooping, it can have side-effects on certain older platforms.  If unconditional
142  * event notifications, even when inaccessible or "broken" applications have focus, are not
143  * required, it may be best to avoid this enum value/flag.
144  *
145  * Specifies the type of a key listener event.
146  * The values above can and should be bitwise-'OR'-ed
147  * together, observing the compatibility limitations specified in the description of
148  * each value.  For instance, #ATSPI_KEYLISTENER_ALL_WINDOWS | #ATSPI_KEYLISTENER_CANCONSUME is
149  * a commonly used combination which gives the AT complete control over the delivery of matching
150  * events.  However, such filters should be used sparingly as they may have a negative impact on 
151  * system performance.
152  **/
153 typedef enum {
154   ATSPI_KEYLISTENER_NOSYNC = 0,
155   ATSPI_KEYLISTENER_SYNCHRONOUS = 1 << 0,
156   ATSPI_KEYLISTENER_CANCONSUME = 1 << 1,
157   ATSPI_KEYLISTENER_ALL_WINDOWS = 1 << 2
158 } AtspiKeyListenerSyncType;
159 #endif  /* _ATSPI_TYPES_H_ */