ia2Accessible.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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_ia2Accessible_h_
  6. #define mozilla_a11y_ia2Accessible_h_
  7. #include "nsISupports.h"
  8. #include "Accessible2_3.h"
  9. namespace mozilla {
  10. namespace a11y {
  11. class Attribute;
  12. class ia2Accessible : public IAccessible2_3
  13. {
  14. public:
  15. // IUnknown
  16. STDMETHODIMP QueryInterface(REFIID, void**);
  17. // IAccessible2
  18. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nRelations(
  19. /* [retval][out] */ long* nRelations);
  20. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relation(
  21. /* [in] */ long relationIndex,
  22. /* [retval][out] */ IAccessibleRelation** relation);
  23. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relations(
  24. /* [in] */ long maxRelations,
  25. /* [length_is][size_is][out] */ IAccessibleRelation** relation,
  26. /* [retval][out] */ long* nRelations);
  27. virtual HRESULT STDMETHODCALLTYPE role(
  28. /* [retval][out] */ long* role);
  29. virtual HRESULT STDMETHODCALLTYPE scrollTo(
  30. /* [in] */ enum IA2ScrollType scrollType);
  31. virtual HRESULT STDMETHODCALLTYPE scrollToPoint(
  32. /* [in] */ enum IA2CoordinateType coordinateType,
  33. /* [in] */ long x,
  34. /* [in] */ long y);
  35. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_groupPosition(
  36. /* [out] */ long* groupLevel,
  37. /* [out] */ long* similarItemsInGroup,
  38. /* [retval][out] */ long* positionInGroup);
  39. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_states(
  40. /* [retval][out] */ AccessibleStates* states);
  41. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_extendedRole(
  42. /* [retval][out] */ BSTR* extendedRole);
  43. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedExtendedRole(
  44. /* [retval][out] */ BSTR* localizedExtendedRole);
  45. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nExtendedStates(
  46. /* [retval][out] */ long* nExtendedStates);
  47. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_extendedStates(
  48. /* [in] */ long maxExtendedStates,
  49. /* [length_is][length_is][size_is][size_is][out] */ BSTR** extendedStates,
  50. /* [retval][out] */ long* nExtendedStates);
  51. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedExtendedStates(
  52. /* [in] */ long maxLocalizedExtendedStates,
  53. /* [length_is][length_is][size_is][size_is][out] */ BSTR** localizedExtendedStates,
  54. /* [retval][out] */ long* nLocalizedExtendedStates);
  55. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_uniqueID(
  56. /* [retval][out] */ long* uniqueID);
  57. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_windowHandle(
  58. /* [retval][out] */ HWND* windowHandle);
  59. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_indexInParent(
  60. /* [retval][out] */ long* indexInParent);
  61. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_locale(
  62. /* [retval][out] */ IA2Locale* locale);
  63. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_attributes(
  64. /* [retval][out] */ BSTR* attributes);
  65. // IAccessible2_2
  66. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_attribute(
  67. /* [in] */ BSTR name,
  68. /* [out, retval] */ VARIANT* attribute);
  69. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_accessibleWithCaret(
  70. /* [out] */ IUnknown** accessible,
  71. /* [out, retval] */ long* caretOffset);
  72. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relationTargetsOfType(
  73. /* [in] */ BSTR type,
  74. /* [in] */ long maxTargets,
  75. /* [out, size_is(,*nTargets)] */ IUnknown*** targets,
  76. /* [out, retval] */ long* nTargets
  77. );
  78. // IAccessible2_3
  79. virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectionRanges(
  80. /* [out, size_is(,*nRanges)] */ IA2Range** ranges,
  81. /* [out, retval] */ long *nRanges);
  82. // Helper method
  83. static HRESULT ConvertToIA2Attributes(nsIPersistentProperties* aAttributes,
  84. BSTR* aIA2Attributes);
  85. static HRESULT ConvertToIA2Attributes(nsTArray<Attribute>* aAttributes,
  86. BSTR* aIA2Attributes);
  87. };
  88. } // namespace a11y
  89. } // namespace mozilla
  90. #endif