Back to index

lightning-sunbird  0.9+nobinonly
nsAccessNodeWrap.h
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) 2003
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Original 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 /* For documentation of the accessibility architecture, 
00040  * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
00041  */
00042 
00043 #ifndef _nsAccessNodeWrap_H_
00044 #define _nsAccessNodeWrap_H_
00045 
00046 #include "nsCOMPtr.h"
00047 #include "nsIAccessible.h"
00048 #include "ISimpleDOMNode.h"
00049 #include "nsIDOMElement.h"
00050 #include "nsIContent.h"
00051 #include "nsAccessNode.h"
00052 #include "OLEIDL.H"
00053 #include "OLEACC.H"
00054 #include "winable.h"
00055 #undef ERROR /// Otherwise we can't include nsIDOMNSEvent.h if we include this
00056 
00057 typedef LRESULT (STDAPICALLTYPE *LPFNNOTIFYWINEVENT)(DWORD event,HWND hwnd,LONG idObjectType,LONG idObject);
00058 typedef LRESULT (STDAPICALLTYPE *LPFNGETGUITHREADINFO)(DWORD idThread, GUITHREADINFO* pgui);
00059 
00060 class nsAccessNodeWrap :  public nsAccessNode, public ISimpleDOMNode
00061 {
00062   public: // construction, destruction
00063     nsAccessNodeWrap(nsIDOMNode *, nsIWeakReference* aShell);
00064     virtual ~nsAccessNodeWrap();
00065 
00066     // IUnknown methods - see iunknown.h for documentation
00067     STDMETHODIMP_(ULONG) AddRef();
00068     STDMETHODIMP_(ULONG) Release();
00069     STDMETHODIMP QueryInterface(REFIID, void**);
00070 
00071   public:
00072 
00073     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeInfo( 
00074         /* [out] */ BSTR __RPC_FAR *tagName,
00075         /* [out] */ short __RPC_FAR *nameSpaceID,
00076         /* [out] */ BSTR __RPC_FAR *nodeValue,
00077         /* [out] */ unsigned int __RPC_FAR *numChildren,
00078         /* [out] */ unsigned int __RPC_FAR *aUniqueID,
00079         /* [out][retval] */ unsigned short __RPC_FAR *nodeType);
00080   
00081     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes( 
00082         /* [in] */ unsigned short maxAttribs,
00083         /* [length_is][size_is][out] */ BSTR __RPC_FAR *attribNames,
00084         /* [length_is][size_is][out] */ short __RPC_FAR *nameSpaceID,
00085         /* [length_is][size_is][out] */ BSTR __RPC_FAR *attribValues,
00086         /* [out][retval] */ unsigned short __RPC_FAR *numAttribs);
00087   
00088     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributesForNames( 
00089         /* [in] */ unsigned short maxAttribs,
00090         /* [length_is][size_is][in] */ BSTR __RPC_FAR *attribNames,
00091         /* [length_is][size_is][in] */ short __RPC_FAR *nameSpaceID,
00092         /* [length_is][size_is][retval] */ BSTR __RPC_FAR *attribValues);
00093   
00094     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyle( 
00095         /* [in] */ unsigned short maxStyleProperties,
00096         /* [in] */ boolean useAlternateView,
00097         /* [length_is][size_is][out] */ BSTR __RPC_FAR *styleProperties,
00098         /* [length_is][size_is][out] */ BSTR __RPC_FAR *styleValues,
00099         /* [out][retval] */ unsigned short __RPC_FAR *numStyleProperties);
00100   
00101     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyleForProperties( 
00102         /* [in] */ unsigned short numStyleProperties,
00103         /* [in] */ boolean useAlternateView,
00104         /* [length_is][size_is][in] */ BSTR __RPC_FAR *styleProperties,
00105         /* [length_is][size_is][out][retval] */ BSTR __RPC_FAR *styleValues);
00106         
00107     virtual HRESULT STDMETHODCALLTYPE scrollTo(/* [in] */ boolean scrollTopLeft);
00108 
00109     virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node);
00110     virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node);
00111     virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node);
00112     virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node);
00113     virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node);
00114     virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_childAt(unsigned childIndex,
00115                                                                   ISimpleDOMNode __RPC_FAR *__RPC_FAR *node);
00116 
00117     virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_innerHTML(
00118         /* [out][retval] */ BSTR __RPC_FAR *innerHTML);
00119 
00120     virtual /* [local][propget] */ HRESULT STDMETHODCALLTYPE get_localInterface( 
00121         /* [retval][out] */ void __RPC_FAR *__RPC_FAR *localInterface);
00122         
00123     virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_language(
00124         /* [out][retval] */ BSTR __RPC_FAR *language);
00125 
00126     static void InitAccessibility();
00127     static void ShutdownAccessibility();
00128 
00130     static HINSTANCE gmAccLib;
00131     static HINSTANCE gmUserLib;
00132     static LPFNACCESSIBLEOBJECTFROMWINDOW gmAccessibleObjectFromWindow;
00133     static LPFNNOTIFYWINEVENT gmNotifyWinEvent;
00134     static LPFNGETGUITHREADINFO gmGetGUIThreadInfo;
00135 
00136   protected:
00137     void GetAccessibleFor(nsIDOMNode *node, nsIAccessible **newAcc);
00138     ISimpleDOMNode* MakeAccessNode(nsIDOMNode *node);
00139     NS_IMETHOD GetComputedStyleDeclaration(nsIDOMCSSStyleDeclaration **aCssDecl, PRUint32 *aLength);
00140 
00141     static PRBool gIsEnumVariantSupportDisabled;
00142 };
00143 
00144 #endif
00145