sdnAccessible.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. #ifndef mozilla_a11y_sdnAccessible_h_
  6. #define mozilla_a11y_sdnAccessible_h_
  7. #include "ISimpleDOMNode.h"
  8. #include "AccessibleWrap.h"
  9. #include "IUnknownImpl.h"
  10. #include "mozilla/Attributes.h"
  11. namespace mozilla {
  12. namespace a11y {
  13. class sdnAccessible final : public ISimpleDOMNode
  14. {
  15. public:
  16. sdnAccessible(nsINode* aNode) :
  17. mNode(aNode)
  18. {
  19. if (!mNode)
  20. MOZ_CRASH();
  21. }
  22. ~sdnAccessible() { }
  23. /**
  24. * Retrun if the object is defunct.
  25. */
  26. bool IsDefunct() const { return !GetDocument(); }
  27. /**
  28. * Return a document accessible it belongs to if any.
  29. */
  30. DocAccessible* GetDocument() const;
  31. /*
  32. * Return associated accessible if any.
  33. */
  34. Accessible* GetAccessible() const;
  35. //IUnknown
  36. DECL_IUNKNOWN
  37. virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeInfo(
  38. /* [out] */ BSTR __RPC_FAR* aNodeName,
  39. /* [out] */ short __RPC_FAR* aNameSpaceID,
  40. /* [out] */ BSTR __RPC_FAR* aNodeValue,
  41. /* [out] */ unsigned int __RPC_FAR* aNumChildren,
  42. /* [out] */ unsigned int __RPC_FAR* aUniqueID,
  43. /* [out][retval] */ unsigned short __RPC_FAR* aNodeType);
  44. virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes(
  45. /* [in] */ unsigned short aMaxAttribs,
  46. /* [length_is][size_is][out] */ BSTR __RPC_FAR* aAttribNames,
  47. /* [length_is][size_is][out] */ short __RPC_FAR* aNameSpaceIDs,
  48. /* [length_is][size_is][out] */ BSTR __RPC_FAR* aAttribValues,
  49. /* [out][retval] */ unsigned short __RPC_FAR* aNumAttribs);
  50. virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributesForNames(
  51. /* [in] */ unsigned short aMaxAttribs,
  52. /* [length_is][size_is][in] */ BSTR __RPC_FAR* aAttribNames,
  53. /* [length_is][size_is][in] */ short __RPC_FAR* aNameSpaceID,
  54. /* [length_is][size_is][retval] */ BSTR __RPC_FAR* aAttribValues);
  55. virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyle(
  56. /* [in] */ unsigned short aMaxStyleProperties,
  57. /* [in] */ boolean aUseAlternateView,
  58. /* [length_is][size_is][out] */ BSTR __RPC_FAR* aStyleProperties,
  59. /* [length_is][size_is][out] */ BSTR __RPC_FAR* aStyleValues,
  60. /* [out][retval] */ unsigned short __RPC_FAR* aNumStyleProperties);
  61. virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyleForProperties(
  62. /* [in] */ unsigned short aNumStyleProperties,
  63. /* [in] */ boolean aUseAlternateView,
  64. /* [length_is][size_is][in] */ BSTR __RPC_FAR* aStyleProperties,
  65. /* [length_is][size_is][out][retval] */ BSTR __RPC_FAR* aStyleValues);
  66. virtual HRESULT STDMETHODCALLTYPE scrollTo(/* [in] */ boolean aScrollTopLeft);
  67. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_parentNode(
  68. /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode);
  69. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_firstChild(
  70. /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode);
  71. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_lastChild(
  72. /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode);
  73. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling(
  74. /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode);
  75. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling(
  76. /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode);
  77. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_childAt(
  78. /* [in] */ unsigned aChildIndex,
  79. /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode);
  80. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_innerHTML(
  81. /* [out][retval] */ BSTR __RPC_FAR* aInnerHTML);
  82. virtual /* [local][propget] */ HRESULT STDMETHODCALLTYPE get_localInterface(
  83. /* [retval][out] */ void __RPC_FAR *__RPC_FAR* aLocalInterface);
  84. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_language(
  85. /* [out][retval] */ BSTR __RPC_FAR* aLanguage);
  86. private:
  87. nsCOMPtr<nsINode> mNode;
  88. };
  89. } // namespace a11y
  90. } // namespace mozilla
  91. #endif // mozilla_a11y_sdnAccessible_h_