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