Initial revision
[platform/core/uifw/at-spi2-atk.git] / idl / Registry.idl
1 #include <Bonobo.idl>
2 #include <Event.idl>
3 #include <Application.idl>
4 #include <Desktop.idl>
5
6 module Accessibility {
7
8   typedef sequence<Desktop> DesktopSeq;
9
10   interface DeviceEventController;
11
12   interface Registry : EventListener {
13
14         /**
15          * registerApplication:
16          * @application: a reference to the requesting @Application
17          * return values: void
18          *
19          * Register a new application with the accessibility broker.
20          *
21          **/
22         void registerApplication (in Application application);
23
24         /**
25          * deregisterApplication:
26          * @application: a reference to the @Application 
27          * to be deregistered.
28          * return values: void
29          *
30          * De-register an application previously registered with the broker.
31          *
32          **/
33         void deregisterApplication (in Application application);
34
35         /**
36          * registerGlobalEventListener:
37          * @listener: a reference to the requesting @EventListener.
38          * @eventName: a string which indicates the type of events about 
39          * which the client desires notification.
40          * return values: void
41          *
42          * Register a client's interest in (all) application events of 
43          * a certain type.
44          *
45          **/
46         void registerGlobalEventListener (in EventListener listener,
47                                            in string eventName);
48
49         /**
50          * deregisterGlobalEventListener:
51          * @listener: the requesting @EventListener
52          * @eventName: a string indicating the type of events
53          * return values: void
54          *
55          * Request that a previously registered client stop receiving
56          * global notifications for events of a certain type.
57          *
58          **/
59
60         void deregisterGlobalEventListener (in EventListener listener);
61         /** 
62          * event types: "Window" "Desktop"
63          *              "Window:Create" "Window:Destroy"
64          *              "Window:Iconify" "Window:Restore"
65          *              "Window:Fullscreen" "Window:Resize"
66          *              "Desktop:Create" "Desktop:Destroy"  
67          *              "Desktop:Focus" "Desktop:Defocus"
68          *              "Desktop:Reorder" 
69          *              "Focus"
70          *              "GtkWidget:show"
71          *              "GObject:notify:<propertyname>" 
72          *
73          *  ( not sure we should allow these last 2 forms, 
74          *    since they are toolkit-specific, but they're powerful )
75          *
76          **/              
77
78         /**
79          * getDesktopCount:
80          * return values: a short integer indicating the current number of 
81          * @Desktops.
82          *
83          * Get the current number of desktops.
84          *
85          **/
86         short getDesktopCount ();
87
88         /**
89          * getDesktop:
90          * @n: the index of the requested @Desktop.
91          * return values: a reference to the requested @Desktop.
92          *
93          * Get the nth accessible desktop. 
94          *
95          **/
96         Desktop getDesktop (in short n);
97
98         /**
99          * getDesktopList:
100          * return values: a sequence containing references to
101          * the @Desktops.
102          *
103          * Get a list of accessible desktops. 
104          *
105          **/
106         DesktopSeq getDesktopList ();
107
108         /**
109          * getDeviceEventController:
110          * return values: an object implementing DeviceEventController
111          *
112          **/
113         DeviceEventController getDeviceEventController ();
114
115     };
116
117   enum KeyEventType {
118     KEY_PRESSED,
119     KEY_RELEASED
120   };
121
122   enum ModifierType {
123     MODIFIER_ALT,
124     MODIFIER_META,
125     MODIFIER_CONTROL,
126     MODIFIER_SHIFT,
127     MODIFIER_META2,
128     MODIFIER_META3
129   };
130
131   typedef sequence<ModifierType> ModifierSeq;
132
133   struct KeyStroke {
134     long keyID;
135     KeyEventType type; 
136     ModifierSeq modifiers;
137   };
138
139   interface KeystrokeListener {
140         boolean keyEvent (in KeyStroke key);
141   };
142
143   interface DeviceEventController {
144
145         /**
146          * registerKeystrokeListener:
147          * @listener: a @KeystrokeListener which will intercept key events.
148          * Returns: void
149          *
150          * Register to intercept keyboard events, and either pass them on or
151          * consume them. 
152          *
153          **/
154         void registerKeystrokeListener (in KeystrokeListener listener);
155     
156         /**
157          * generateKeyEvent:
158          * @keyEventID: a long integer indicating which keypress is synthesized.
159          * Returns: void
160          *
161          * Synthesize a keypress event.
162          *
163          **/
164          void generateKeyEvent (in long keyEventID);
165
166         /**
167          * generateMouseEvent:
168          * @x: a long integer indicating the screen x coord for the mouse event.
169          * @y: a long integer indicating the screen y coord for the mouse event.
170          * @eventName: a string indicating the type of mouse event, e.g. "button1up"
171          * Returns: void
172          *
173          * Synthesize a mouse event.
174          *
175          **/
176          void generateMouseEvent (in long x, in long y, in string eventName);
177     }; 
178 };