/* * Copyright (c) 2000 World Wide Web Consortium, * (Massachusetts Institute of Technology, Institut National de * Recherche en Informatique et en Automatique, Keio University). All * Rights Reserved. This program is distributed under the W3C's Software * Intellectual Property License. This program is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. * See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ // File: http://www.w3.org/TR/2000/WD-DOM-Level-3-Content-Models-and-Load-Save-20001101/content-models.idl #ifndef _CONTENT-MODELS_IDL_ #define _CONTENT-MODELS_IDL_ #include "dom.idl" #pragma prefix "dom.w3c.org" module content-models { typedef dom::DOMString DOMString; typedef dom::Node Node; typedef dom::nsElement nsElement; typedef dom::namedCMNodeMap namedCMNodeMap; typedef dom::Document Document; typedef dom::DomImplementation DomImplementation; typedef dom::Element Element; typedef dom::Text Text; typedef dom::DocumentType DocumentType; interface DOMLocator; interface CMObject { }; interface CMExternalObject { }; interface CMNode { }; interface CMNodeList { }; interface NamedCMNodeMap { }; interface CMDataType { }; interface CMType { }; interface ElementDeclaration { readonly attribute DOMString elementName; attribute DOMString contentType; attribute NamedCMNodeMap attributes; }; interface CMElement { attribute DOMString listOperator; attribute CMDataType elementType; attribute int multiplicity; attribute int lowValue; attribute int highValue; attribute NamedCMNodeMap subModels; attribute CMNodeList definingElement; }; interface AttributeDeclaration { readonly attribute DOMString attrName; attribute CMDataType attrType; attribute DOMString defaultValue; attribute DOMString enumAttr; attribute CMNodeList ownerElement; }; interface EntityDeclaration { }; interface ErrorHandler { void warning(in DOMLocator where, in DOMString how, in DOMString why) raises(dom::DOMException2); void fatalError(in DOMLocator where, in DOMString how, in DOMString why) raises(dom::DOMException2); void error(in DOMLocator where, in DOMString how, in DOMString why) raises(dom::DOMException2); }; interface DOMLocator { int getColumnNumber(); int getLineNumber(); DOMString getPublicID(); DOMString getSystemID(); Node getNode(); }; interface CMObject { readonly attribute boolean isNamespaceAware; nsElement getCMNamespace(); namedCMNodeMap getCMElements(); boolean removeCMNode(in CMNode node); boolean insertbeforeCMNode(in CMNode newnode, in CMNode parentnode); }; interface CMNode { CMType getCMNodeType(); }; interface ElementDeclaration { int getContentType(); CMElement getCMElement(); namedCMNodeMap getCMAttributes(); namedCMNodeMap getCMElementsChildren(); }; interface CMElement { CMElement setCMElementCardinality(in CMNode node, in int high, in int low); CMElement getCMElementCardinality(in CMNode node, out int high, out int low); }; interface DocumentCM : Document { boolean isValid(); int numCMs(); CMObject getInternalCM(); CMExternalObject getCMs(); CMObject getActiveCM(); void addCM(in CMObject cm); void removeCM(in CMObject cm); boolean activateCM(in CMObject cm); void setErrorHandler(in ErrorHandler handler); }; interface DomImplementationCM : DomImplementation { boolean validate(); CMObject createCM(); CMExternalObject createExternalCM(); CMObject cloneCM(in CMObject cm); CMExternalObject cloneExternalCM(in CMExternalObject cm); }; interface NodeCM : Node { boolean canInsertBefore(in Node newChild, in Node refChild) raises(dom::DOMException); boolean canRemoveChild(in Node oldChild) raises(dom::DOMException); boolean canReplaceChild(in Node newChild, in Node oldChild) raises(dom::DOMException); boolean canAppendChild(in Node newChild) raises(dom::DOMException); }; interface ElementCM : Element { boolean isValid(); int contentType(); boolean canSetAttribute(in DOMString attrname, in DOMString attrval); boolean canSetAttributeNode(in Node node); boolean canSetAttributeNodeNS(in Node node, in DOMString namespaceURI, in DOMString localName); boolean canSetAttributeNS(in DOMString attrname, in DOMString attrval, in DOMString namespaceURI, in DOMString localName); }; interface CharacterDataCM : Text { boolean isWhitespaceOnly(); boolean canSetData(in unsigned long offset, in DOMString arg) raises(dom::DOMException); boolean canAppendData(in DOMString arg) raises(dom::DOMException); boolean canReplaceData(in unsigned long offset, in unsigned long count, in DOMString arg) raises(dom::DOMException); boolean canInsertData(in unsigned long offset, in DOMString arg) raises(dom::DOMException); boolean canDeleteData(in unsigned long offset, in DOMString arg) raises(dom::DOMException); }; interface DocumentTypeCM : DocumentType { boolean isElementDefined(in DOMString elemTypeName); boolean isElementDefinedNS(in DOMString elemTypeName, in DOMString namespaceURI, in DOMString localName); boolean isAttributeDefined(in DOMString elemTypeName, in DOMString attrName); boolean isAttributeDefinedNS(in DOMString elemTypeName, in DOMString attrName, in DOMString namespaceURI, in DOMString localName); boolean isEntityDefined(in DOMString entName); }; }; #endif // _CONTENT-MODELS_IDL_