idl/Registry.idl : temporarily changed register_Application
[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.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 deregisterGlobalEventListener (in EventListener listener);
86         /** 
87          * event types: "Window" "Desktop"
88          *              "Window:Create" "Window:Destroy"
89          *              "Window:Iconify" "Window:Restore"
90          *              "Window:Fullscreen" "Window:Resize"
91          *              "Desktop:Create" "Desktop:Destroy"  
92          *              "Desktop:Focus" "Desktop:Defocus"
93          *              "Desktop:Reorder" 
94          *              "Focus"
95          *              "GtkWidget:show"
96          *              "GObject:notify:<propertyname>" 
97          *
98          *  ( not sure we should allow these last 2 forms, 
99          *    since they are toolkit-specific, but they're powerful )
100          *
101          **/              
102
103         /**
104          * getDesktopCount:
105          * return values: a short integer indicating the current number of 
106          * @Desktops.
107          *
108          * Get the current number of desktops.
109          *
110          **/
111         short getDesktopCount ();
112
113         /**
114          * getDesktop:
115          * @n: the index of the requested @Desktop.
116          * return values: a reference to the requested @Desktop.
117          *
118          * Get the nth accessible desktop. 
119          *
120          **/
121         Desktop getDesktop (in short n);
122
123         /**
124          * getDesktopList:
125          * return values: a sequence containing references to
126          * the @Desktops.
127          *
128          * Get a list of accessible desktops. 
129          *
130          **/
131         DesktopSeq getDesktopList ();
132
133         /**
134          * getDeviceEventController:
135          * return values: an object implementing DeviceEventController
136          *
137          **/
138         DeviceEventController getDeviceEventController ();
139
140     };
141
142   enum KeyEventType {
143     KEY_PRESSED,
144     KEY_RELEASED
145   };
146
147   enum ModifierType {
148     MODIFIER_ALT,
149     MODIFIER_META,
150     MODIFIER_CONTROL,
151     MODIFIER_SHIFT,
152     MODIFIER_META2,
153     MODIFIER_META3
154   };
155
156   typedef sequence<ModifierType> ModifierSeq;
157
158   struct KeyStroke {
159     long keyID;
160     KeyEventType type; 
161     ModifierSeq modifiers;
162   };
163
164   interface KeystrokeListener {
165         boolean keyEvent (in KeyStroke key);
166   };
167
168   interface DeviceEventController {
169
170         /**
171          * registerKeystrokeListener:
172          * @listener: a @KeystrokeListener which will intercept key events.
173          * Returns: void
174          *
175          * Register to intercept keyboard events, and either pass them on or
176          * consume them. 
177          *
178          **/
179         void registerKeystrokeListener (in KeystrokeListener listener);
180     
181         /**
182          * generateKeyEvent:
183          * @keyEventID: a long integer indicating which keypress is synthesized.
184          * Returns: void
185          *
186          * Synthesize a keypress event.
187          *
188          **/
189          void generateKeyEvent (in long keyEventID);
190
191         /**
192          * generateMouseEvent:
193          * @x: a long integer indicating the screen x coord for the mouse event.
194          * @y: a long integer indicating the screen y coord for the mouse event.
195          * @eventName: a string indicating the type of mouse event, e.g. "button1up"
196          * Returns: void
197          *
198          * Synthesize a mouse event.
199          *
200          **/
201          void generateMouseEvent (in long x, in long y, in string eventName);
202     }; 
203 };
204
205 #endif