Line data Source code
1 : /* -*- Mode: C++ final; tab-width: 2 final; indent-tabs-mode: nil final; 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/. */
6 :
7 : #ifndef mozilla_a11y_xpcAccessibleTable_h_
8 : #define mozilla_a11y_xpcAccessibleTable_h_
9 :
10 : #include "nsIAccessibleTable.h"
11 : #include "xpcAccessibleGeneric.h"
12 :
13 : namespace mozilla {
14 : namespace a11y {
15 :
16 : /**
17 : * XPCOM wrapper around TableAccessible class.
18 : */
19 : class xpcAccessibleTable : public xpcAccessibleGeneric,
20 : public nsIAccessibleTable
21 : {
22 : public:
23 0 : explicit xpcAccessibleTable(Accessible* aIntl) :
24 0 : xpcAccessibleGeneric(aIntl) { }
25 :
26 : xpcAccessibleTable(ProxyAccessible* aProxy, uint32_t aInterfaces) :
27 : xpcAccessibleGeneric(aProxy, aInterfaces) {}
28 :
29 : NS_DECL_ISUPPORTS_INHERITED
30 :
31 : // nsIAccessibleTable
32 : NS_IMETHOD GetCaption(nsIAccessible** aCaption) final override;
33 : NS_IMETHOD GetSummary(nsAString& aSummary) final override;
34 : NS_IMETHOD GetColumnCount(int32_t* aColumnCount) final override;
35 : NS_IMETHOD GetRowCount(int32_t* aRowCount) final override;
36 : NS_IMETHOD GetCellAt(int32_t aRowIndex, int32_t aColumnIndex,
37 : nsIAccessible** aCell) final override;
38 : NS_IMETHOD GetCellIndexAt(int32_t aRowIndex, int32_t aColumnIndex,
39 : int32_t* aCellIndex) final override;
40 : NS_IMETHOD GetColumnIndexAt(int32_t aCellIndex, int32_t* aColumnIndex)
41 : final override;
42 : NS_IMETHOD GetRowIndexAt(int32_t aCellIndex, int32_t* aRowIndex)
43 : final override;
44 : NS_IMETHOD GetRowAndColumnIndicesAt(int32_t aCellIndex, int32_t* aRowIndex,
45 : int32_t* aColumnIndex)
46 : final override;
47 : NS_IMETHOD GetColumnExtentAt(int32_t row, int32_t column,
48 : int32_t* aColumnExtent) final override;
49 : NS_IMETHOD GetRowExtentAt(int32_t row, int32_t column,
50 : int32_t* aRowExtent) final override;
51 : NS_IMETHOD GetColumnDescription(int32_t aColIdx, nsAString& aDescription)
52 : final override;
53 : NS_IMETHOD GetRowDescription(int32_t aRowIdx, nsAString& aDescription)
54 : final override;
55 : NS_IMETHOD IsColumnSelected(int32_t aColIdx, bool* _retval)
56 : final override;
57 : NS_IMETHOD IsRowSelected(int32_t aRowIdx, bool* _retval)
58 : final override;
59 : NS_IMETHOD IsCellSelected(int32_t aRowIdx, int32_t aColIdx, bool* _retval)
60 : final override;
61 : NS_IMETHOD GetSelectedCellCount(uint32_t* aSelectedCellCount)
62 : final override;
63 : NS_IMETHOD GetSelectedColumnCount(uint32_t* aSelectedColumnCount)
64 : final override;
65 : NS_IMETHOD GetSelectedRowCount(uint32_t* aSelectedRowCount)
66 : final override;
67 : NS_IMETHOD GetSelectedCells(nsIArray** aSelectedCell) final override;
68 : NS_IMETHOD GetSelectedCellIndices(uint32_t* aCellsArraySize,
69 : int32_t** aCellsArray)
70 : final override;
71 : NS_IMETHOD GetSelectedColumnIndices(uint32_t* aColsArraySize,
72 : int32_t** aColsArray)
73 : final override;
74 : NS_IMETHOD GetSelectedRowIndices(uint32_t* aRowsArraySize,
75 : int32_t** aRowsArray) final override;
76 : NS_IMETHOD SelectColumn(int32_t aColIdx) final override;
77 : NS_IMETHOD SelectRow(int32_t aRowIdx) final override;
78 : NS_IMETHOD UnselectColumn(int32_t aColIdx) final override;
79 : NS_IMETHOD UnselectRow(int32_t aRowIdx) final override;
80 : NS_IMETHOD IsProbablyForLayout(bool* aIsForLayout) final override;
81 :
82 : protected:
83 0 : virtual ~xpcAccessibleTable() {}
84 :
85 : private:
86 0 : TableAccessible* Intl()
87 0 : { return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsTable() : nullptr; }
88 :
89 : xpcAccessibleTable(const xpcAccessibleTable&) = delete;
90 : xpcAccessibleTable& operator =(const xpcAccessibleTable&) = delete;
91 : };
92 :
93 : } // namespace a11y
94 : } // namespace mozilla
95 :
96 : #endif // mozilla_a11y_xpcAccessibleTable_h_
|