427473a2aaa2ef59b2cb59dd78c42ee11b942557
[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 } AccessibleKeystroke;
34
35 /*
36  * Function prototype typedefs for Event Listener Callbacks.
37  * (see libspi/accessibleeventlistener.h for definition of SpiVoidEventListenerCB).
38  *
39  * usage: signatures should be
40  * void (*AccessibleEventListenerCB) (AccessibleEvent *event);
41  *
42  * SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystrokeEvent *Event);
43  */
44 typedef void       (*AccessibleEventListenerCB)     (AccessibleEvent     *event,
45                                                      void                *user_data);
46 typedef SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystroke *stroke,
47                                                      void                *user_data);
48
49 #ifdef  __cplusplus
50 }
51 #endif
52
53 #endif