This appendix contains the complete OMG IDL for the Level 2 Document Object Model definitions. The definitions are divided into Core, Namespaces, Stylesheets, CSS, Events, Filters and Iterators, and Range.
The IDL files are also available as: http://www.w3.org/TR/1999/WD-DOM-Level-2-19990719/idl.zip
// File: dom2.idl #ifndef _DOM2_IDL_ #define _DOM2_IDL_ #include "dom.idl" #pragma prefix "dom.w3c.org" module dom2 { typedef dom::DocumentType DocumentType; typedef dom::DOMString DOMString; typedef dom::DOMImplementation DOMImplementation; typedef dom::Document Document; typedef dom::Node Node; typedef dom::Attr Attr; typedef dom::Element Element; typedef dom::HTMLDocument HTMLDocument; interface DocumentType2 : DocumentType { readonly attribute DOMString publicID; readonly attribute DOMString systemID; }; interface DOMImplementation2 : DOMImplementation { DocumentType createDocumentType(in DOMString name, in DOMString publicID, in DOMString systemID) raises(DOMException); Document createDocument(in DOMString name, in DocumentType doctype) raises(DOMException); }; interface Document2 : Document { Node importNode(in Node importedNode, in boolean deep); }; interface Node2 : Node { boolean supports(in DOMString feature, in DOMString version); }; interface Attr2 : Attr { readonly attribute Element ownerElement; }; interface HTMLDOMImplementation : DOMImplementation { HTMLDocument createHTMLDocument(in DOMString title); }; }; #endif // _DOM2_IDL_
// File: namespaces.idl #ifndef _NAMESPACES_IDL_ #define _NAMESPACES_IDL_ #include "dom.idl" #include "dom2.idl" #pragma prefix "dom.w3c.org" module namespaces { typedef dom dom2::DOMString DOMString; typedef dom dom2::Element Element; typedef dom dom2::Attr Attr; typedef dom dom2::NodeList NodeList; interface NodeNS { readonly attribute DOMString namespaceName; attribute DOMString prefix; // raises(DOMException) on setting readonly attribute DOMString localName; }; interface DocumentNS { Element createElementNS(in DOMString namespaceName, in DOMString qualifiedName) raises(DOMException); Attr createAttributeNS(in DOMString namespaceName, in DOMString qualifiedName) raises(DOMException); NodeList getElementsByTagNameNS(in DOMString namespaceName, in DOMString localName); }; interface ElementNS { DOMString getAttributeNS(in DOMString namespaceName, in DOMString localName); void setAttributeNS(in DOMString namespaceName, in DOMString localName, in DOMString value) raises(DOMException); void removeAttributeNS(in DOMString namespaceName, in DOMString localName) raises(DOMException); Attr getAttributeNodeNS(in DOMString namespaceName, in DOMString localName); Attr setAttributeNodeNS(in Attr newAttr) raises(DOMException); NodeList getElementsByTagNameNS(in DOMString namespaceName, in DOMString localName); }; interface NodeNS { readonly attribute DOMString universalName; readonly attribute DOMString namespaceName; attribute DOMString prefix; // raises(DOMException) on setting readonly attribute DOMString localName; }; }; #endif // _NAMESPACES_IDL_
// File: stylesheets.idl #ifndef _STYLESHEETS_IDL_ #define _STYLESHEETS_IDL_ #include "dom.idl" #pragma prefix "dom.w3c.org" module stylesheets { typedef dom::DOMString DOMString; typedef dom::Node Node; interface MediaList; interface StyleSheet { readonly attribute DOMString type; attribute boolean disabled; readonly attribute Node ownerNode; readonly attribute StyleSheet parentStyleSheet; readonly attribute DOMString href; readonly attribute DOMString title; readonly attribute MediaList media; }; interface StyleSheetList { readonly attribute unsigned long length; StyleSheet item(in unsigned long index); }; interface MediaList { attribute DOMString cssText; // raises(DOMException) on setting readonly attribute unsigned long length; DOMString item(in unsigned long index); void delete(in DOMString oldMedium) raises(DOMException); void append(in DOMString newMedium) raises(DOMException); }; interface DocumentStyle { readonly attribute StyleSheetList styleSheets; }; }; #endif // _STYLESHEETS_IDL_
// File: css.idl #ifndef _CSS_IDL_ #define _CSS_IDL_ #include "dom.idl" #include "stylesheets.idl" #pragma prefix "dom.w3c.org" module css { typedef dom stylesheets::DOMString DOMString; typedef dom stylesheets::MediaList MediaList; typedef dom stylesheets::float float; typedef dom stylesheets::StyleSheet StyleSheet; interface CSSRule; interface CSSStyleSheet; interface CSSStyleDeclaration; interface CSSValue; interface Counter; interface Rect; interface RGBColor; interface CSSRuleList { 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 CHARSET_RULE = 2; const unsigned short IMPORT_RULE = 3; const unsigned short MEDIA_RULE = 4; const unsigned short FONT_FACE_RULE = 5; const unsigned short PAGE_RULE = 6; readonly attribute unsigned short type; attribute DOMString cssText; // raises(DOMException) on setting readonly attribute CSSStyleSheet parentStyleSheet; readonly attribute CSSRule parentRule; }; interface CSSStyleRule : CSSRule { attribute DOMString selectorText; // raises(DOMException) on setting readonly attribute CSSStyleDeclaration style; }; interface CSSMediaRule : CSSRule { readonly attribute MediaList media; readonly attribute CSSRuleList cssRules; unsigned long insertRule(in DOMString rule, in unsigned long index) raises(DOMException); void deleteRule(in unsigned long index) raises(DOMException); }; interface CSSFontFaceRule : CSSRule { readonly attribute CSSStyleDeclaration style; }; interface CSSPageRule : CSSRule { attribute DOMString selectorText; // raises(DOMException) on setting readonly attribute CSSStyleDeclaration style; }; interface CSSImportRule : CSSRule { readonly attribute DOMString href; readonly attribute MediaList media; readonly attribute CSSStyleSheet styleSheet; }; interface CSSCharsetRule : CSSRule { attribute DOMString encoding; // raises(DOMException) on setting }; interface CSSUnknownRule : CSSRule { }; interface CSSStyleDeclaration { attribute DOMString cssText; // raises(DOMException) on setting DOMString getPropertyValue(in DOMString propertyName); CSSValue getPropertyCSSValue(in DOMString propertyName); DOMString removeProperty(in DOMString propertyName) raises(DOMException); 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); readonly attribute CSSRule parentRule; }; interface CSSValue { // UnitTypes const unsigned short CSS_PRIMITIVE_VALUE = 0; const unsigned short CSS_VALUE_LIST = 1; const unsigned short CSS_CUSTOM = 2; attribute DOMString cssText; // raises(DOMException) on setting readonly attribute unsigned short valueType; }; interface CSSPrimitiveValue : CSSValue { // UnitTypes const unsigned short CSS_UNKNOWN = 0; const unsigned short CSS_INHERIT = 1; const unsigned short CSS_NUMBER = 2; const unsigned short CSS_PERCENTAGE = 3; const unsigned short CSS_EMS = 4; const unsigned short CSS_EXS = 5; const unsigned short CSS_PX = 6; const unsigned short CSS_CM = 7; const unsigned short CSS_MM = 8; const unsigned short CSS_IN = 9; const unsigned short CSS_PT = 10; const unsigned short CSS_PC = 11; const unsigned short CSS_DEG = 12; const unsigned short CSS_RAD = 13; const unsigned short CSS_GRAD = 14; const unsigned short CSS_MS = 15; const unsigned short CSS_S = 16; const unsigned short CSS_HZ = 17; const unsigned short CSS_KHZ = 18; const unsigned short CSS_DIMENSION = 19; const unsigned short CSS_STRING = 20; const unsigned short CSS_URI = 21; const unsigned short CSS_IDENT = 22; const unsigned short CSS_ATTR = 23; const unsigned short CSS_COUNTER = 24; const unsigned short CSS_RECT = 26; const unsigned short CSS_RGBCOLOR = 27; readonly attribute unsigned short primitiveType; void setFloatValue(in unsigned short unitType, in float floatValue) raises(DOMException); float getFloatValue(in unsigned short unitType) raises(DOMException); void setStringValue(in unsigned short stringType, in DOMString stringValue) raises(DOMException); DOMString getStringValue() raises(DOMException); Counter getCounterValue() raises(DOMException); Rect getRectValue() raises(DOMException); RGBColor getRGBColorValue() raises(DOMException); }; interface CSSValueList : CSSValue { readonly attribute unsigned long length; CSSValue item(in unsigned long index); }; interface RGBColor { attribute CSSValue red; attribute CSSValue green; attribute CSSValue blue; }; interface Rect { attribute CSSValue top; attribute CSSValue right; attribute CSSValue bottom; attribute CSSValue left; }; interface Counter { attribute DOMString identifier; attribute DOMString listStyle; attribute DOMString separator; }; interface CSS2Azimuth : CSSValue { readonly attribute unsigned short azimuthType; readonly attribute DOMString identifier; readonly attribute boolean behind; void setAngleValue(in unsigned short unitType, in float floatValue) raises(DOMException); float getAngleValue(in unsigned short unitType) raises(DOMException); void setIdentifier(in DOMString identifier, in boolean behind) raises(DOMException); }; interface CSS2BackgroundPosition : CSSValue { readonly attribute unsigned short horizontalType; readonly attribute unsigned short verticalType; readonly attribute DOMString horizontalIdentifier; readonly attribute DOMString verticalIdentifier; float getHorizontalPosition(in float horizontalType) raises(DOMException); float getVerticalPosition(in float verticalType) raises(DOMException); void setHorizontalPosition(in unsigned short horizontalType, in float value) raises(DOMException); void setVerticalPosition(in unsigned short verticalType, in float value) raises(DOMException); void setPositionIdentifier(in DOMString horizontalIdentifier, in DOMString verticalIdentifier) raises(DOMException); }; interface CSS2BorderSpacing : CSSValue { readonly attribute unsigned short horizontalType; readonly attribute unsigned short verticalType; float getHorizontalSpacing(in float horizontalType) raises(DOMException); float getVerticalSpacing(in float verticalType) raises(DOMException); void setHorizontalSpacing(in unsigned short horizontalType, in float value) raises(DOMException); void setVerticalSpacing(in unsigned short verticalType, in float value) raises(DOMException); void setInherit()(); }; interface CSS2CounterReset { attribute DOMString identifier; // raises(DOMException) on setting attribute short reset; // raises(DOMException) on setting }; interface CSS2CounterIncrement { attribute DOMString identifier; // raises(DOMException) on setting attribute short increment; // raises(DOMException) on setting }; interface CSS2Cursor : CSSValue { attribute unsigned short cursorType; readonly attribute CSSValueList uris; attribute DOMString predefinedCursor; // raises(DOMException) on setting }; interface CSS2PlayDuring : CSSValue { readonly attribute unsigned short playDuringType; attribute DOMString playDuringIdentifier; // raises(DOMException) on setting attribute DOMString uri; // raises(DOMException) on setting attribute boolean mix; // raises(DOMException) on setting attribute boolean repeat; // raises(DOMException) on setting }; interface CSS2TextShadow { readonly attribute CSSValue color; readonly attribute CSSValue horizontal; readonly attribute CSSValue vertical; readonly attribute CSSValue blur; }; interface CSS2FontFaceSrc { attribute DOMString uri; // raises(DOMException) on setting readonly attribute CSSValueList format; attribute DOMString fontFaceName; // raises(DOMException) on setting }; interface CSS2FontFaceWidths { attribute DOMString urange; // raises(DOMException) on setting readonly attribute CSSValueList numbers; }; interface CSS2PageSize : CSSValue { readonly attribute unsigned short widthType; readonly attribute unsigned short heightType; readonly attribute DOMString identifier; float getWidth(in float widthType) raises(DOMException); float getHeightSize(in float heightType) raises(DOMException); void setWidthSize(in unsigned short widthType, in float value) raises(DOMException); void setHeightSize(in unsigned short heightType, in float value) raises(DOMException); void setIdentifier(in DOMString identifier) raises(DOMException); }; 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; }; interface CSSStyleSheet : StyleSheet { readonly attribute CSSRule ownerRule; readonly attribute CSSRuleList cssRules; unsigned long insertRule(in DOMString rule, in unsigned long index) raises(DOMException); void deleteRule(in unsigned long index) raises(DOMException); }; }; #endif // _CSS_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 EventListener; interface Event; interface EventTarget { void addEventListener(in DOMString type, in EventListener listener, in boolean useCapture); void removeEventListener(in DOMString type, in EventListener listener, in boolean useCapture); }; interface EventListener { void handleEvent(in Event event); }; interface Event { // PhaseType const unsigned short BUBBLING_PHASE = 1; const unsigned short CAPTURING_PHASE = 2; const unsigned short AT_TARGET = 3; attribute DOMString type; attribute Node target; attribute Node currentNode; attribute unsigned short eventPhase; void preventBubble(); void preventCapture(); void preventDefault(); }; interface UIEvent : Event { const int CHAR_UNDEFINED = 1; const int KEY_FIRST = 1; const int KEY_LAST = 1; const int VK_0 = 1; const int VK_1 = 1; const int VK_2 = 1; const int VK_3 = 1; const int VK_4 = 1; const int VK_5 = 1; const int VK_6 = 1; const int VK_7 = 1; const int VK_8 = 1; const int VK_9 = 1; const int VK_A = 1; const int VK_ACCEPT = 1; const int VK_ADD = 1; const int VK_AGAIN = 1; const int VK_ALL_CANDIDATES = 1; const int VK_ALPHANUMERIC = 1; const int VK_ALT = 1; const int VK_ALT_GRAPH = 1; const int VK_AMPERSAND = 1; const int VK_ASTERISK = 1; const int VK_AT = 1; const int VK_B = 1; const int VK_BACK_QUOTE = 1; const int VK_BACK_SLASH = 1; const int VK_BACK_SPACE = 1; const int VK_BRACELEFT = 1; const int VK_BRACERIGHT = 1; const int VK_C = 1; const int VK_CANCEL = 1; const int VK_CAPS_LOCK = 1; const int VK_CIRCUMFLEX = 1; const int VK_CLEAR = 1; const int VK_CLOSE_BRACKET = 1; const int VK_CODE_INPUT = 1; const int VK_COLON = 1; const int VK_COMMA = 1; const int VK_COMPOSE = 1; const int VK_CONTROL = 1; const int VK_CONVERT = 1; const int VK_COPY = 1; const int VK_CUT = 1; const int VK_D = 1; const int VK_DEAD_ABOVEDOT = 1; const int VK_DEAD_ABOVERING = 1; const int VK_DEAD_ACUTE = 1; const int VK_DEAD_BREVE = 1; const int VK_DEAD_CARON = 1; const int VK_DEAD_CEDILLA = 1; const int VK_DEAD_CIRCUMFLEX = 1; const int VK_DEAD_DIAERESIS = 1; const int VK_DEAD_DOUBLEACUTE = 1; const int VK_DEAD_GRAVE = 1; const int VK_DEAD_IOTA = 1; const int VK_DEAD_MACRON = 1; const int VK_DEAD_OGONEK = 1; const int VK_DEAD_SEMIVOICED_SOUND = 1; const int VK_DEAD_TILDE = 1; const int VK_DEAD_VOICED_SOUND = 1; const int VK_DECIMAL = 1; const int VK_DELETE = 1; const int VK_DIVIDE = 1; const int VK_DOLLAR = 1; const int VK_DOWN = 1; const int VK_E = 1; const int VK_END = 1; const int VK_ENTER = 1; const int VK_EQUALS = 1; const int VK_ESCAPE = 1; const int VK_EURO_SIGN = 1; const int VK_EXCLAMATION_MARK = 1; const int VK_F = 1; const int VK_F1 = 1; const int VK_F10 = 1; const int VK_F11 = 1; const int VK_F12 = 1; const int VK_F13 = 1; const int VK_F14 = 1; const int VK_F15 = 1; const int VK_F16 = 1; const int VK_F17 = 1; const int VK_F18 = 1; const int VK_F19 = 1; const int VK_F2 = 1; const int VK_F20 = 1; const int VK_F21 = 1; const int VK_F22 = 1; const int VK_F23 = 1; const int VK_F24 = 1; const int VK_F3 = 1; const int VK_F4 = 1; const int VK_F5 = 1; const int VK_F6 = 1; const int VK_F7 = 1; const int VK_F8 = 1; const int VK_F9 = 1; const int VK_FINAL = 1; const int VK_FIND = 1; const int VK_FULL_WIDTH = 1; const int VK_G = 1; const int VK_GREATER = 1; const int VK_H = 1; const int VK_HALF_WIDTH = 1; const int VK_HELP = 1; const int VK_HIRAGANA = 1; const int VK_HOME = 1; const int VK_I = 1; const int VK_INSERT = 1; const int VK_INVERTED_EXCLAMATION_MARK = 1; const int VK_J = 1; const int VK_JAPANESE_HIRAGANA = 1; const int VK_JAPANESE_KATAKANA = 1; const int VK_JAPANESE_ROMAN = 1; const int VK_K = 1; const int VK_KANA = 1; const int VK_KANJI = 1; const int VK_KATAKANA = 1; const int VK_KP_DOWN = 1; const int VK_KP_LEFT = 1; const int VK_KP_RIGHT = 1; const int VK_KP_UP = 1; const int VK_L = 1; const int VK_LEFT = 1; const int VK_LEFT_PARENTHESIS = 1; const int VK_LESS = 1; const int VK_M = 1; const int VK_META = 1; const int VK_MINUS = 1; const int VK_MODECHANGE = 1; const int VK_MULTIPLY = 1; const int VK_N = 1; const int VK_NONCONVERT = 1; const int VK_NUM_LOCK = 1; const int VK_NUMBER_SIGN = 1; const int VK_NUMPAD0 = 1; const int VK_NUMPAD1 = 1; const int VK_NUMPAD2 = 1; const int VK_NUMPAD3 = 1; const int VK_NUMPAD4 = 1; const int VK_NUMPAD5 = 1; const int VK_NUMPAD6 = 1; const int VK_NUMPAD7 = 1; const int VK_NUMPAD8 = 1; const int VK_NUMPAD9 = 1; const int VK_O = 1; const int VK_OPEN_BRACKET = 1; const int VK_P = 1; const int VK_PAGE_DOWN = 1; const int VK_PAGE_UP = 1; const int VK_PASTE = 1; const int VK_PAUSE = 1; const int VK_PERIOD = 1; const int VK_PLUS = 1; const int VK_PREVIOUS_CANDIDATE = 1; const int VK_PRINTSCREEN = 1; const int VK_PROPS = 1; const int VK_Q = 1; const int VK_QUOTE = 1; const int VK_QUOTEDBL = 1; const int VK_R = 1; const int VK_RIGHT = 1; const int VK_RIGHT_PARENTHESIS = 1; const int VK_ROMAN_CHARACTERS = 1; const int VK_S = 1; const int VK_SCROLL_LOCK = 1; const int VK_SEMICOLON = 1; const int VK_SEPARATER = 1; const int VK_SHIFT = 1; const int VK_SLASH = 1; const int VK_SPACE = 1; const int VK_STOP = 1; const int VK_SUBTRACT = 1; const int VK_T = 1; const int VK_TAB = 1; const int VK_U = 1; const int VK_UNDEFINED = 1; const int VK_UNDERSCORE = 1; const int VK_UNDO = 1; const int VK_UP = 1; const int VK_V = 1; const int VK_W = 1; const int VK_X = 1; const int VK_Y = 1; const int VK_Z = 1; attribute long screenX; attribute long screenY; attribute long clientX; attribute long clientY; attribute boolean ctrlKey; attribute boolean shiftKey; attribute boolean altKey; attribute boolean metaKey; attribute unsigned long keyCode; attribute unsigned long charCode; attribute unsigned short button; attribute unsigned short clickCount; }; interface MutationEvent : Event { attribute Node relatedNode; attribute DOMString prevValue; attribute DOMString newValue; attribute DOMString attrName; }; }; #endif // _EVENTS_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 NodeFilter; interface NodeIterator { readonly attribute long whatToShow; // Constants for whatToShow const unsigned long SHOW_ALL = 0xFFFF; const unsigned long SHOW_ELEMENT = 0x00000001; const unsigned long SHOW_ATTRIBUTE = 0x00000002; const unsigned long SHOW_TEXT = 0x00000004; const unsigned long SHOW_CDATA_SECTION = 0x00000008; const unsigned long SHOW_ENTITY_REFERENCE = 0x00000010; const unsigned long SHOW_ENTITY = 0x00000020; const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x00000040; const unsigned long SHOW_COMMENT = 0x00000080; const unsigned long SHOW_DOCUMENT = 0x00000100; const unsigned long SHOW_DOCUMENT_TYPE = 0x00000200; const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x00000400; const unsigned long SHOW_NOTATION = 0x00000800; readonly attribute NodeFilter filter; Node nextNode(); Node previousNode(); }; interface NodeFilter { // Constants returned by acceptNode const short FILTER_ACCEPT = 1; const short FILTER_REJECT = 2; const short FILTER_SKIP = 3; short acceptNode(in Node n); }; interface TreeWalker { readonly attribute long whatToShow; // Constants for whatToShow const unsigned long SHOW_ALL = 0xFFFF; const unsigned long SHOW_ELEMENT = 0x00000001; const unsigned long SHOW_ATTRIBUTE = 0x00000002; const unsigned long SHOW_TEXT = 0x00000004; const unsigned long SHOW_CDATA_SECTION = 0x00000008; const unsigned long SHOW_ENTITY_REFERENCE = 0x00000010; const unsigned long SHOW_ENTITY = 0x00000020; const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x00000040; const unsigned long SHOW_COMMENT = 0x00000080; const unsigned long SHOW_DOCUMENT = 0x00000100; const unsigned long SHOW_DOCUMENT_TYPE = 0x00000200; const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x00000400; const unsigned long SHOW_NOTATION = 0x00000800; readonly attribute NodeFilter filter; Node current(); Node parentNode(); Node firstChild(); Node lastChild(); Node previousSibling(); Node nextSibling(); }; interface DocumentIF { short createNodeIterator(in Node root, in short whatToShow, in NodeFilter filter); }; }; #endif // _FI_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_NODE_ERR = 203; interface Range { readonly attribute Node startContainer; readonly attribute long startOffset; readonly attribute Node endContainer; readonly attribute long endOffset; readonly attribute boolean isCollapsed; readonly attribute Node commonAncestorContainer; void setStart(in Node node, in long offset) raises(RangeException); void setEnd(in Node node, in long offset) raises(RangeException); void setStartBefore(in Node node) raises(RangeException); void setStartAfter(in Node node) raises(RangeException); void setEndBefore(in Node node) raises(RangeException); void setEndAfter(in Node node) raises(RangeException); void collapse(in boolean toStart); void selectNode(in Node node) raises(RangeException); void selectNodeContents(in Node node) 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() raises(DOMException); void insertNode(in Node node) raises(DOMException, RangeException); void surroundContents(in Node node) raises(DOMException, RangeException); Range cloneRange(); DOMString toString(); }; }; #endif // _RANGE_IDL_