ISimpleDOMNode.idl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. * http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. *
  15. * The Original Code is mozilla.org code.
  16. *
  17. * The Initial Developer of the Original Code is
  18. * Netscape Communications Corporation.
  19. * Portions created by the Initial Developer are Copyright (C) 1998
  20. * the Initial Developer. All Rights Reserved.
  21. *
  22. * Contributor(s):
  23. * Author: Aaron Leventhal (aaronl@netscape.com)
  24. *
  25. * Alternatively, the contents of this file may be used under the terms of
  26. * either of the GNU General Public License Version 2 or later (the "GPL"),
  27. * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28. * in which case the provisions of the GPL or the LGPL are applicable instead
  29. * of those above. If you wish to allow use of your version of this file only
  30. * under the terms of either the GPL or the LGPL, and not to allow others to
  31. * use your version of this file under the terms of the MPL, indicate your
  32. * decision by deleting the provisions above and replace them with the notice
  33. * and other provisions required by the GPL or the LGPL. If you do not delete
  34. * the provisions above, a recipient may use your version of this file under
  35. * the terms of any one of the MPL, the GPL or the LGPL.
  36. *
  37. * ***** END LICENSE BLOCK ***** */
  38. cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////")
  39. cpp_quote("//")
  40. cpp_quote("// ISimpleDOMNode")
  41. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  42. cpp_quote("// An interface that extends MSAA's IAccessible to provide readonly DOM node information via cross-process COM.")
  43. cpp_quote("//")
  44. cpp_quote("// @STATUS UNDER_REVIEW")
  45. cpp_quote("//")
  46. cpp_quote("// get_nodeInfo(")
  47. cpp_quote("// /* [out] */ BSTR *nodeName, // For elements, this is the tag name")
  48. cpp_quote("// /* [out] */ short *nameSpaceID,")
  49. cpp_quote("// /* [out] */ BSTR *nodeValue, ")
  50. cpp_quote("// /* [out] */ unsigned int *numChildren); ")
  51. cpp_quote("// /* [out] */ unsigned int *uniqueID; // In Win32 accessible events we generate, the target's childID matches to this")
  52. cpp_quote("// /* [out] */ unsigned short *nodeType,")
  53. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  54. cpp_quote("// Get the basic information about a node.")
  55. cpp_quote("// The namespace ID can be mapped to an URI using nsISimpleDOMDocument::get_nameSpaceURIForID()")
  56. cpp_quote("//")
  57. cpp_quote("// get_attributes(")
  58. cpp_quote("// /* [in] */ unsigned short maxAttribs,")
  59. cpp_quote("// /* [out] */ unsigned short *numAttribs,")
  60. cpp_quote("// /* [out] */ BSTR *attribNames,")
  61. cpp_quote("// /* [out] */ short *nameSpaceID,")
  62. cpp_quote("// /* [out] */ BSTR *attribValues);")
  63. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  64. cpp_quote("// Returns 3 arrays - the attribute names and values, and a namespace ID for each")
  65. cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace")
  66. cpp_quote("//")
  67. cpp_quote("// get_attributesForNames(")
  68. cpp_quote("// /* [in] */ unsigned short numAttribs,")
  69. cpp_quote("// /* [in] */ BSTR *attribNames,")
  70. cpp_quote("// /* [in] */ short *nameSpaceID,")
  71. cpp_quote("// /* [out] */ BSTR *attribValues);")
  72. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  73. cpp_quote("// Takes 2 arrays - the attribute names and namespace IDs, and returns an array of corresponding values")
  74. cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace")
  75. cpp_quote("//")
  76. cpp_quote("// computedStyle( ")
  77. cpp_quote("// /* [in] */ unsigned short maxStyleProperties,")
  78. cpp_quote("// /* [out] */ unsigned short *numStyleProperties, ")
  79. cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes")
  80. cpp_quote("// /* [out] */ BSTR *styleProperties, ")
  81. cpp_quote("// /* [out] */ BSTR *styleValues);")
  82. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  83. cpp_quote("// Returns 2 arrays -- the style properties and their values")
  84. cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)")
  85. cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()")
  86. cpp_quote("//")
  87. cpp_quote("// computedStyleForProperties( ")
  88. cpp_quote("// /* [in] */ unsigned short numStyleProperties, ")
  89. cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes")
  90. cpp_quote("// /* [in] */ BSTR *styleProperties, ")
  91. cpp_quote("// /* [out] */ BSTR *styleValues);")
  92. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  93. cpp_quote("// Scroll the current view so that this dom node is visible.")
  94. cpp_quote("// placeTopLeft=TRUE: scroll until the top left corner of the dom node is at the top left corner of the view.")
  95. cpp_quote("// placeTopLeft=FALSE: scroll minimally to make the dom node visible. Don't scroll at all if already visible.")
  96. cpp_quote("//")
  97. cpp_quote("// scrollTo( ")
  98. cpp_quote("// /* [in] */ boolean placeTopLeft); ")
  99. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  100. cpp_quote("// Returns style property values for those properties in the styleProperties [in] array")
  101. cpp_quote("// Returns 2 arrays -- the style properties and their values")
  102. cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)")
  103. cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()")
  104. cpp_quote("//")
  105. cpp_quote("// get_parentNode (/* [out] */ ISimpleDOMNode **newNodePtr);")
  106. cpp_quote("// get_firstChild (/* [out] */ ISimpleDOMNode **newNodePtr);")
  107. cpp_quote("// get_lastChild (/* [out] */ ISimpleDOMNode **newNodePtr);")
  108. cpp_quote("// get_previousSibling(/* [out] */ ISimpleDOMNode **newNodePtr);")
  109. cpp_quote("// get_nextSibling (/* [out] */ ISimpleDOMNode **newNodePtr);")
  110. cpp_quote("// get_childAt (/* [in] */ unsigned childIndex, /* [out] */ ISimpleDOMNode **newNodePtr);")
  111. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  112. cpp_quote("// DOM navigation - get a different node.")
  113. cpp_quote("//")
  114. cpp_quote("// get_innerHTML(/* [out] */ BSTR *htmlText);")
  115. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  116. cpp_quote("// Returns HTML of this DOM node's subtree. Does not include the start and end tag for this node/element.")
  117. cpp_quote("//")
  118. cpp_quote("//")
  119. cpp_quote("// get_localInterface(/* [out] */ void **localInterface);")
  120. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  121. cpp_quote("// Only available in Gecko's process - casts to an XPCOM nsIAccessNode interface pointer")
  122. cpp_quote("//")
  123. cpp_quote("//")
  124. cpp_quote("// get_language(/* [out] */ BSTR *htmlText);")
  125. cpp_quote("// ---------------------------------------------------------------------------------------------------=")
  126. cpp_quote("// Returns the computed language for this node, or empty string if unknown.")
  127. cpp_quote("//")
  128. cpp_quote("//")
  129. cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////")
  130. cpp_quote("")
  131. cpp_quote("")
  132. import "objidl.idl";
  133. import "oaidl.idl";
  134. const long DISPID_NODE_NODEINFO = -5900;
  135. const long DISPID_NODE_ATTRIBUTES = -5901;
  136. const long DISPID_NODE_ATTRIBUTESFORNAMES = -5902;
  137. const long DISPID_NODE_COMPSTYLE = -5903;
  138. const long DISPID_NODE_COMPSTYLEFORPROPS = -5904;
  139. const long DISPID_NODE_LANGUAGE = -5905;
  140. [object, uuid(1814ceeb-49e2-407f-af99-fa755a7d2607)]
  141. interface ISimpleDOMNode : IUnknown
  142. {
  143. const unsigned short NODETYPE_ELEMENT = 1;
  144. const unsigned short NODETYPE_ATTRIBUTE = 2;
  145. const unsigned short NODETYPE_TEXT = 3;
  146. const unsigned short NODETYPE_CDATA_SECTION = 4;
  147. const unsigned short NODETYPE_ENTITY_REFERENCE = 5;
  148. const unsigned short NODETYPE_ENTITY = 6;
  149. const unsigned short NODETYPE_PROCESSING_INSTRUCTION = 7;
  150. const unsigned short NODETYPE_COMMENT = 8;
  151. const unsigned short NODETYPE_DOCUMENT = 9;
  152. const unsigned short NODETYPE_DOCUMENT_TYPE = 10;
  153. const unsigned short NODETYPE_DOCUMENT_FRAGMENT = 11;
  154. const unsigned short NODETYPE_NOTATION = 12;
  155. [propget, id(DISPID_NODE_NODEINFO)] HRESULT nodeInfo(
  156. [out] BSTR *nodeName, // for performance returns NULL for text nodes (true nodeName would be "#text")
  157. [out] short *nameSpaceID,
  158. [out] BSTR *nodeValue,
  159. [out] unsigned int *numChildren,
  160. [out] unsigned int *uniqueID, // In Win32 accessible events we generate, the target's childID matches to this
  161. [out, retval] unsigned short *nodeType
  162. );
  163. [propget, id(DISPID_NODE_ATTRIBUTES)] HRESULT attributes(
  164. [in] unsigned short maxAttribs,
  165. [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribNames,
  166. [out, size_is(maxAttribs), length_is(*numAttribs)] short *nameSpaceID,
  167. [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribValues,
  168. [out, retval] unsigned short *numAttribs
  169. );
  170. [propget, id(DISPID_NODE_ATTRIBUTESFORNAMES)] HRESULT attributesForNames(
  171. [in] unsigned short numAttribs,
  172. [in, size_is(numAttribs), length_is(numAttribs)] BSTR *attribNames,
  173. [in, size_is(numAttribs), length_is(numAttribs)] short *nameSpaceID,
  174. [out, retval, size_is(numAttribs), length_is(numAttribs)] BSTR *attribValues
  175. );
  176. [propget, id(DISPID_NODE_COMPSTYLE)] HRESULT computedStyle(
  177. [in] unsigned short maxStyleProperties,
  178. [in] boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes
  179. [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties,
  180. [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleValues,
  181. [out, retval] unsigned short *numStyleProperties
  182. );
  183. [propget, id(DISPID_NODE_COMPSTYLEFORPROPS)] HRESULT computedStyleForProperties(
  184. [in] unsigned short numStyleProperties,
  185. [in] boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes
  186. [in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties,
  187. [out, retval, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleValues
  188. );
  189. HRESULT scrollTo([in] boolean placeTopLeft);
  190. [propget] HRESULT parentNode([out, retval] ISimpleDOMNode **node);
  191. [propget] HRESULT firstChild([out, retval] ISimpleDOMNode **node);
  192. [propget] HRESULT lastChild([out, retval] ISimpleDOMNode **node);
  193. [propget] HRESULT previousSibling([out, retval] ISimpleDOMNode **node);
  194. [propget] HRESULT nextSibling([out, retval] ISimpleDOMNode **node);
  195. [propget] HRESULT childAt([in] unsigned childIndex,
  196. [out, retval] ISimpleDOMNode **node);
  197. [propget] HRESULT innerHTML([out, retval] BSTR *innerHTML);
  198. [propget, local] HRESULT localInterface([out][retval] void **localInterface);
  199. [propget, id(DISPID_NODE_LANGUAGE)] HRESULT language([out, retval] BSTR *language);
  200. }