1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2/* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") 7cpp_quote("//") 8cpp_quote("// ISimpleDOMNode") 9cpp_quote("// ---------------------------------------------------------------------------------------------------=") 10cpp_quote("// An interface that extends MSAA's IAccessible to provide readonly DOM node information via cross-process COM.") 11cpp_quote("//") 12cpp_quote("// get_nodeInfo(") 13cpp_quote("// /* [out] */ BSTR *nodeName, // For elements, this is the tag name") 14cpp_quote("// /* [out] */ short *nameSpaceID,") 15cpp_quote("// /* [out] */ BSTR *nodeValue, ") 16cpp_quote("// /* [out] */ unsigned int *numChildren); ") 17cpp_quote("// /* [out] */ unsigned int *uniqueID; // In Win32 accessible events we generate, the target's childID matches to this") 18cpp_quote("// /* [out] */ unsigned short *nodeType,") 19cpp_quote("// ---------------------------------------------------------------------------------------------------=") 20cpp_quote("// Get the basic information about a node.") 21cpp_quote("// The namespace ID can be mapped to an URI using nsISimpleDOMDocument::get_nameSpaceURIForID()") 22cpp_quote("//") 23cpp_quote("// get_attributes(") 24cpp_quote("// /* [in] */ unsigned short maxAttribs,") 25cpp_quote("// /* [out] */ unsigned short *numAttribs,") 26cpp_quote("// /* [out] */ BSTR *attribNames,") 27cpp_quote("// /* [out] */ short *nameSpaceID,") 28cpp_quote("// /* [out] */ BSTR *attribValues);") 29cpp_quote("// ---------------------------------------------------------------------------------------------------=") 30cpp_quote("// Returns 3 arrays - the attribute names and values, and a namespace ID for each") 31cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace") 32cpp_quote("//") 33cpp_quote("// get_attributesForNames(") 34cpp_quote("// /* [in] */ unsigned short numAttribs,") 35cpp_quote("// /* [in] */ BSTR *attribNames,") 36cpp_quote("// /* [in] */ short *nameSpaceID,") 37cpp_quote("// /* [out] */ BSTR *attribValues);") 38cpp_quote("// ---------------------------------------------------------------------------------------------------=") 39cpp_quote("// Takes 2 arrays - the attribute names and namespace IDs, and returns an array of corresponding values") 40cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace") 41cpp_quote("//") 42cpp_quote("// computedStyle( ") 43cpp_quote("// /* [in] */ unsigned short maxStyleProperties,") 44cpp_quote("// /* [out] */ unsigned short *numStyleProperties, ") 45cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes") 46cpp_quote("// /* [out] */ BSTR *styleProperties, ") 47cpp_quote("// /* [out] */ BSTR *styleValues);") 48cpp_quote("// ---------------------------------------------------------------------------------------------------=") 49cpp_quote("// Returns 2 arrays -- the style properties and their values") 50cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)") 51cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()") 52cpp_quote("//") 53cpp_quote("// computedStyleForProperties( ") 54cpp_quote("// /* [in] */ unsigned short numStyleProperties, ") 55cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes") 56cpp_quote("// /* [in] */ BSTR *styleProperties, ") 57cpp_quote("// /* [out] */ BSTR *styleValues);") 58cpp_quote("// ---------------------------------------------------------------------------------------------------=") 59cpp_quote("// Scroll the current view so that this dom node is visible.") 60cpp_quote("// placeTopLeft=TRUE: scroll until the top left corner of the dom node is at the top left corner of the view.") 61cpp_quote("// placeTopLeft=FALSE: scroll minimally to make the dom node visible. Don't scroll at all if already visible.") 62cpp_quote("//") 63cpp_quote("// scrollTo( ") 64cpp_quote("// /* [in] */ boolean placeTopLeft); ") 65cpp_quote("// ---------------------------------------------------------------------------------------------------=") 66cpp_quote("// Returns style property values for those properties in the styleProperties [in] array") 67cpp_quote("// Returns 2 arrays -- the style properties and their values") 68cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)") 69cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()") 70cpp_quote("//") 71cpp_quote("// get_parentNode (/* [out] */ ISimpleDOMNode **newNodePtr);") 72cpp_quote("// get_firstChild (/* [out] */ ISimpleDOMNode **newNodePtr);") 73cpp_quote("// get_lastChild (/* [out] */ ISimpleDOMNode **newNodePtr);") 74cpp_quote("// get_previousSibling(/* [out] */ ISimpleDOMNode **newNodePtr);") 75cpp_quote("// get_nextSibling (/* [out] */ ISimpleDOMNode **newNodePtr);") 76cpp_quote("// get_childAt (/* [in] */ unsigned childIndex, /* [out] */ ISimpleDOMNode **newNodePtr);") 77cpp_quote("// ---------------------------------------------------------------------------------------------------=") 78cpp_quote("// DOM navigation - get a different node.") 79cpp_quote("//") 80cpp_quote("// get_innerHTML(/* [out] */ BSTR *htmlText);") 81cpp_quote("// ---------------------------------------------------------------------------------------------------=") 82cpp_quote("// Returns HTML of this DOM node's subtree. Does not include the start and end tag for this node/element.") 83cpp_quote("//") 84cpp_quote("//") 85cpp_quote("// get_localInterface(/* [out] */ void **localInterface);") 86cpp_quote("// ---------------------------------------------------------------------------------------------------=") 87cpp_quote("// Only available in Gecko's process") 88cpp_quote("//") 89cpp_quote("//") 90cpp_quote("// get_language(/* [out] */ BSTR *htmlText);") 91cpp_quote("// ---------------------------------------------------------------------------------------------------=") 92cpp_quote("// Returns the computed language for this node, or empty string if unknown.") 93cpp_quote("//") 94cpp_quote("//") 95cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") 96cpp_quote("") 97cpp_quote("") 98 99import "objidl.idl"; 100import "oaidl.idl"; 101 102[object, uuid(1814ceeb-49e2-407f-af99-fa755a7d2607)] 103interface ISimpleDOMNode : IUnknown 104{ 105 const unsigned short NODETYPE_ELEMENT = 1; 106 const unsigned short NODETYPE_ATTRIBUTE = 2; 107 const unsigned short NODETYPE_TEXT = 3; 108 const unsigned short NODETYPE_CDATA_SECTION = 4; 109 const unsigned short NODETYPE_ENTITY_REFERENCE = 5; 110 const unsigned short NODETYPE_ENTITY = 6; 111 const unsigned short NODETYPE_PROCESSING_INSTRUCTION = 7; 112 const unsigned short NODETYPE_COMMENT = 8; 113 const unsigned short NODETYPE_DOCUMENT = 9; 114 const unsigned short NODETYPE_DOCUMENT_TYPE = 10; 115 const unsigned short NODETYPE_DOCUMENT_FRAGMENT = 11; 116 const unsigned short NODETYPE_NOTATION = 12; 117 118 [propget] HRESULT nodeInfo( 119 [out] BSTR *nodeName, // for performance returns NULL for text nodes (true nodeName would be "#text") 120 [out] short *nameSpaceID, 121 [out] BSTR *nodeValue, 122 [out] unsigned int *numChildren, 123 [out] unsigned int *uniqueID, // In Win32 accessible events we generate, the target's childID matches to this 124 [out, retval] unsigned short *nodeType 125 ); 126 127 [propget] HRESULT attributes( 128 [in] unsigned short maxAttribs, 129 [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribNames, 130 [out, size_is(maxAttribs), length_is(*numAttribs)] short *nameSpaceID, 131 [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribValues, 132 [out, retval] unsigned short *numAttribs 133 ); 134 135 [propget] HRESULT attributesForNames( 136 [in] unsigned short numAttribs, 137 [in, size_is(numAttribs), length_is(numAttribs)] BSTR *attribNames, 138 [in, size_is(numAttribs), length_is(numAttribs)] short *nameSpaceID, 139 [out, retval, size_is(numAttribs), length_is(numAttribs)] BSTR *attribValues 140 ); 141 142 [propget] HRESULT computedStyle( 143 [in] unsigned short maxStyleProperties, 144 [in] boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes 145 [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties, 146 [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleValues, 147 [out, retval] unsigned short *numStyleProperties 148 ); 149 150 [propget] HRESULT computedStyleForProperties( 151 [in] unsigned short numStyleProperties, 152 [in] boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes 153 [in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties, 154 [out, retval, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleValues 155 ); 156 157 HRESULT scrollTo([in] boolean placeTopLeft); 158 159 [propget] HRESULT parentNode([out, retval] ISimpleDOMNode **node); 160 [propget] HRESULT firstChild([out, retval] ISimpleDOMNode **node); 161 [propget] HRESULT lastChild([out, retval] ISimpleDOMNode **node); 162 [propget] HRESULT previousSibling([out, retval] ISimpleDOMNode **node); 163 [propget] HRESULT nextSibling([out, retval] ISimpleDOMNode **node); 164 [propget] HRESULT childAt([in] unsigned childIndex, 165 [out, retval] ISimpleDOMNode **node); 166 167 [propget] HRESULT innerHTML([out, retval] BSTR *innerHTML); 168 169 [propget, local] HRESULT localInterface([out][retval] void **localInterface); 170 171 [propget, call_as(get_localInterface)] 172 HRESULT remoteLocalInterface([out][retval] IUnknown **localInterface); 173 174 [propget] HRESULT language([out, retval] BSTR *language); 175} 176 177