2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems Inc.
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.
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.
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.
23 #include <Bonobo_Unknown.idl>
25 #include <Application.idl>
26 #include <Desktop.idl>
28 #ifndef _ACCESSIBILITY_REGISTRY_IDL_
29 #define _ACCESSIBILITY_REGISTRY_IDL_
31 module Accessibility {
33 typedef sequence<Desktop> DesktopSeq;
35 interface DeviceEventController;
37 interface Registry : EventListener {
40 * registerApplication:
41 * @application: a reference to the requesting @Application
44 * Register a new application with the accessibility broker.
47 oneway void registerApplication (in Application application);
50 * deregisterApplication:
51 * @application: a reference to the @Application
55 * De-register an application previously registered with the broker.
58 void deregisterApplication (in Application application);
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.
67 * Register a client's interest in (all) application events of
71 void registerGlobalEventListener (in EventListener listener,
75 * deregisterGlobalEventListener:
76 * @listener: the requesting @EventListener
77 * @eventName: a string indicating the type of events
80 * Request that a previously registered client stop receiving
81 * global notifications for events of a certain type.
85 void deregisterGlobalEventListenerAll (in EventListener listener);
87 * deregisterGlobalEventListener:
88 * @listener: the requesting @EventListener
89 * @eventName: a string indicating the type of events
92 * Request that a previously registered client stop receiving
93 * global notifications for events of a certain type.
97 void deregisterGlobalEventListener (in EventListener listener,
98 in string event_name);
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"
109 * "GObject:notify:<propertyname>"
111 * ( not sure we should allow these last 2 forms,
112 * since they are toolkit-specific, but they're powerful )
118 * return values: a short integer indicating the current number of
121 * Get the current number of desktops.
124 short getDesktopCount ();
128 * @n: the index of the requested @Desktop.
129 * return values: a reference to the requested @Desktop.
131 * Get the nth accessible desktop.
134 Desktop getDesktop (in short n);
138 * return values: a sequence containing references to
141 * Get a list of accessible desktops.
144 DesktopSeq getDesktopList ();
147 * getDeviceEventController:
148 * return values: an object implementing DeviceEventController
151 DeviceEventController getDeviceEventController ();
183 struct ControllerEventMask {
185 unsigned short refcount;
191 unsigned long timestamp;
193 unsigned short modifiers;
199 unsigned long timestamp;
201 unsigned short modifiers;
204 typedef sequence< long > KeySet;
205 typedef sequence< KeyEventType > KeyEventTypeSeq;
207 interface KeystrokeListener : Bonobo::Unknown {
208 boolean keyEvent (in KeyStroke key);
211 interface DeviceEventListener : Bonobo::Unknown {
212 boolean notifyEvent (in DeviceEvent event);
215 interface DeviceEventController : Bonobo::Unknown {
218 * registerKeystrokeListener:
219 * @listener: a @KeystrokeListener which will intercept key events.
220 * @keys: a @KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
221 * @mask: a @ControllerEventMask filtering the intercepted key events.
222 * @type: an @EventType mask that may created by ORing event types together.
223 * @is_synchronous: a @boolean indicating whether the listener should
224 * receive the events synchronously, potentially consuming them,
225 * or just be notified asynchronously of those events that have
229 * Register to intercept keyboard events, and either pass them on or
233 void registerKeystrokeListener (in KeystrokeListener listener,
235 in ControllerEventMask mask,
236 in KeyEventTypeSeq type,
237 in boolean is_synchronous);
240 * deregisterKeystrokeListener:
241 * @listener: a @KeystrokeListener which will intercept key events.
242 * @keys: a @KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
243 * @mask: a @ControllerEventMask filtering the intercepted key events.
244 * @type: an @EventType mask that may created by ORing event types together.
245 * @is_synchronous: a @boolean indicating whether the listener should
246 * receive the events synchronously, potentially consuming them,
247 * or just be notified asynchronously of those events that have
251 * De-register a previously registered keyboard eventlistener.
254 void deregisterKeystrokeListener (in KeystrokeListener listener,
256 in ControllerEventMask mask,
257 in KeyEventTypeSeq type,
258 in boolean is_synchronous);
260 boolean notifyListenersSync (in DeviceEventListener listener,
261 in DeviceEvent event);
263 oneway void notifyListenersAsync (in DeviceEventListener listener,
264 in DeviceEvent event);
268 * @keycode: a long integer indicating the keycode of
269 * the keypress to be synthesized.
271 * Note that this long may be truncated before being
272 * processed, as keycode length may be platform-dependent
273 * and keycode ranges are generally much smaller than
278 * Synthesize a keypress event.
281 void generateKeyEvent (in long keycode, in KeySynthType type);
284 * generateMouseEvent:
285 * @x: a long integer indicating the screen x coord for the mouse event.
286 * @y: a long integer indicating the screen y coord for the mouse event.
287 * @eventName: a string indicating the type of mouse event, e.g. "button1up"
290 * Synthesize a mouse event.
293 void generateMouseEvent (in long x, in long y, in string eventName);