Bug 1753131 - wait for focus before dispatching devicechange events r=jib
[gecko.git] / accessible / xpcom / xpcAccessibleTable.h
blob5517a43a84e6ccceccbb44fba375f1000a82ddfd
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_a11y_xpcAccessibleTable_h_
8 #define mozilla_a11y_xpcAccessibleTable_h_
10 #include "nsIAccessibleTable.h"
11 #include "xpcAccessibleHyperText.h"
13 namespace mozilla {
14 namespace a11y {
16 /**
17 * XPCOM wrapper around TableAccessible class.
19 class xpcAccessibleTable : public xpcAccessibleHyperText,
20 public nsIAccessibleTable {
21 public:
22 explicit xpcAccessibleTable(Accessible* aIntl)
23 : xpcAccessibleHyperText(aIntl) {}
25 NS_DECL_ISUPPORTS_INHERITED
27 // nsIAccessibleTable
28 NS_IMETHOD GetCaption(nsIAccessible** aCaption) final;
29 NS_IMETHOD GetSummary(nsAString& aSummary) final;
30 NS_IMETHOD GetColumnCount(int32_t* aColumnCount) final;
31 NS_IMETHOD GetRowCount(int32_t* aRowCount) final;
32 NS_IMETHOD GetCellAt(int32_t aRowIndex, int32_t aColumnIndex,
33 nsIAccessible** aCell) final;
34 NS_IMETHOD GetCellIndexAt(int32_t aRowIndex, int32_t aColumnIndex,
35 int32_t* aCellIndex) final;
36 NS_IMETHOD GetColumnIndexAt(int32_t aCellIndex, int32_t* aColumnIndex) final;
37 NS_IMETHOD GetRowIndexAt(int32_t aCellIndex, int32_t* aRowIndex) final;
38 NS_IMETHOD GetRowAndColumnIndicesAt(int32_t aCellIndex, int32_t* aRowIndex,
39 int32_t* aColumnIndex) final;
40 NS_IMETHOD GetColumnExtentAt(int32_t row, int32_t column,
41 int32_t* aColumnExtent) final;
42 NS_IMETHOD GetRowExtentAt(int32_t row, int32_t column,
43 int32_t* aRowExtent) final;
44 NS_IMETHOD GetColumnDescription(int32_t aColIdx,
45 nsAString& aDescription) final;
46 NS_IMETHOD GetRowDescription(int32_t aRowIdx, nsAString& aDescription) final;
47 NS_IMETHOD IsColumnSelected(int32_t aColIdx, bool* _retval) final;
48 NS_IMETHOD IsRowSelected(int32_t aRowIdx, bool* _retval) final;
49 NS_IMETHOD IsCellSelected(int32_t aRowIdx, int32_t aColIdx,
50 bool* _retval) final;
51 NS_IMETHOD GetSelectedCellCount(uint32_t* aSelectedCellCount) final;
52 NS_IMETHOD GetSelectedColumnCount(uint32_t* aSelectedColumnCount) final;
53 NS_IMETHOD GetSelectedRowCount(uint32_t* aSelectedRowCount) final;
54 NS_IMETHOD GetSelectedCells(nsIArray** aSelectedCell) final;
55 NS_IMETHOD GetSelectedCellIndices(nsTArray<uint32_t>& aCellsArray) final;
56 NS_IMETHOD GetSelectedColumnIndices(nsTArray<uint32_t>& aColsArray) final;
57 NS_IMETHOD GetSelectedRowIndices(nsTArray<uint32_t>& aRowsArray) final;
58 NS_IMETHOD SelectColumn(int32_t aColIdx) final;
59 NS_IMETHOD SelectRow(int32_t aRowIdx) final;
60 NS_IMETHOD UnselectColumn(int32_t aColIdx) final;
61 NS_IMETHOD UnselectRow(int32_t aRowIdx) final;
62 NS_IMETHOD IsProbablyForLayout(bool* aIsForLayout) final;
64 protected:
65 virtual ~xpcAccessibleTable() {}
67 private:
68 TableAccessible* Intl() {
69 return mIntl->IsLocal() ? mIntl->AsLocal()->AsTable() : nullptr;
72 xpcAccessibleTable(const xpcAccessibleTable&) = delete;
73 xpcAccessibleTable& operator=(const xpcAccessibleTable&) = delete;
76 } // namespace a11y
77 } // namespace mozilla
79 #endif // mozilla_a11y_xpcAccessibleTable_h_