3d519fff3e328322cab77e94e0be60adb4efade0
[platform/core/uifw/at-spi2-atk.git] / idl / Registry.idl
1 /* 
2  * AT-SPI - Assistive Technology Service Provider Interface 
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001 Sun Microsystems Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #include <Bonobo_Unknown.idl>
24 #include <Event.idl>
25 #include <Application.idl>
26 #include <Desktop.idl>
27
28 #ifndef _ACCESSIBILITY_REGISTRY_IDL_
29 #define _ACCESSIBILITY_REGISTRY_IDL_
30
31 module Accessibility {
32
33   typedef sequence<Desktop> DesktopSeq;
34
35   interface DeviceEventController;
36
37   interface Registry : EventListener {
38
39         /**
40          * registerApplication:
41          * @application: a reference to the requesting @Application
42          * return values: void
43          *
44          * Register a new application with the accessibility broker.
45          *
46          **/
47         oneway void registerApplication (in Application application);
48
49         /**
50          * deregisterApplication:
51          * @application: a reference to the @Application 
52          * to be deregistered.
53          * return values: void
54          *
55          * De-register an application previously registered with the broker.
56          *
57          **/
58         void deregisterApplication (in Application application);
59
60         /**
61          * registerGlobalEventListener:
62          * @listener: a reference to the requesting @EventListener.
63          * @eventName: a string which indicates the type of events about 
64          * which the client desires notification.
65          * return values: void
66          *
67          * Register a client's interest in (all) application events of 
68          * a certain type.
69          *
70          **/
71         void registerGlobalEventListener (in EventListener listener,
72                                            in string eventName);
73
74         /**
75          * deregisterGlobalEventListener:
76          * @listener: the requesting @EventListener
77          * @eventName: a string indicating the type of events
78          * return values: void
79          *
80          * Request that a previously registered client stop receiving
81          * global notifications for events of a certain type.
82          *
83          **/
84
85         void deregisterGlobalEventListenerAll (in EventListener listener);
86         /**
87          * deregisterGlobalEventListener:
88          * @listener: the requesting @EventListener
89          * @eventName: a string indicating the type of events
90          * return values: void
91          *
92          * Request that a previously registered client stop receiving
93          * global notifications for events of a certain type.
94          *
95          **/
96
97         void deregisterGlobalEventListener (in EventListener listener, 
98                                             in string event_name);
99         /** 
100          * event types: "Window" "Desktop"
101          *              "Window:Create" "Window:Destroy"
102          *              "Window:Iconify" "Window:Restore"
103          *              "Window:Fullscreen" "Window:Resize"
104          *              "Desktop:Create" "Desktop:Destroy"  
105          *              "Desktop:Focus" "Desktop:Defocus"
106          *              "Desktop:Reorder" 
107          *              "Focus"
108          *              "GtkWidget:show"
109          *              "GObject:notify:<propertyname>" 
110          *
111          *  ( not sure we should allow these last 2 forms, 
112          *    since they are toolkit-specific, but they're powerful )
113          *
114          **/              
115
116         /**
117          * getDesktopCount:
118          * return values: a short integer indicating the current number of 
119          * @Desktops.
120          *
121          * Get the current number of desktops.
122          *
123          **/
124         short getDesktopCount ();
125
126         /**
127          * getDesktop:
128          * @n: the index of the requested @Desktop.
129          * return values: a reference to the requested @Desktop.
130          *
131          * Get the nth accessible desktop. 
132          *
133          **/
134         Desktop getDesktop (in short n);
135
136         /**
137          * getDesktopList:
138          * return values: a sequence containing references to
139          * the @Desktops.
140          *
141          * Get a list of accessible desktops. 
142          *
143          **/
144         DesktopSeq getDesktopList ();
145
146         /**
147          * getDeviceEventController:
148          * return values: an object implementing DeviceEventController
149          *
150          **/
151         DeviceEventController getDeviceEventController ();
152
153     };
154
155   enum KeyEventType {
156     KEY_PRESSED,
157     KEY_RELEASED
158   };
159
160   enum ModifierType {
161     MODIFIER_SHIFT,
162     MODIFIER_ALT,
163     MODIFIER_CONTROL,
164     MODIFIER_META,
165     MODIFIER_META2,
166     MODIFIER_META3,
167     MODIFIER_SHIFTLOCK,
168     MODIFIER_NUMLOCK
169   };
170
171   struct ControllerEventMask {
172     unsigned long value;
173     unsigned short refcount;
174   };
175
176   struct KeyStroke {
177     long keyID;
178     short keycode;
179     KeyEventType type; 
180     unsigned short modifiers;
181   };
182
183   typedef sequence< long > KeySet;
184   typedef sequence< KeyEventType > KeyEventTypeSeq;
185
186   interface KeystrokeListener : Bonobo::Unknown {
187         boolean keyEvent (in KeyStroke key);
188   };
189
190   interface DeviceEventController : Bonobo::Unknown {
191
192         /**
193          * registerKeystrokeListener:
194          * @listener: a @KeystrokeListener which will intercept key events.
195          * @keys:     a @KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
196          * @mask:     a @ControllerEventMask filtering the intercepted key events.
197          * @type:     an @EventType mask that may created by ORing event types together.
198          * @is_synchronous: a @boolean indicating whether the listener should 
199          *            receive the events synchronously, potentially consuming them,
200          *            or just be notified asynchronously of those events that have
201          *            been generated.
202          * Returns: void
203          *
204          * Register to intercept keyboard events, and either pass them on or
205          * consume them. 
206          *
207          **/
208         void registerKeystrokeListener (in KeystrokeListener listener,
209                                         in KeySet keys,
210                                         in ControllerEventMask mask,
211                                         in KeyEventTypeSeq type,
212                                         in boolean is_synchronous);
213     
214         /**
215          * deregisterKeystrokeListener:
216          * @listener: a @KeystrokeListener which will intercept key events.
217          * @keys:     a @KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
218          * @mask:     a @ControllerEventMask filtering the intercepted key events.
219          * @type:     an @EventType mask that may created by ORing event types together.
220          * @is_synchronous: a @boolean indicating whether the listener should 
221          *            receive the events synchronously, potentially consuming them,
222          *            or just be notified asynchronously of those events that have
223          *            been generated.
224          * Returns: void
225          *
226          * De-register a previously registered keyboard eventlistener.
227          *
228          **/
229         void deregisterKeystrokeListener (in KeystrokeListener listener,
230                                         in KeySet keys,
231                                         in ControllerEventMask mask,
232                                         in KeyEventTypeSeq type,
233                                         in boolean is_synchronous);
234     
235         /**
236          * generateKeyEvent:
237          * @keyEventID: a long integer indicating which keypress is synthesized.
238          * Returns: void
239          *
240          * Synthesize a keypress event.
241          *
242          **/
243          void generateKeyEvent (in long keyEventID);
244
245         /**
246          * generateMouseEvent:
247          * @x: a long integer indicating the screen x coord for the mouse event.
248          * @y: a long integer indicating the screen y coord for the mouse event.
249          * @eventName: a string indicating the type of mouse event, e.g. "button1up"
250          * Returns: void
251          *
252          * Synthesize a mouse event.
253          *
254          **/
255          void generateMouseEvent (in long x, in long y, in string eventName);
256     }; 
257 };
258
259 #endif