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