diff --git a/dom/public/idl/traversal/.cvsignore b/dom/public/idl/traversal/.cvsignore new file mode 100644 index 000000000000..361cd28a27d4 --- /dev/null +++ b/dom/public/idl/traversal/.cvsignore @@ -0,0 +1,3 @@ +Makefile +genjs +genx diff --git a/dom/public/idl/traversal/MANIFEST_IDL b/dom/public/idl/traversal/MANIFEST_IDL new file mode 100644 index 000000000000..63710fca6883 --- /dev/null +++ b/dom/public/idl/traversal/MANIFEST_IDL @@ -0,0 +1,4 @@ +nsIDOMDocumentTraversal.idl +nsIDOMNodeFilter.idl +nsIDOMNodeIterator.idl +nsIDOMTreeWalker.idl diff --git a/dom/public/idl/traversal/Makefile.in b/dom/public/idl/traversal/Makefile.in new file mode 100644 index 000000000000..ebe2921f8f66 --- /dev/null +++ b/dom/public/idl/traversal/Makefile.in @@ -0,0 +1,51 @@ +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is this file as it was released on +# May 1 2001. +# +# The Initial Developer of the Original Code is Jonas Sicking. +# Portions created by Jonas Sicking are Copyright (C) 2001 +# Jonas Sicking. All Rights Reserved. +# +# Contributor(s): +# Jonas Sicking (Original Author) +# +# Alternatively, the contents of this file may be used under the +# terms of the GNU General Public License Version 2 or later (the +# "GPL"), in which case the provisions of the GPL are applicable +# instead of those above. If you wish to allow use of your +# version of this file only under the terms of the GPL and not to +# allow others to use your version of this file under the MPL, +# indicate your decision by deleting the provisions above and +# replace them with the notice and other provisions required by +# the GPL. If you do not delete the provisions above, a recipient +# may use your version of this file under either the MPL or the +# GPL. + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = dom +XPIDL_MODULE = dom_traversal + +XPIDLSRCS = \ + nsIDOMDocumentTraversal.idl \ + nsIDOMNodeFilter.idl \ + nsIDOMNodeIterator.idl \ + nsIDOMTreeWalker.idl \ + $(NULL) + +include $(topsrcdir)/config/rules.mk diff --git a/dom/public/idl/traversal/makefile.win b/dom/public/idl/traversal/makefile.win new file mode 100755 index 000000000000..9eadb6d81d9a --- /dev/null +++ b/dom/public/idl/traversal/makefile.win @@ -0,0 +1,47 @@ +#!nmake +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is this file as it was released on +# May 1 2001. +# +# The Initial Developer of the Original Code is Jonas Sicking. +# Portions created by Jonas Sicking are Copyright (C) 2001 +# Jonas Sicking. All Rights Reserved. +# +# Contributor(s): +# Jonas Sicking (Original Author) +# +# Alternatively, the contents of this file may be used under the +# terms of the GNU General Public License Version 2 or later (the +# "GPL"), in which case the provisions of the GPL are applicable +# instead of those above. If you wish to allow use of your +# version of this file only under the terms of the GPL and not to +# allow others to use your version of this file under the MPL, +# indicate your decision by deleting the provisions above and +# replace them with the notice and other provisions required by +# the GPL. If you do not delete the provisions above, a recipient +# may use your version of this file under either the MPL or the +# GPL. + +DEPTH=..\..\..\.. + +MODULE=dom +XPIDL_MODULE=dom_traversal + +XPIDLSRCS = \ + .\nsIDOMDocumentTraversal.idl \ + .\nsIDOMNodeFilter.idl \ + .\nsIDOMNodeIterator.idl \ + .\nsIDOMTreeWalker.idl \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> diff --git a/dom/public/idl/traversal/nsIDOMDocumentTraversal.idl b/dom/public/idl/traversal/nsIDOMDocumentTraversal.idl new file mode 100644 index 000000000000..2002d0edcbb7 --- /dev/null +++ b/dom/public/idl/traversal/nsIDOMDocumentTraversal.idl @@ -0,0 +1,52 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is this file as it was released on + * May 1 2001. + * + * The Initial Developer of the Original Code is Jonas Sicking. + * Portions created by Jonas Sicking are Copyright (C) 2001 + * Jonas Sicking. All Rights Reserved. + * + * Contributor(s): + * Jonas Sicking (Original Author) + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License Version 2 or later (the + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your + * version of this file only under the terms of the GPL and not to + * allow others to use your version of this file under the MPL, + * indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by + * the GPL. If you do not delete the provisions above, a recipient + * may use your version of this file under either the MPL or the + * GPL. + * + */ + +#include "domstubs.idl" + +[scriptable, uuid(13f236c0-47f8-11d5-b6a3-009027446e84)] +// Introduced in DOM Level 2: +interface nsIDOMDocumentTraversal : nsISupports { + nsIDOMNodeIterator createNodeIterator(in nsIDOMNode root, + in unsigned long whatToShow, + in nsIDOMNodeFilter filter, + in boolean entityReferenceExpansion) + raises(DOMException); + nsIDOMTreeWalker createTreeWalker(in nsIDOMNode root, + in unsigned long whatToShow, + in nsIDOMNodeFilter filter, + in boolean entityReferenceExpansion) + raises(DOMException); +}; diff --git a/dom/public/idl/traversal/nsIDOMNodeFilter.idl b/dom/public/idl/traversal/nsIDOMNodeFilter.idl new file mode 100644 index 000000000000..aefbe8e44594 --- /dev/null +++ b/dom/public/idl/traversal/nsIDOMNodeFilter.idl @@ -0,0 +1,65 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is this file as it was released on + * May 1 2001. + * + * The Initial Developer of the Original Code is Jonas Sicking. + * Portions created by Jonas Sicking are Copyright (C) 2001 + * Jonas Sicking. All Rights Reserved. + * + * Contributor(s): + * Jonas Sicking (Original Author) + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License Version 2 or later (the + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your + * version of this file only under the terms of the GPL and not to + * allow others to use your version of this file under the MPL, + * indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by + * the GPL. If you do not delete the provisions above, a recipient + * may use your version of this file under either the MPL or the + * GPL. + * + */ + +#include "domstubs.idl" + +[scriptable, uuid(e4723748-1dd1-11b2-8ee6-866a532a6237)] +// Introduced in DOM Level 2: +interface nsIDOMNodeFilter : nsISupports { + + // Constants returned by acceptNode + const short FILTER_ACCEPT = 1; + const short FILTER_REJECT = 2; + const short FILTER_SKIP = 3; + + + // Constants for whatToShow + const unsigned long SHOW_ALL = 0xFFFFFFFF; + 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; + + short acceptNode(in nsIDOMNode n); +}; diff --git a/dom/public/idl/traversal/nsIDOMNodeIterator.idl b/dom/public/idl/traversal/nsIDOMNodeIterator.idl new file mode 100644 index 000000000000..a208d3dfd551 --- /dev/null +++ b/dom/public/idl/traversal/nsIDOMNodeIterator.idl @@ -0,0 +1,51 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is this file as it was released on + * May 1 2001. + * + * The Initial Developer of the Original Code is Jonas Sicking. + * Portions created by Jonas Sicking are Copyright (C) 2001 + * Jonas Sicking. All Rights Reserved. + * + * Contributor(s): + * Jonas Sicking (Original Author) + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License Version 2 or later (the + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your + * version of this file only under the terms of the GPL and not to + * allow others to use your version of this file under the MPL, + * indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by + * the GPL. If you do not delete the provisions above, a recipient + * may use your version of this file under either the MPL or the + * GPL. + * + */ + +#include "domstubs.idl" + +[scriptable, uuid(354b5f02-1dd2-11b2-b053-b8c2997022a0)] +// Introduced in DOM Level 2: +interface nsIDOMNodeIterator : nsISupports { + readonly attribute nsIDOMNode root; + readonly attribute unsigned long whatToShow; + readonly attribute nsIDOMNodeFilter filter; + readonly attribute boolean expandEntityReferences; + nsIDOMNode nextNode() + raises(DOMException); + nsIDOMNode previousNode() + raises(DOMException); + void detach(); +}; diff --git a/dom/public/idl/traversal/nsIDOMTreeWalker.idl b/dom/public/idl/traversal/nsIDOMTreeWalker.idl new file mode 100644 index 000000000000..5911d80c287b --- /dev/null +++ b/dom/public/idl/traversal/nsIDOMTreeWalker.idl @@ -0,0 +1,56 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is this file as it was released on + * May 1 2001. + * + * The Initial Developer of the Original Code is Jonas Sicking. + * Portions created by Jonas Sicking are Copyright (C) 2001 + * Jonas Sicking. All Rights Reserved. + * + * Contributor(s): + * Jonas Sicking (Original Author) + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License Version 2 or later (the + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your + * version of this file only under the terms of the GPL and not to + * allow others to use your version of this file under the MPL, + * indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by + * the GPL. If you do not delete the provisions above, a recipient + * may use your version of this file under either the MPL or the + * GPL. + * + */ + +#include "domstubs.idl" + +[scriptable, uuid(400af3ca-1dd2-11b2-a50a-887ecca2e63a)] +// Introduced in DOM Level 2: +interface nsIDOMTreeWalker : nsISupports { + readonly attribute nsIDOMNode root; + readonly attribute unsigned long whatToShow; + readonly attribute nsIDOMNodeFilter filter; + readonly attribute boolean expandEntityReferences; + attribute nsIDOMNode currentNode; + // raises(DOMException) on setting + + nsIDOMNode parentNode(); + nsIDOMNode firstChild(); + nsIDOMNode lastChild(); + nsIDOMNode previousSibling(); + nsIDOMNode nextSibling(); + nsIDOMNode previousNode(); + nsIDOMNode nextNode(); +};