Back to index

lightning-sunbird  0.9+nobinonly
ISimpleDOMNode.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Author: Aaron Leventhal (aaronl@netscape.com)
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////")
00040 cpp_quote("//")
00041 cpp_quote("// ISimpleDOMNode")
00042 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00043 cpp_quote("// An interface that extends MSAA's IAccessible to provide readonly DOM node information via cross-process COM.")
00044 cpp_quote("//")
00045 cpp_quote("// @STATUS UNDER_REVIEW")
00046 cpp_quote("//")
00047 cpp_quote("// get_nodeInfo(")
00048 cpp_quote("//  /* [out] */ BSTR  *nodeName,   // For elements, this is the tag name")
00049 cpp_quote("//  /* [out] */ short  *nameSpaceID,")
00050 cpp_quote("//  /* [out] */ BSTR  *nodeValue, ")
00051 cpp_quote("//  /* [out] */ unsigned int    *numChildren); ") 
00052 cpp_quote("//  /* [out] */ unsigned int    *uniqueID;  // In Win32 accessible events we generate, the target's childID matches to this")
00053 cpp_quote("//  /* [out] */ unsigned short  *nodeType,")
00054 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00055 cpp_quote("// Get the basic information about a node.")
00056 cpp_quote("// The namespace ID can be mapped to an URI using nsISimpleDOMDocument::get_nameSpaceURIForID()")
00057 cpp_quote("//")
00058 cpp_quote("// get_attributes(")
00059 cpp_quote("//  /* [in]  */ unsigned short maxAttribs,")
00060 cpp_quote("//  /* [out] */ unsigned short  *numAttribs,")
00061 cpp_quote("//  /* [out] */ BSTR  *attribNames,")
00062 cpp_quote("//  /* [out] */ short *nameSpaceID,")
00063 cpp_quote("//  /* [out] */ BSTR  *attribValues);")
00064 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00065 cpp_quote("// Returns 3 arrays - the attribute names and values, and a namespace ID for each")
00066 cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace")
00067 cpp_quote("//")
00068 cpp_quote("// get_attributesForNames(")
00069 cpp_quote("//  /* [in] */ unsigned short numAttribs,")
00070 cpp_quote("//  /* [in] */ BSTR   *attribNames,")
00071 cpp_quote("//  /* [in] */ short  *nameSpaceID,")
00072 cpp_quote("//  /* [out] */ BSTR  *attribValues);")
00073 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00074 cpp_quote("// Takes 2 arrays - the attribute names and namespace IDs, and returns an array of corresponding values")
00075 cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace")
00076 cpp_quote("//")
00077 cpp_quote("// computedStyle(  ")
00078 cpp_quote("//  /* [in]  */ unsigned short maxStyleProperties,")
00079 cpp_quote("//  /* [out] */ unsigned short *numStyleProperties, ")
00080 cpp_quote("//  /* [in]  */ boolean useAlternateView,  // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes")
00081 cpp_quote("//  /* [out] */ BSTR *styleProperties, ")
00082 cpp_quote("//  /* [out] */ BSTR *styleValues);")
00083 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00084 cpp_quote("// Returns 2 arrays -- the style properties and their values")
00085 cpp_quote("//  useAlternateView=FALSE: gets properties for the default media type (usually screen)")
00086 cpp_quote("//  useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()")
00087 cpp_quote("//")
00088 cpp_quote("// computedStyleForProperties(  ")
00089 cpp_quote("//  /* [in] */  unsigned short numStyleProperties, ")
00090 cpp_quote("//  /* [in] */  boolean useAlternateView,  // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes")
00091 cpp_quote("//  /* [in] */  BSTR *styleProperties, ")
00092 cpp_quote("//  /* [out] */ BSTR *styleValues);")
00093 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00094 cpp_quote("// Scroll the current view so that this dom node is visible.")
00095 cpp_quote("//  placeTopLeft=TRUE: scroll until the top left corner of the dom node is at the top left corner of the view.")
00096 cpp_quote("//  placeTopLeft=FALSE: scroll minimally to make the dom node visible. Don't scroll at all if already visible.")
00097 cpp_quote("//")
00098 cpp_quote("// scrollTo( ")
00099 cpp_quote("//  /* [in] */ boolean placeTopLeft); ")
00100 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00101 cpp_quote("// Returns style property values for those properties in the styleProperties [in] array")
00102 cpp_quote("// Returns 2 arrays -- the style properties and their values")
00103 cpp_quote("//  useAlternateView=FALSE: gets properties for the default media type (usually screen)")
00104 cpp_quote("//  useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()")
00105 cpp_quote("//")
00106 cpp_quote("// get_parentNode     (/* [out] */ ISimpleDOMNode **newNodePtr);")
00107 cpp_quote("// get_firstChild     (/* [out] */ ISimpleDOMNode **newNodePtr);")
00108 cpp_quote("// get_lastChild      (/* [out] */ ISimpleDOMNode **newNodePtr);")
00109 cpp_quote("// get_previousSibling(/* [out] */ ISimpleDOMNode **newNodePtr);")
00110 cpp_quote("// get_nextSibling    (/* [out] */ ISimpleDOMNode **newNodePtr);")
00111 cpp_quote("// get_childAt        (/* [in] */ unsigned childIndex, /* [out] */ ISimpleDOMNode **newNodePtr);")
00112 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00113 cpp_quote("// DOM navigation - get a different node.")
00114 cpp_quote("//")
00115 cpp_quote("// get_innerHTML(/* [out] */ BSTR *htmlText);")
00116 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00117 cpp_quote("// Returns HTML of this DOM node's subtree. Does not include the start and end tag for this node/element.")
00118 cpp_quote("//")
00119 cpp_quote("//")
00120 cpp_quote("// get_localInterface(/* [out] */ void **localInterface);")
00121 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00122 cpp_quote("// Only available in Gecko's process - casts to an XPCOM nsIAccessNode interface pointer")
00123 cpp_quote("//")
00124 cpp_quote("//")
00125 cpp_quote("// get_language(/* [out] */ BSTR *htmlText);")
00126 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
00127 cpp_quote("// Returns the computed language for this node, or empty string if unknown.")
00128 cpp_quote("//")
00129 cpp_quote("//")
00130 cpp_quote("
00131 cpp_quote("")
00132 cpp_quote("")
00133 
00134 import "objidl.idl";
00135 import "oaidl.idl";
00136         
00137 const long DISPID_NODE_NODEINFO   = -5900;
00138 const long DISPID_NODE_ATTRIBUTES = -5901;
00139 const long DISPID_NODE_ATTRIBUTESFORNAMES = -5902;
00140 const long DISPID_NODE_COMPSTYLE  = -5903;
00141 const long DISPID_NODE_COMPSTYLEFORPROPS = -5904;
00142 const long DISPID_NODE_LANGUAGE = -5905;
00143 
00144 [object, uuid(1814ceeb-49e2-407f-af99-fa755a7d2607)]
00145 interface ISimpleDOMNode : IUnknown
00146 {
00147   const unsigned short NODETYPE_ELEMENT = 1;
00148   const unsigned short NODETYPE_ATTRIBUTE = 2;
00149   const unsigned short NODETYPE_TEXT = 3;
00150   const unsigned short NODETYPE_CDATA_SECTION = 4;
00151   const unsigned short NODETYPE_ENTITY_REFERENCE = 5;
00152   const unsigned short NODETYPE_ENTITY = 6;
00153   const unsigned short NODETYPE_PROCESSING_INSTRUCTION = 7;
00154   const unsigned short NODETYPE_COMMENT = 8;
00155   const unsigned short NODETYPE_DOCUMENT = 9;
00156   const unsigned short NODETYPE_DOCUMENT_TYPE = 10;
00157   const unsigned short NODETYPE_DOCUMENT_FRAGMENT = 11;
00158   const unsigned short NODETYPE_NOTATION = 12;
00159 
00160   [propget, id(DISPID_NODE_NODEINFO)] HRESULT nodeInfo(
00161     [out] BSTR *nodeName,   // for performance returns NULL for text nodes (true nodeName would be "#text")
00162     [out] short *nameSpaceID,
00163     [out] BSTR *nodeValue,
00164     [out] unsigned int *numChildren,
00165     [out] unsigned int *uniqueID, // In Win32 accessible events we generate, the target's childID matches to this
00166     [out, retval] unsigned short *nodeType
00167   );
00168 
00169   [propget, id(DISPID_NODE_ATTRIBUTES)] HRESULT attributes(  
00170     [in] unsigned short maxAttribs,
00171     [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribNames, 
00172     [out, size_is(maxAttribs), length_is(*numAttribs)] short *nameSpaceID,  
00173     [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribValues,
00174     [out, retval] unsigned short *numAttribs
00175   );
00176 
00177   [propget, id(DISPID_NODE_ATTRIBUTESFORNAMES)] HRESULT attributesForNames(  
00178     [in] unsigned short numAttribs,
00179     [in, size_is(numAttribs), length_is(numAttribs)] BSTR *attribNames, 
00180     [in, size_is(numAttribs), length_is(numAttribs)] short *nameSpaceID,  
00181     [out, retval, size_is(numAttribs), length_is(numAttribs)] BSTR *attribValues
00182   );
00183 
00184   [propget, id(DISPID_NODE_COMPSTYLE)] HRESULT computedStyle(  
00185     [in] unsigned short maxStyleProperties,
00186     [in] boolean useAlternateView,  // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes
00187     [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties, 
00188     [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleValues,
00189     [out, retval] unsigned short *numStyleProperties
00190   );
00191 
00192   [propget, id(DISPID_NODE_COMPSTYLEFORPROPS)] HRESULT computedStyleForProperties(  
00193     [in] unsigned short numStyleProperties, 
00194     [in] boolean useAlternateView,  // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes
00195     [in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties, 
00196     [out, retval, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleValues
00197   );
00198 
00199   HRESULT scrollTo([in] boolean placeTopLeft);
00200 
00201   [propget] HRESULT parentNode([out, retval] ISimpleDOMNode **node);
00202   [propget] HRESULT firstChild([out, retval] ISimpleDOMNode **node);
00203   [propget] HRESULT lastChild([out, retval] ISimpleDOMNode **node);
00204   [propget] HRESULT previousSibling([out, retval] ISimpleDOMNode **node);
00205   [propget] HRESULT nextSibling([out, retval] ISimpleDOMNode **node);
00206   [propget] HRESULT childAt([in] unsigned childIndex, 
00207                             [out, retval] ISimpleDOMNode **node);
00208 
00209   [propget] HRESULT innerHTML([out, retval] BSTR *innerHTML);
00210 
00211   [propget, local] HRESULT localInterface([out][retval] void **localInterface);
00212 
00213   [propget, id(DISPID_NODE_LANGUAGE)] HRESULT language([out, retval] BSTR *language);
00214 }
00215 
00216