Merge tag 'upstream/2.34.0' into tizen
[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 Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 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  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  * Boston, MA 02110-1301, 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 typedef struct _AtspiAccessibleDefaultLabelInfo AtspiAccessibleDefaultLabelInfo;
48
49 typedef guint AtspiControllerEventMask;
50
51 typedef guint AtspiKeyMaskType;
52
53 typedef guint AtspiKeyEventMask;
54 typedef guint AtspiDeviceEventMask;
55
56 // TODO: auto-generate the below structs
57 typedef struct _AtspiDeviceEvent AtspiDeviceEvent;
58 struct _AtspiDeviceEvent
59 {
60   AtspiEventType type;
61   guint id;
62   gushort hw_code;
63   gushort modifiers;
64   guint timestamp;
65   gchar * event_string;
66   gboolean is_text;
67 };
68
69 typedef struct _AtspiEventListenerMode AtspiEventListenerMode;
70 struct _AtspiEventListenerMode
71 {
72   gboolean synchronous;
73   gboolean preemptive;
74   gboolean global;
75 };
76
77 typedef struct _AtspiKeyDefinition AtspiKeyDefinition;
78 struct _AtspiKeyDefinition
79 {
80   gint keycode;
81   gint keysym;
82   gchar *keystring;
83   gint unused;
84 };
85
86 typedef struct _AtspiEvent AtspiEvent;
87 struct _AtspiEvent
88 {
89   gchar  *type;
90   AtspiAccessible  *source;
91   gint         detail1;
92   gint         detail2;
93   GValue any_data;
94   AtspiAccessible *sender;
95 };
96
97 /**
98  * ATSPI_TYPE_DEVICE_EVENT:
99  * 
100  * The #GType for a boxed type holding a #AtspiDeviceEvent.
101  */
102 #define ATSPI_TYPE_DEVICE_EVENT (atspi_device_event_get_type ())
103
104 /**
105  * ATSPI_TYPE_EVENT:
106  * 
107  * The #GType for a boxed type holding a #AtspiEvent.
108  */
109 #define ATSPI_TYPE_EVENT (atspi_event_get_type ())
110
111 typedef void AtspiKeystrokeListener;
112
113 /**
114  * AtspiKeySet:
115  * @keysyms:
116  * @keycodes:
117  * @len:
118  *
119  * Structure containing identifying information about a set of keycode or
120  *        keysyms.
121  **/
122 typedef struct _AtspiKeySet
123 {
124   guint *keysyms;
125   gushort *keycodes;
126   gchar          **keystrings;
127   gshort           len;
128 } AtspiKeySet;
129
130 /**
131  *AtspiKeyListenerSyncType:
132   * @ATSPI_KEYLISTENER_NOSYNC: Events may be delivered asynchronously, 
133  * which means in some cases they may already have been delivered to the 
134  * application before the AT client receives the notification.  
135  * @ATSPI_KEYLISTENER_SYNCHRONOUS: Events are delivered synchronously, before the 
136  * currently focussed application sees them.  
137  * @ATSPI_KEYLISTENER_CANCONSUME: Events may be consumed by the AT client.  Presumes and
138  * requires #ATSPI_KEYLISTENER_SYNCHRONOUS, incompatible with #ATSPI_KEYLISTENER_NOSYNC.
139  * @ATSPI_KEYLISTENER_ALL_WINDOWS: Events are received not from the application toolkit layer, but
140  * from the device driver or windowing system subsystem; such notifications are 'global' in the 
141  * sense that they are not broken or defeated by applications that participate poorly
142  * in the accessibility APIs, or not at all; however because of the intrusive nature of
143  * such snooping, it can have side-effects on certain older platforms.  If unconditional
144  * event notifications, even when inaccessible or "broken" applications have focus, are not
145  * required, it may be best to avoid this enum value/flag.
146  *
147  * Specifies the type of a key listener event.
148  * The values above can and should be bitwise-'OR'-ed
149  * together, observing the compatibility limitations specified in the description of
150  * each value.  For instance, #ATSPI_KEYLISTENER_ALL_WINDOWS | #ATSPI_KEYLISTENER_CANCONSUME is
151  * a commonly used combination which gives the AT complete control over the delivery of matching
152  * events.  However, such filters should be used sparingly as they may have a negative impact on 
153  * system performance.
154  **/
155 typedef enum {
156   ATSPI_KEYLISTENER_NOSYNC = 0,
157   ATSPI_KEYLISTENER_SYNCHRONOUS = 1 << 0,
158   ATSPI_KEYLISTENER_CANCONSUME = 1 << 1,
159   ATSPI_KEYLISTENER_ALL_WINDOWS = 1 << 2
160 } AtspiKeyListenerSyncType;
161 #endif  /* _ATSPI_TYPES_H_ */