2002-03-27 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi-listener.h
1 #ifndef _SPI_LISTENER_H_
2 #define _SPI_LISTENER_H_
3
4 #include <cspi/spi-impl.h>
5
6 #ifdef  __cplusplus
7 extern "C" {
8 #endif
9
10 /*
11  * Structure used to encapsulate event information
12  */
13 typedef struct {
14   const char  *type;
15   Accessible  *source;
16   long         detail1;
17   long         detail2;
18 } AccessibleEvent;
19
20 typedef enum {
21   SPI_KEY_PRESSED  = 1<<0,
22   SPI_KEY_RELEASED = 1<<1
23 } AccessibleKeyEventType;
24
25
26 typedef struct {
27   long                   keyID;
28   short                  keycode;
29   char *                 keystring;
30   long                   timestamp;
31   AccessibleKeyEventType type;
32   unsigned short         modifiers;
33   SPIBoolean             is_text;       
34 } AccessibleKeystroke;
35
36 /*
37  * Function prototype typedefs for Event Listener Callbacks.
38  * (see libspi/accessibleeventlistener.h for definition of SpiVoidEventListenerCB).
39  *
40  * usage: signatures should be
41  * void (*AccessibleEventListenerCB) (AccessibleEvent *event);
42  *
43  * SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystrokeEvent *Event);
44  */
45 typedef void       (*AccessibleEventListenerCB)     (const AccessibleEvent     *event,
46                                                      void                      *user_data);
47 typedef SPIBoolean (*AccessibleKeystrokeListenerCB) (const AccessibleKeystroke *stroke,
48                                                      void                      *user_data);
49
50 #ifdef  __cplusplus
51 }
52 #endif
53
54 #endif