michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_a11y_sdnAccessible_h_ michael@0: #define mozilla_a11y_sdnAccessible_h_ michael@0: michael@0: #include "ISimpleDOMNode.h" michael@0: #include "AccessibleWrap.h" michael@0: #include "IUnknownImpl.h" michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: class sdnAccessible MOZ_FINAL : public ISimpleDOMNode michael@0: { michael@0: public: michael@0: sdnAccessible(nsINode* aNode) : michael@0: mNode(aNode) michael@0: { michael@0: if (!mNode) michael@0: MOZ_CRASH(); michael@0: } michael@0: ~sdnAccessible() { } michael@0: michael@0: /** michael@0: * Retrun if the object is defunct. michael@0: */ michael@0: bool IsDefunct() const { return !GetDocument(); } michael@0: michael@0: /** michael@0: * Return a document accessible it belongs to if any. michael@0: */ michael@0: DocAccessible* GetDocument() const; michael@0: michael@0: /* michael@0: * Return associated accessible if any. michael@0: */ michael@0: Accessible* GetAccessible() const; michael@0: michael@0: //IUnknown michael@0: DECL_IUNKNOWN michael@0: michael@0: virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeInfo( michael@0: /* [out] */ BSTR __RPC_FAR* aNodeName, michael@0: /* [out] */ short __RPC_FAR* aNameSpaceID, michael@0: /* [out] */ BSTR __RPC_FAR* aNodeValue, michael@0: /* [out] */ unsigned int __RPC_FAR* aNumChildren, michael@0: /* [out] */ unsigned int __RPC_FAR* aUniqueID, michael@0: /* [out][retval] */ unsigned short __RPC_FAR* aNodeType); michael@0: michael@0: virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes( michael@0: /* [in] */ unsigned short aMaxAttribs, michael@0: /* [length_is][size_is][out] */ BSTR __RPC_FAR* aAttribNames, michael@0: /* [length_is][size_is][out] */ short __RPC_FAR* aNameSpaceIDs, michael@0: /* [length_is][size_is][out] */ BSTR __RPC_FAR* aAttribValues, michael@0: /* [out][retval] */ unsigned short __RPC_FAR* aNumAttribs); michael@0: michael@0: virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributesForNames( michael@0: /* [in] */ unsigned short aMaxAttribs, michael@0: /* [length_is][size_is][in] */ BSTR __RPC_FAR* aAttribNames, michael@0: /* [length_is][size_is][in] */ short __RPC_FAR* aNameSpaceID, michael@0: /* [length_is][size_is][retval] */ BSTR __RPC_FAR* aAttribValues); michael@0: michael@0: virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyle( michael@0: /* [in] */ unsigned short aMaxStyleProperties, michael@0: /* [in] */ boolean aUseAlternateView, michael@0: /* [length_is][size_is][out] */ BSTR __RPC_FAR* aStyleProperties, michael@0: /* [length_is][size_is][out] */ BSTR __RPC_FAR* aStyleValues, michael@0: /* [out][retval] */ unsigned short __RPC_FAR* aNumStyleProperties); michael@0: michael@0: virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyleForProperties( michael@0: /* [in] */ unsigned short aNumStyleProperties, michael@0: /* [in] */ boolean aUseAlternateView, michael@0: /* [length_is][size_is][in] */ BSTR __RPC_FAR* aStyleProperties, michael@0: /* [length_is][size_is][out][retval] */ BSTR __RPC_FAR* aStyleValues); michael@0: michael@0: virtual HRESULT STDMETHODCALLTYPE scrollTo(/* [in] */ boolean aScrollTopLeft); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_parentNode( michael@0: /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_firstChild( michael@0: /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_lastChild( michael@0: /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling( michael@0: /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling( michael@0: /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_childAt( michael@0: /* [in] */ unsigned aChildIndex, michael@0: /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_innerHTML( michael@0: /* [out][retval] */ BSTR __RPC_FAR* aInnerHTML); michael@0: michael@0: virtual /* [local][propget] */ HRESULT STDMETHODCALLTYPE get_localInterface( michael@0: /* [retval][out] */ void __RPC_FAR *__RPC_FAR* aLocalInterface); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_language( michael@0: /* [out][retval] */ BSTR __RPC_FAR* aLanguage); michael@0: michael@0: private: michael@0: nsCOMPtr mNode; michael@0: }; michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_a11y_sdnAccessible_h_