Add selection interface
[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 _AtspiAccessible AtspiAction;
34 typedef struct _AtspiAccessible AtspiCollection;
35 typedef struct _AtspiComponent AtspiComponent;
36 typedef struct _AtspiAccessible AtspiDocument;
37 typedef struct _AtspiAccessible AtspiEditableText;
38 typedef struct _AtspiAccessible AtspiHypertext;
39 typedef struct _AtspiSelection AtspiSelection;
40 typedef struct _AtspiTable AtspiTable;
41 typedef struct _AtspiText AtspiText;
42 typedef struct _AtspiAccessible AtspiValue;
43
44 typedef guint AtspiControllerEventMask;
45
46 typedef guint AtspiKeyMaskType;
47
48 typedef guint AtspiKeyEventMask;
49 typedef guint AtspiDeviceEventMask;
50
51 // TODO: auto-generate the below structs
52 typedef struct _AtspiDeviceEvent AtspiDeviceEvent;
53 struct _AtspiDeviceEvent
54 {
55   AtspiEventType type;
56   guint id;
57   gushort hw_code;
58   gushort modifiers;
59   guint timestamp;
60   gchar * event_string;
61   gboolean is_text;
62 };
63
64 typedef struct _AtspiEventListenerMode AtspiEventListenerMode;
65 struct _AtspiEventListenerMode
66 {
67   gboolean synchronous;
68   gboolean preemptive;
69   gboolean global;
70 };
71
72 typedef struct _AtspiKeyDefinition AtspiKeyDefinition;
73 struct _AtspiKeyDefinition
74 {
75   gint keycode;
76   gint keysym;
77   gchar *keystring;
78   gint unused;
79 };
80
81 typedef struct _AtspiEvent AtspiEvent;
82 struct _AtspiEvent
83 {
84   gchar  *type;
85   AtspiAccessible  *source;
86   gint         detail1;
87   gint         detail2;
88   GValue any_data;
89 };
90
91 /**
92  * ATSPI_TYPE_RECT:
93  * 
94  * The #GType for a boxed type holding a #AtspiEvent.
95  */
96 #define ATSPI_TYPE_EVENT (atspi_event_get_type ())
97
98 typedef void AtspiKeystrokeListener;
99
100 /**
101  * AtspiKeySet:
102  * @keysyms:
103  * @keycodes:
104  * @len:
105  *
106  * Structure containing identifying information about a set of keycode or
107  *        keysyms.
108  **/
109 typedef struct _AtspiKeySet
110 {
111   guint *keysyms;
112   gushort *keycodes;
113   gchar          **keystrings;
114   gshort           len;
115 } AtspiKeySet;
116
117 /**
118  *AtspiKeyListenerSyncType:
119  *@SPI_KEYLISTENER_NOSYNC: Events may be delivered asynchronously, 
120  * which means in some cases they may already have been delivered to the 
121  * application before the AT client receives the notification.  
122  *@SPI_KEYLISTENER_SYNCHRONOUS: Events are delivered synchronously, before the 
123  * currently focussed application sees them.  
124  *@ATSPI_KEYLISTENER_CANCONSUME: Events may be consumed by the AT client.  Presumes and
125  * requires #ATSPI_KEYLISTENER_SYNCHRONOUS, incompatible with #ATSPI_KEYLISTENER_NOSYNC.
126  *@SPI_KEYLISTENER_ALL_WINDOWS: Events are received not from the application toolkit layer, but
127  * from the device driver or windowing system subsystem; such notifications are 'global' in the 
128  * sense that they are not broken or defeated by applications that participate poorly
129  * in the accessibility APIs, or not at all; however because of the intrusive nature of
130  * such snooping, it can have side-effects on certain older platforms.  If unconditional
131  * event notifications, even when inaccessible or "broken" applications have focus, are not
132  * required, it may be best to avoid this enum value/flag.
133  *
134  *Specified the tyupe of a key listener event.
135  * Certain of the values above can and should be bitwise-'OR'ed
136  * together, observing the compatibility limitations specified in the description of
137  * each value.  For instance, #ATSPI_KEYLISTENER_ALL_WINDOWS | #ATSPI_KEYLISTENER_CANCONSUME is
138  * a commonly used combination which gives the AT complete control over the delivery of matching
139  * events.  However, such filters should be used sparingly as they may have a negative impact on 
140  * system performance.
141  **/
142 typedef enum {
143   ATSPI_KEYLISTENER_NOSYNC = 0,
144   ATSPI_KEYLISTENER_SYNCHRONOUS = 1,
145   ATSPI_KEYLISTENER_CANCONSUME = 2,
146   ATSPI_KEYLISTENER_ALL_WINDOWS = 4
147 } AtspiKeyListenerSyncType;
148 #endif  /* _ATSPI_TYPES_H_ */