2004-02-11 Padraig O'Briain <padraig.obriain@sun.com>
[platform/core/uifw/at-spi2-atk.git] / idl / Accessibility_Registry.idl
index 52d3c2a..88f8bfe 100644 (file)
@@ -21,9 +21,9 @@
  */
 
 #include <Bonobo_Unknown.idl>
-#include <Event.idl>
-#include <Application.idl>
-#include <Desktop.idl>
+#include <Accessibility_Event.idl>
+#include <Accessibility_Application.idl>
+#include <Accessibility_Desktop.idl>
 
 #ifndef _ACCESSIBILITY_REGISTRY_IDL_
 #define _ACCESSIBILITY_REGISTRY_IDL_
@@ -66,7 +66,7 @@ module Accessibility {
          *
         **/
         void registerGlobalEventListener (in EventListener listener,
-                                           in string eventName);
+                                         in string eventName);
 
        /**
          * deregisterGlobalEventListener:
@@ -144,8 +144,20 @@ module Accessibility {
         **/
         DeviceEventController getDeviceEventController ();
 
+       /**
+        * unImplemented:
+        *
+        * placeholders for future expansion.
+        */
+       void unImplemented ();
+       void unImplemented2 ();
+       void unImplemented3 ();
+       void unImplemented4 ();
+       void unImplemented5 ();
+       void unImplemented6 ();
     };
 
+  /* Deprecated, DO NOT USE! */
   enum KeyEventType {
     KEY_PRESSED,
     KEY_RELEASED
@@ -153,64 +165,74 @@ module Accessibility {
 
   enum EventType {
     KEY_PRESSED_EVENT,
-    KEY_RELEASED_EVENT
+    KEY_RELEASED_EVENT,
+    BUTTON_PRESSED_EVENT,
+    BUTTON_RELEASED_EVENT
   };
 
   enum KeySynthType {
     KEY_PRESS,
     KEY_RELEASE,
     KEY_PRESSRELEASE,
-    KEY_SYM
+    KEY_SYM,
+    KEY_STRING
   };
 
   enum ModifierType {
     MODIFIER_SHIFT,
-    MODIFIER_ALT,
+    MODIFIER_SHIFTLOCK,
     MODIFIER_CONTROL,
+    MODIFIER_ALT,
     MODIFIER_META,
     MODIFIER_META2,
     MODIFIER_META3,
-    MODIFIER_SHIFTLOCK,
     MODIFIER_NUMLOCK
   };
 
-  struct ControllerEventMask {
-    unsigned long value;
-    unsigned short refcount;
+  struct EventListenerMode {
+    boolean synchronous;
+    boolean preemptive;
+    boolean global;      
   };
 
-  struct KeyStroke {
-    long keyID;
-    short keycode;
-    unsigned long timestamp;
-    KeyEventType type; 
-    unsigned short modifiers;
-  };
+  typedef unsigned long ControllerEventMask;
 
   struct DeviceEvent {
-    long eventID;
-    short hw_code;
-    unsigned long timestamp;
     EventType type; 
+    long  id;
+    short hw_code;
     unsigned short modifiers;
+    unsigned long timestamp;
+    string event_string;
+    boolean is_text;
   };
 
-  typedef sequence< long > KeySet;
-  typedef sequence< KeyEventType > KeyEventTypeSeq;
+  struct KeyDefinition {
+    long keycode;
+    long keysym;
+    string keystring;
+    long unused;
+  };   
 
-  interface KeystrokeListener : Bonobo::Unknown {
-        boolean keyEvent (in KeyStroke key);
-  };
+  typedef sequence< KeyDefinition > KeySet;
+  typedef sequence< EventType > KeyEventTypeSeq;
+  typedef sequence< EventType > EventTypeSeq;
 
   interface DeviceEventListener : Bonobo::Unknown {
         boolean notifyEvent (in DeviceEvent event);
+        void    unImplemented__ ();
+        void    unImplemented_2_ ();
+        void    unImplemented_3_ ();
+        void    unImplemented_4_ ();
+        void    unImplemented_5_ ();
+        void    unImplemented_6_ ();
   };
 
   interface DeviceEventController : Bonobo::Unknown {
 
        /**
          * registerKeystrokeListener:
-         * @listener: a @KeystrokeListener which will intercept key events.
+         * @listener: a @DeviceEventListener which will intercept key events.
          * @keys:     a @KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
          * @mask:     a @ControllerEventMask filtering the intercepted key events.
         * @type:     an @EventType mask that may created by ORing event types together.
@@ -218,59 +240,94 @@ module Accessibility {
         *            receive the events synchronously, potentially consuming them,
         *            or just be notified asynchronously of those events that have
         *            been generated.
-        * Returns: void
+        * Returns: %true if successful, %false if not
          *
          * Register to intercept keyboard events, and either pass them on or
          * consume them. 
          *
         **/
-        void registerKeystrokeListener (in KeystrokeListener listener,
+        boolean registerKeystrokeListener (in DeviceEventListener listener,
                                        in KeySet keys,
                                        in ControllerEventMask mask,
                                        in KeyEventTypeSeq type,
-                                       in boolean is_synchronous);
+                                       in EventListenerMode mode);
     
        /**
          * deregisterKeystrokeListener:
-         * @listener: a @KeystrokeListener which will intercept key events.
+         * @listener: a @DeviceEventListener which will intercept key events.
          * @keys:     a @KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
          * @mask:     a @ControllerEventMask filtering the intercepted key events.
         * @type:     an @EventType mask that may created by ORing event types together.
-        * @is_synchronous: a @boolean indicating whether the listener should 
-        *            receive the events synchronously, potentially consuming them,
-        *            or just be notified asynchronously of those events that have
-        *            been generated.
+        *
         * Returns: void
          *
          * De-register a previously registered keyboard eventlistener.
          *
         **/
-        void deregisterKeystrokeListener (in KeystrokeListener listener,
-                                       in KeySet keys,
-                                       in ControllerEventMask mask,
-                                       in KeyEventTypeSeq type,
-                                       in boolean is_synchronous);
+        void deregisterKeystrokeListener (in DeviceEventListener listener,
+                                         in KeySet keys,
+                                         in ControllerEventMask mask,
+                                         in KeyEventTypeSeq type);
+    
+       /**
+         * registerDeviceEventListener:
+         * @listener: a @DeviceEventListener which will intercept events.
+        * @typeseq:  an @EventTypeSeq indicating which event types to listen for.
+        * Returns: %true if successful, %false if not
+         *
+         * Register to intercept events, and either pass them on or
+         * consume them. To listen to keyboard events use registerKeystrokeListener
+        * instead.
+         *
+        **/
+        boolean registerDeviceEventListener (in DeviceEventListener listener,
+                                            in EventTypeSeq typeseq);
+    
+       /**
+         * deregisterDeviceEventListener:
+         * @listener: a @DeviceEventListener which will intercept events.
+        * @typeseq:  an @EventTypeSeq indicating which event types to stop
+        *            listening for.
+        *
+        * Returns: void
+         *
+         * De-register a previously registered keyboard eventlistener.
+         *
+        **/
+        void deregisterDeviceEventListener (in DeviceEventListener listener,
+                                           in EventTypeSeq typeseq);
     
         boolean notifyListenersSync (in DeviceEvent event);
 
         oneway void notifyListenersAsync (in DeviceEvent event);
 
         /**
-         * generateKeyEvent:
+         * generateKeyboardEvent:
          * @keycode: a long integer indicating the keycode of
         *          the keypress to be synthesized.
+        * @keystring: an optional UTF-8 string indicating a complex
+        *          keyboard input event.
+        * @type: a #KeySynthType indicating the type of event(s) to be 
+        *          synthesized: a key press, release, press-release pair,
+        *          or a complex input string (for instance from an
+        *          internationalized or complex text input method, or
+        *          a composed character).
         *
-        * Note that this long may be truncated before being
+        * Note that @keycode may be truncated before being
         *          processed, as keycode length may be platform-dependent
         *          and keycode ranges are generally much smaller than
         *          CORBA_long. 
+        * One or the other of @keycode or @keystring are generally NULL, 
+        *          (but not both), depending on the value of @type.
         *
          * Returns: void
          *
-         * Synthesize a keypress event.
+         * Synthesize a keyboard event.
          *
          **/
-         void generateKeyEvent (in long keycode, in KeySynthType type);
+         void generateKeyboardEvent (in long keycode, 
+                                    in string keystring, 
+                                    in KeySynthType type);
 
         /**
          * generateMouseEvent:
@@ -283,6 +340,16 @@ module Accessibility {
          *
          **/
          void generateMouseEvent (in long x, in long y, in string eventName);
+
+        /**
+         * unImplemented:
+         *
+         * placeholders for future expansion.
+         */
+        void unImplemented ();
+        void unImplemented2 ();
+        void unImplemented3 ();
+        void unImplemented4 ();
     }; 
 };