10 April 2001

Appendix A: IDL Definitions

This appendix contains the complete OMG IDL [OMGIDL] for the Level 3 Document Object Model Events definitions.

The IDL files are also available as: http://www.w3.org/TR/2001/WD-DOM-Level-3-Events-20010410/idl.zip

events.idl:

// File: events.idl

#ifndef _EVENTS_IDL_
#define _EVENTS_IDL_

#include "dom.idl"
#include "views.idl"

#pragma prefix "dom.w3c.org"
module events
{

  typedef dom::DOMString DOMString;
  typedef dom::EventListener EventListener;
  typedef dom::UIEvent UIEvent;

  interface EventGroup {
    boolean            isSameEventGroup(in EventGroup eventGroup);
  };

  interface EventTargetGroup {
    void               addEventListener(in DOMString type, 
                                        in EventListener listener, 
                                        in boolean useCapture, 
                                        in EventGroup eventGroup);
    void               removeEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture, 
                                           in EventGroup eventGroup);
  };

  interface DocumentEventGroup {
    EventGroup         createEventGroup();
  };

  // Introduced in DOM Level 3:
  interface KeyEvent : UIEvent {

    // VirtualKeyCode
    const unsigned long       DOM_VK_UNDEFINED               = 0x0;
    const unsigned long       DOM_VK_RIGHT_ALT               = 0x01;
    const unsigned long       DOM_VK_LEFT_ALT                = 0x02;
    const unsigned long       DOM_VK_LEFT_CONTROL            = 0x03;
    const unsigned long       DOM_VK_RIGHT_CONTROL           = 0x04;
    const unsigned long       DOM_VK_LEFT_SHIFT              = 0x05;
    const unsigned long       DOM_VK_RIGHT_SHIFT             = 0x06;
    const unsigned long       DOM_VK_LEFT_META               = 0x07;
    const unsigned long       DOM_VK_RIGHT_META              = 0x08;
    const unsigned long       DOM_VK_CAPS_LOCK               = 0x09;
    const unsigned long       DOM_VK_DELETE                  = 0x0A;
    const unsigned long       DOM_VK_END                     = 0x0B;
    const unsigned long       DOM_VK_ENTER                   = 0x0C;
    const unsigned long       DOM_VK_ESCAPE                  = 0x0D;
    const unsigned long       DOM_VK_HOME                    = 0x0E;
    const unsigned long       DOM_VK_INSERT                  = 0x0F;
    const unsigned long       DOM_VK_NUM_LOCK                = 0x10;
    const unsigned long       DOM_VK_PAUSE                   = 0x11;
    const unsigned long       DOM_VK_PRINTSCREEN             = 0x12;
    const unsigned long       DOM_VK_SCROLL_LOCK             = 0x13;
    const unsigned long       DOM_VK_LEFT                    = 0x14;
    const unsigned long       DOM_VK_RIGHT                   = 0x15;
    const unsigned long       DOM_VK_UP                      = 0x16;
    const unsigned long       DOM_VK_DOWN                    = 0x17;
    const unsigned long       DOM_VK_PAGE_DOWN               = 0x18;
    const unsigned long       DOM_VK_PAGE_UP                 = 0x19;
    const unsigned long       DOM_VK_F1                      = 0x1A;
    const unsigned long       DOM_VK_F2                      = 0x1B;
    const unsigned long       DOM_VK_F3                      = 0x1C;
    const unsigned long       DOM_VK_F4                      = 0x1D;
    const unsigned long       DOM_VK_F5                      = 0x1E;
    const unsigned long       DOM_VK_F6                      = 0x1F;
    const unsigned long       DOM_VK_F7                      = 0x20;
    const unsigned long       DOM_VK_F8                      = 0x21;
    const unsigned long       DOM_VK_F9                      = 0x22;
    const unsigned long       DOM_VK_F10                     = 0x23;
    const unsigned long       DOM_VK_F11                     = 0x24;
    const unsigned long       DOM_VK_F12                     = 0x25;
    const unsigned long       DOM_VK_F13                     = 0x26;
    const unsigned long       DOM_VK_F14                     = 0x27;
    const unsigned long       DOM_VK_F15                     = 0x28;
    const unsigned long       DOM_VK_F16                     = 0x29;
    const unsigned long       DOM_VK_F17                     = 0x2A;
    const unsigned long       DOM_VK_F18                     = 0x2B;
    const unsigned long       DOM_VK_F19                     = 0x2C;
    const unsigned long       DOM_VK_F20                     = 0x2D;
    const unsigned long       DOM_VK_F21                     = 0x2E;
    const unsigned long       DOM_VK_F22                     = 0x2F;
    const unsigned long       DOM_VK_F23                     = 0x30;
    const unsigned long       DOM_VK_F24                     = 0x31;

             attribute DOMString        outputString;
             attribute unsigned long    keyVal;
             attribute unsigned long    virtKeyVal;
             attribute boolean          inputGenerated;
             attribute boolean          numPad;
    boolean            checkModifier(in unsigned long modifer);
    void               initKeyEvent(in DOMString typeArg, 
                                    in boolean canBubbleArg, 
                                    in boolean cancelableArg, 
                                    in views::AbstractView viewArg, 
                                    in unsigned short detailArg, 
                                    in DOMString outputStringArg, 
                                    in unsigned long keyValArg, 
                                    in unsigned long virtKeyValArg, 
                                    in boolean inputGeneratedArg, 
                                    in boolean numPadArg);
    void               initModifier(in unsigned long modifier, 
                                    in boolean value);
  };
};

#endif // _EVENTS_IDL_