ProxyAccessibleShared.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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_ProxyAccessibleShared_h
  6. #define mozilla_a11y_ProxyAccessibleShared_h
  7. /**
  8. * These are function declarations shared between win/ProxyAccessible.h and
  9. * other/ProxyAccessible.h.
  10. */
  11. /*
  12. * Return the states for the proxied accessible.
  13. */
  14. uint64_t State() const;
  15. /*
  16. * Return the native states for the proxied accessible.
  17. */
  18. uint64_t NativeState() const;
  19. /*
  20. * Set aName to the name of the proxied accessible.
  21. */
  22. void Name(nsString& aName) const;
  23. /*
  24. * Set aValue to the value of the proxied accessible.
  25. */
  26. void Value(nsString& aValue) const;
  27. /*
  28. * Set aHelp to the help string of the proxied accessible.
  29. */
  30. void Help(nsString& aHelp) const;
  31. /**
  32. * Set aDesc to the description of the proxied accessible.
  33. */
  34. void Description(nsString& aDesc) const;
  35. /**
  36. * Get the set of attributes on the proxied accessible.
  37. */
  38. void Attributes(nsTArray<Attribute> *aAttrs) const;
  39. /**
  40. * Return set of targets of given relation type.
  41. */
  42. nsTArray<ProxyAccessible*> RelationByType(RelationType aType) const;
  43. /**
  44. * Get all relations for this accessible.
  45. */
  46. void Relations(nsTArray<RelationType>* aTypes,
  47. nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets) const;
  48. bool IsSearchbox() const;
  49. nsIAtom* LandmarkRole() const;
  50. nsIAtom* ARIARoleAtom() const;
  51. int32_t GetLevelInternal();
  52. void ScrollTo(uint32_t aScrollType);
  53. void ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY);
  54. int32_t CaretLineNumber();
  55. int32_t CaretOffset();
  56. void SetCaretOffset(int32_t aOffset);
  57. int32_t CharacterCount();
  58. int32_t SelectionCount();
  59. /**
  60. * Get the text between the given offsets.
  61. */
  62. bool TextSubstring(int32_t aStartOffset, int32_t aEndOfset,
  63. nsString& aText) const;
  64. void GetTextAfterOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
  65. nsString& aText, int32_t* aStartOffset,
  66. int32_t* aEndOffset);
  67. void GetTextAtOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
  68. nsString& aText, int32_t* aStartOffset,
  69. int32_t* aEndOffset);
  70. void GetTextBeforeOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
  71. nsString& aText, int32_t* aStartOffset,
  72. int32_t* aEndOffset);
  73. char16_t CharAt(int32_t aOffset);
  74. void TextAttributes(bool aIncludeDefAttrs,
  75. const int32_t aOffset,
  76. nsTArray<Attribute>* aAttributes,
  77. int32_t* aStartOffset,
  78. int32_t* aEndOffset);
  79. void DefaultTextAttributes(nsTArray<Attribute>* aAttrs);
  80. nsIntRect TextBounds(int32_t aStartOffset, int32_t aEndOffset,
  81. uint32_t aCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE);
  82. nsIntRect CharBounds(int32_t aOffset, uint32_t aCoordType);
  83. int32_t OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType);
  84. bool SelectionBoundsAt(int32_t aSelectionNum,
  85. nsString& aData,
  86. int32_t* aStartOffset,
  87. int32_t* aEndOffset);
  88. bool SetSelectionBoundsAt(int32_t aSelectionNum,
  89. int32_t aStartOffset,
  90. int32_t aEndOffset);
  91. bool AddToSelection(int32_t aStartOffset,
  92. int32_t aEndOffset);
  93. bool RemoveFromSelection(int32_t aSelectionNum);
  94. void ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset,
  95. uint32_t aScrollType);
  96. void ScrollSubstringToPoint(int32_t aStartOffset,
  97. int32_t aEndOffset,
  98. uint32_t aCoordinateType,
  99. int32_t aX, int32_t aY);
  100. void Text(nsString* aText);
  101. void ReplaceText(const nsString& aText);
  102. bool InsertText(const nsString& aText, int32_t aPosition);
  103. bool CopyText(int32_t aStartPos, int32_t aEndPos);
  104. bool CutText(int32_t aStartPos, int32_t aEndPos);
  105. bool DeleteText(int32_t aStartPos, int32_t aEndPos);
  106. bool PasteText(int32_t aPosition);
  107. nsIntPoint ImagePosition(uint32_t aCoordType);
  108. nsIntSize ImageSize();
  109. uint32_t StartOffset(bool* aOk);
  110. uint32_t EndOffset(bool* aOk);
  111. bool IsLinkValid();
  112. uint32_t AnchorCount(bool* aOk);
  113. void AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk);
  114. ProxyAccessible* AnchorAt(uint32_t aIndex);
  115. uint32_t LinkCount();
  116. ProxyAccessible* LinkAt(const uint32_t& aIndex);
  117. int32_t LinkIndexOf(ProxyAccessible* aLink);
  118. int32_t LinkIndexAtOffset(uint32_t aOffset);
  119. ProxyAccessible* TableOfACell();
  120. uint32_t ColIdx();
  121. uint32_t RowIdx();
  122. void GetPosition(uint32_t* aColIdx, uint32_t* aRowIdx);
  123. uint32_t ColExtent();
  124. uint32_t RowExtent();
  125. void GetColRowExtents(uint32_t* aColIdx, uint32_t* aRowIdx,
  126. uint32_t* aColExtent, uint32_t* aRowExtent);
  127. void ColHeaderCells(nsTArray<ProxyAccessible*>* aCells);
  128. void RowHeaderCells(nsTArray<ProxyAccessible*>* aCells);
  129. bool IsCellSelected();
  130. ProxyAccessible* TableCaption();
  131. void TableSummary(nsString& aSummary);
  132. uint32_t TableColumnCount();
  133. uint32_t TableRowCount();
  134. ProxyAccessible* TableCellAt(uint32_t aRow, uint32_t aCol);
  135. int32_t TableCellIndexAt(uint32_t aRow, uint32_t aCol);
  136. int32_t TableColumnIndexAt(uint32_t aCellIndex);
  137. int32_t TableRowIndexAt(uint32_t aCellIndex);
  138. void TableRowAndColumnIndicesAt(uint32_t aCellIndex,
  139. int32_t* aRow, int32_t* aCol);
  140. uint32_t TableColumnExtentAt(uint32_t aRow, uint32_t aCol);
  141. uint32_t TableRowExtentAt(uint32_t aRow, uint32_t aCol);
  142. void TableColumnDescription(uint32_t aCol, nsString& aDescription);
  143. void TableRowDescription(uint32_t aRow, nsString& aDescription);
  144. bool TableColumnSelected(uint32_t aCol);
  145. bool TableRowSelected(uint32_t aRow);
  146. bool TableCellSelected(uint32_t aRow, uint32_t aCol);
  147. uint32_t TableSelectedCellCount();
  148. uint32_t TableSelectedColumnCount();
  149. uint32_t TableSelectedRowCount();
  150. void TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs);
  151. void TableSelectedCellIndices(nsTArray<uint32_t>* aCellIndices);
  152. void TableSelectedColumnIndices(nsTArray<uint32_t>* aColumnIndices);
  153. void TableSelectedRowIndices(nsTArray<uint32_t>* aRowIndices);
  154. void TableSelectColumn(uint32_t aCol);
  155. void TableSelectRow(uint32_t aRow);
  156. void TableUnselectColumn(uint32_t aCol);
  157. void TableUnselectRow(uint32_t aRow);
  158. bool TableIsProbablyForLayout();
  159. ProxyAccessible* AtkTableColumnHeader(int32_t aCol);
  160. ProxyAccessible* AtkTableRowHeader(int32_t aRow);
  161. void SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems);
  162. uint32_t SelectedItemCount();
  163. ProxyAccessible* GetSelectedItem(uint32_t aIndex);
  164. bool IsItemSelected(uint32_t aIndex);
  165. bool AddItemToSelection(uint32_t aIndex);
  166. bool RemoveItemFromSelection(uint32_t aIndex);
  167. bool SelectAll();
  168. bool UnselectAll();
  169. void TakeSelection();
  170. void SetSelected(bool aSelect);
  171. bool DoAction(uint8_t aIndex);
  172. uint8_t ActionCount();
  173. void ActionDescriptionAt(uint8_t aIndex, nsString& aDescription);
  174. void ActionNameAt(uint8_t aIndex, nsString& aName);
  175. KeyBinding AccessKey();
  176. KeyBinding KeyboardShortcut();
  177. void AtkKeyBinding(nsString& aBinding);
  178. double CurValue();
  179. bool SetCurValue(double aValue);
  180. double MinValue();
  181. double MaxValue();
  182. double Step();
  183. void TakeFocus();
  184. ProxyAccessible* FocusedChild();
  185. ProxyAccessible* ChildAtPoint(int32_t aX, int32_t aY,
  186. Accessible::EWhichChildAtPoint aWhichChild);
  187. nsIntRect Bounds();
  188. void Language(nsString& aLocale);
  189. void DocType(nsString& aType);
  190. void Title(nsString& aTitle);
  191. void URL(nsString& aURL);
  192. void MimeType(nsString aMime);
  193. void URLDocTypeMimeType(nsString& aURL, nsString& aDocType,
  194. nsString& aMimeType);
  195. ProxyAccessible* AccessibleAtPoint(int32_t aX, int32_t aY,
  196. bool aNeedsScreenCoords);
  197. void Extents(bool aNeedsScreenCoords, int32_t* aX, int32_t* aY,
  198. int32_t* aWidth, int32_t* aHeight);
  199. /**
  200. * Return the id of the dom node this accessible represents. Note this
  201. * should probably only be used for testing.
  202. */
  203. void DOMNodeID(nsString& aID);
  204. #endif