Annotation of DOM/dom-core.idl, revision 1.1.1.1

1.1       daniel      1: //
                      2: // Document Object Model (Core) Level 1 ISL
                      3: // As of Tue Jun  9 16:52:45 EDT 1998
                      4: //
                      5: 
                      6: //
                      7: // Modifs:
                      8: //    replaced interface by raise for exceptions;
                      9: //    "interface NotMyChildException {}" => "raises NotMyChildException".
                     10: //
                     11: //    replaced "wstring" (Unicode) for simple "string".
                     12: //
                     13: //    replaced "int" by "long".
                     14: //
                     15: //    Reordered interface list and added forward references.
                     16: //
                     17: //    Added a definition for NotMyChildException, NoSuchNodeException,
                     18: //           NoSuchAttributeException.
                     19: //
                     20: //    Renamed Node:PI to Node:PIS due to clash with PI interface.
                     21: //
                     22: 
                     23: interface Document;
                     24: interface Node;
                     25: interface NodeIterator;
                     26: interface Element;
                     27: interface Text;
                     28: interface Comment;
                     29: interface PI;
                     30: interface Attribute;
                     31: interface AttributeList;
                     32: interface TreeIterator;
                     33: 
                     34: interface DOM {
                     35:     Document            createDocument(in string type); // wstring
                     36:     boolean             hasFeature(in string feature); // wstring
                     37: };
                     38: 
                     39: interface DocumentContext {
                     40:     attribute Document       document;
                     41: };
                     42: 
                     43: exception NotMyChildException {
                     44: };
                     45: exception NoSuchNodeException {
                     46: };
                     47: exception NoSuchAttributeException {
                     48: };
                     49: 
                     50: interface Node {
                     51:     // NodeType
                     52:     const long            DOCUMENT             = 1;
                     53:     const long            ELEMENT              = 2;
                     54:     const long            ATTRIBUTE            = 3;
                     55:     const long            PIS                  = 4;
                     56:     const long            COMMENT              = 5;
                     57:     const long            TEXT                 = 6;
                     58: 
                     59:     long                 getNodeType();
                     60:     Node                getParentNode();
                     61:     NodeIterator        getChildNodes();
                     62:     boolean             hasChildNodes();
                     63:     Node                getFirstChild();
                     64:     Node                getPreviousSibling();
                     65:     Node                getNextSibling();
                     66:     Node                insertBefore(in Node newChild, in Node refChild)
                     67:                           raises (NotMyChildException);
                     68:     Node                replaceChild(in Node newChild, in Node oldChild) 
                     69:                           raises (NotMyChildException);
                     70:     Node                removeChild(in Node oldChild)
                     71:                           raises (NotMyChildException);
                     72: };
                     73: 
                     74: interface DocumentFragment : Node {
                     75:     attribute Document       masterDoc;
                     76: };
                     77: 
                     78: interface Document : DocumentFragment {
                     79:     attribute Node           documentType;
                     80:     attribute Element        documentElement;
                     81:     attribute DocumentContext contextInfo;
                     82:     DocumentContext     createDocumentContext();
                     83:     Element             createElement(in string tagName, // wstring
                     84:                                      in AttributeList attributes);
                     85:     Text                createTextNode(in string data); // wstring
                     86:     Comment             createComment(in string data); // wstring
                     87:     PI                  createPI(in string name,  // wstring
                     88:                                 in string data); // wstring
                     89:     Attribute           createAttribute(in string name,  // wstring
                     90:                                        in Node value);
                     91:     AttributeList       createAttributeList();
                     92:     TreeIterator        createTreeIterator(in Node node);
                     93:     NodeIterator        getElementsByTagName(in string tagname); // wstring
                     94: };
                     95: 
                     96: interface NodeIterator {
                     97:     unsigned long       getLength();
                     98:     unsigned long       getCurrentPos();
                     99:     boolean             atFirst();
                    100:     boolean             atLast();
                    101:     Node                toNextNode();
                    102:     Node                toPrevNode();
                    103:     Node                toFirstNode();
                    104:     Node                toLastNode();
                    105:     Node                moveTo(in long n);
                    106: };
                    107: 
                    108: 
                    109: interface TreeIterator : NodeIterator {
                    110:     unsigned long       numChildren();
                    111:     unsigned long       numPreviousSiblings();
                    112:     unsigned long       numNextSiblings();
                    113:     Node                toParent();
                    114:     Node                toPreviousSibling();
                    115:     Node                toNextSibling();
                    116:     Node                toFirstChild();
                    117:     Node                toLastChild();
                    118:     Node                toNthChild(in long n) raises (NoSuchNodeException);
                    119: };
                    120: 
                    121: interface Attribute {
                    122:     string              getName(); // wstring
                    123:     string              getValue(); // wstring
                    124:     attribute boolean   specified;
                    125:     string              toString(); // wstring
                    126: };
                    127: 
                    128: interface AttributeList {
                    129:     Attribute           getAttribute(in string attrName); // wstring
                    130:     Attribute           setAttribute(in Attribute attr);
                    131:     Attribute           remove(in string attrName) // wstring
                    132:                             raises (NoSuchAttributeException);
                    133:     Attribute           item(in unsigned long index)
                    134:                             raises (NoSuchAttributeException);
                    135:     unsigned long       getLength();
                    136: };
                    137: 
                    138: interface Element : Node {
                    139:     string              getTagName(); // wstring
                    140:     NodeIterator        getAttributes();
                    141:     string              getAttribute(in string name); // wstring
                    142:     void                setAttribute(in string name, // wstring
                    143:                                     in string value);// wstring
                    144:     void                removeAttribute(in string name); // wstring
                    145:     Attribute           getAttributeNode(in string name);
                    146:     void                setAttributeNode(in Attribute newAttr);
                    147:     void                removeAttributeNode(in Attribute oldAttr);
                    148:     void                getElementsByTagName(in string tagname); // wstring
                    149:     void                normalize();
                    150: };
                    151: 
                    152: interface Text : Node {
                    153:     attribute string        data; // wstring
                    154:     void                append(in string data); // wstring
                    155:     void                insert(in long offset, 
                    156:                               in string data); // wstring
                    157:     void                delete(in long offset, 
                    158:                               in long count);
                    159:     void                replace(in long offset, 
                    160:                                in long count, 
                    161:                                in string data); // wstring
                    162:     void                splice(in Element element, 
                    163:                               in long offset, 
                    164:                               in long count);
                    165: };
                    166: 
                    167: interface Comment : Node {
                    168:     attribute string        data; // wstring
                    169: };
                    170: 
                    171: interface PI : Node {
                    172:     attribute string        name; // wstring
                    173:     attribute string        data; // wstring
                    174: };
                    175: 

Webmaster