WD-DOM-Level-2-19981228


Appendix C: IDL Definitions

This appendix contains the complete OMG IDL for the Level 1 Document Object Model definitions. The definitions are divided into CSS , Events , Filters and Iterators , and Range .

C.1: Document Object Model Level 2 CSS

css.idl:

// File: css.idl
#ifndef _CSS_IDL_
#define _CSS_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module css
{
  typedef dom::DOMString DOMString;
  typedef dom::Node Node;

  interface CSSRuleCollection;
  interface CSSRule;
  interface CSSStyleDeclaration;

  interface StyleSheet {
    readonly attribute  DOMString            type;
             attribute  boolean              disabled;
    readonly attribute  Node                 owningNode;
    readonly attribute  StyleSheet           parentStyleSheet;
    readonly attribute  DOMString            href;
    readonly attribute  DOMString            title;
    readonly attribute  DOMString            media;
  };

  interface StyleSheetCollection {
    readonly attribute  unsigned long        length;
    StyleSheet                item(in unsigned long index);
  };

  interface CSSStyleSheet : StyleSheet {
    readonly attribute  CSSRuleCollection    cssRules;
    unsigned long             insertRule(in DOMString rule, 
                                         in unsigned long index)
                                         raises(DOMException);
    void                      deleteRule(in unsigned long index)
                                         raises(DOMException);
  };

  interface CSSRuleCollection {
    readonly attribute  unsigned long        length;
    CSSRule                   item(in unsigned long index);
  };

  interface CSSRule {
    // RuleType
    const unsigned short      UNKNOWN_RULE       = 0;
    const unsigned short      STYLE_RULE         = 1;
    const unsigned short      IMPORT_RULE        = 2;
    const unsigned short      MEDIA_RULE         = 3;
    const unsigned short      FONT_FACE_RULE     = 4;
    const unsigned short      PAGE_RULE          = 5;

    readonly attribute  unsigned short       type;
             attribute  DOMString            cssText;
    readonly attribute  CSSStyleSheet        parentStyleSheet;
  };

  interface CSSStyleRule : CSSRule {
             attribute  DOMString            selectorText;
    readonly attribute  CSSStyleDeclaration  style;
  };

  interface CSSMediaRule : CSSRule {
             attribute  DOMString            mediaTypes;
    readonly attribute  CSSRuleCollection    cssRules;
    unsigned long             insertRule(in DOMString rule, 
                                         in unsigned long index)
                                         raises(DOMException);
    void                      deleteRule(in unsigned long index);
  };

  interface CSSFontFaceRule : CSSRule {
    readonly attribute  CSSStyleDeclaration  style;
  };

  interface CSSPageRule : CSSRule {
             attribute  DOMString            selectorText;
    readonly attribute  CSSStyleDeclaration  style;
  };

  interface CSSImportRule : CSSRule {
             attribute  DOMString            href;
             attribute  DOMString            media;
    readonly attribute  CSSStyleSheet        styleSheet;
  };

  interface CSSUnknownRule : CSSRule {
  };

  interface CSSStyleDeclaration {
             attribute  DOMString            cssText;
    DOMString                 getPropertyValue(in DOMString propertyName);
    DOMString                 getPropertyPriority(in DOMString propertyName);
    void                      setProperty(in DOMString propertyName, 
                                          in DOMString value, 
                                          in DOMString priority)
                                          raises(DOMException);
    readonly attribute  unsigned long        length;
    DOMString                 item(in unsigned long index);
  };

  interface CSS2Properties {
             attribute  DOMString            azimuth;
             attribute  DOMString            background;
             attribute  DOMString            backgroundAttachment;
             attribute  DOMString            backgroundColor;
             attribute  DOMString            backgroundImage;
             attribute  DOMString            backgroundPosition;
             attribute  DOMString            backgroundRepeat;
             attribute  DOMString            border;
             attribute  DOMString            borderCollapse;
             attribute  DOMString            borderColor;
             attribute  DOMString            borderSpacing;
             attribute  DOMString            borderStyle;
             attribute  DOMString            borderTop;
             attribute  DOMString            borderRight;
             attribute  DOMString            borderBottom;
             attribute  DOMString            borderLeft;
             attribute  DOMString            borderTopColor;
             attribute  DOMString            borderRightColor;
             attribute  DOMString            borderBottomColor;
             attribute  DOMString            borderLeftColor;
             attribute  DOMString            borderTopStyle;
             attribute  DOMString            borderRightStyle;
             attribute  DOMString            borderBottomStyle;
             attribute  DOMString            borderLeftStyle;
             attribute  DOMString            borderTopWidth;
             attribute  DOMString            borderRightWidth;
             attribute  DOMString            borderBottomWidth;
             attribute  DOMString            borderLeftWidth;
             attribute  DOMString            borderWidth;
             attribute  DOMString            bottom;
             attribute  DOMString            captionSide;
             attribute  DOMString            clear;
             attribute  DOMString            clip;
             attribute  DOMString            color;
             attribute  DOMString            content;
             attribute  DOMString            counterIncrement;
             attribute  DOMString            counterReset;
             attribute  DOMString            cue;
             attribute  DOMString            cueAfter;
             attribute  DOMString            cueBefore;
             attribute  DOMString            cursor;
             attribute  DOMString            direction;
             attribute  DOMString            display;
             attribute  DOMString            elevation;
             attribute  DOMString            emptyCells;
             attribute  DOMString            cssFloat;
             attribute  DOMString            font;
             attribute  DOMString            fontFamily;
             attribute  DOMString            fontSize;
             attribute  DOMString            fontSizeAdjust;
             attribute  DOMString            fontStretch;
             attribute  DOMString            fontStyle;
             attribute  DOMString            fontVariant;
             attribute  DOMString            fontWeight;
             attribute  DOMString            height;
             attribute  DOMString            left;
             attribute  DOMString            letterSpacing;
             attribute  DOMString            lineHeight;
             attribute  DOMString            listStyle;
             attribute  DOMString            listStyleImage;
             attribute  DOMString            listStylePosition;
             attribute  DOMString            listStyleType;
             attribute  DOMString            margin;
             attribute  DOMString            marginTop;
             attribute  DOMString            marginRight;
             attribute  DOMString            marginBottom;
             attribute  DOMString            marginLeft;
             attribute  DOMString            markerOffset;
             attribute  DOMString            marks;
             attribute  DOMString            maxHeight;
             attribute  DOMString            maxWidth;
             attribute  DOMString            minHeight;
             attribute  DOMString            minWidth;
             attribute  DOMString            orphans;
             attribute  DOMString            outline;
             attribute  DOMString            outlineColor;
             attribute  DOMString            outlineStyle;
             attribute  DOMString            outlineWidth;
             attribute  DOMString            overflow;
             attribute  DOMString            padding;
             attribute  DOMString            paddingTop;
             attribute  DOMString            paddingRight;
             attribute  DOMString            paddingBottom;
             attribute  DOMString            paddingLeft;
             attribute  DOMString            page;
             attribute  DOMString            pageBreakAfter;
             attribute  DOMString            pageBreakBefore;
             attribute  DOMString            pageBreakInside;
             attribute  DOMString            pause;
             attribute  DOMString            pauseAfter;
             attribute  DOMString            pauseBefore;
             attribute  DOMString            pitch;
             attribute  DOMString            pitchRange;
             attribute  DOMString            playDuring;
             attribute  DOMString            position;
             attribute  DOMString            quotes;
             attribute  DOMString            richness;
             attribute  DOMString            right;
             attribute  DOMString            size;
             attribute  DOMString            speak;
             attribute  DOMString            speakHeader;
             attribute  DOMString            speakNumeral;
             attribute  DOMString            speakPunctuation;
             attribute  DOMString            speechRate;
             attribute  DOMString            stress;
             attribute  DOMString            tableLayout;
             attribute  DOMString            textAlign;
             attribute  DOMString            textDecoration;
             attribute  DOMString            textIndent;
             attribute  DOMString            textShadow;
             attribute  DOMString            textTransform;
             attribute  DOMString            top;
             attribute  DOMString            unicodeBidi;
             attribute  DOMString            verticalAlign;
             attribute  DOMString            visibility;
             attribute  DOMString            voiceFamily;
             attribute  DOMString            volume;
             attribute  DOMString            whiteSpace;
             attribute  DOMString            widows;
             attribute  DOMString            width;
             attribute  DOMString            wordSpacing;
             attribute  DOMString            zIndex;
  };

};

#endif // _CSS_IDL_


C.2: Document Object Model Level 2 Events

events.idl:

// File: events.idl
#ifndef _EVENTS_IDL_
#define _EVENTS_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module events
{
  typedef dom::DOMString DOMString;
  typedef dom::Node Node;

  interface EventCapturer {
    void                      captureEvent(in DOMString type);
    void                      releaseEvent(in DOMString type);
    void                      routeEvent();
  };

  interface Event {
             attribute  DOMString            type;
             attribute  Node                 target;
             attribute  boolean              cancelBubble;
             attribute  boolean              returnValue;
  };

  interface UIEvent : Event {
             attribute  long                 screenX;
             attribute  long                 screenY;
             attribute  long                 clientX;
             attribute  long                 clientY;
             attribute  boolean              altKey;
             attribute  boolean              ctrlKey;
             attribute  boolean              shiftKey;
             attribute  unsigned long        keyCode;
             attribute  unsigned long        charCode;
             attribute  unsigned short       button;
  };

};

#endif // _EVENTS_IDL_


C.3: Document Object Model Level 2 Filters and Iterators

fi.idl:

// File: fi.idl
#ifndef _FI_IDL_
#define _FI_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module fi
{
  typedef dom::Node Node;

  interface NodeIterator {
    Node                      nextNode();
    void                      reset();
  };

  interface NodeFilter {
    boolean                   acceptNode(in Node n);
  };

};

#endif // _FI_IDL_


C.4: Document Object Model Level 2 Range

range.idl:

// File: range.idl
#ifndef _RANGE_IDL_
#define _RANGE_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module range
{
  typedef dom::Node Node;
  typedef dom::DocumentFragment DocumentFragment;
  typedef dom::DOMString DOMString;

  exception RangeException {
    unsigned short   code;
  };

  // RangeExceptionCode
  const unsigned short      BAD_ENDPOINTS_ERR  = 201;
  const unsigned short      INVALID_NODE_TYPE_ERR = 202;
  const unsigned short      NULL_PARENT_ERR    = 203;


  interface Range {
    readonly attribute  Node                 startParent;
    readonly attribute  long                 startOffset;
    readonly attribute  Node                 endParent;
    readonly attribute  long                 endOffset;
    readonly attribute  boolean              isCollapsed;
    readonly attribute  Node                 commonParent;
    void                      setStart(in Node parent, 
                                       in long offset)
                                       raises(RangeException);
    void                      setEnd(in Node parent, 
                                     in long offset)
                                     raises(RangeException);
    void                      setStartBefore(in Node sibling)
                                             raises(RangeException);
    void                      setStartAfter(in Node sibling)
                                            raises(RangeException);
    void                      setEndBefore(in Node sibling)
                                           raises(RangeException);
    void                      setEndAfter(in Node sibling)
                                          raises(RangeException);
    void                      collapse(in boolean toStart);
    void                      selectNode(in Node n)
                                         raises(RangeException);
    void                      selectNodeContents(in Node n)
                                                 raises(RangeException);
    typedef enum CompareHow_ {
      StartToStart,
      StartToEnd,
      EndToEnd,
      EndToStart
    } CompareHow;
    short                     compareEndPoints(in CompareHow how, 
                                               in Range sourceRange)
                                               raises(DOMException);
    void                      deleteContents()
                                             raises(DOMException);
    DocumentFragment          extractContents()
                                              raises(DOMException);
    DocumentFragment          cloneContents();
    void                      insertNode(in Node n)
                                         raises(DOMException, RangeException);
    void                      surroundContents(in Node n)
                                               raises(DOMException, RangeException);
    Range                     cloneRange();
    DOMString                 toString();
  };

};

#endif // _RANGE_IDL_