xpcAccessibleTableCell.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 file,
  4. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_a11y_xpcom_xpcAccessibletableCell_h_
  6. #define mozilla_a11y_xpcom_xpcAccessibletableCell_h_
  7. #include "nsIAccessibleTable.h"
  8. #include "xpcAccessibleHyperText.h"
  9. namespace mozilla {
  10. namespace a11y {
  11. /**
  12. * XPCOM wrapper around TableAccessibleCell class.
  13. */
  14. class xpcAccessibleTableCell : public xpcAccessibleHyperText,
  15. public nsIAccessibleTableCell
  16. {
  17. public:
  18. explicit xpcAccessibleTableCell(Accessible* aIntl) :
  19. xpcAccessibleHyperText(aIntl) { }
  20. xpcAccessibleTableCell(ProxyAccessible* aProxy, uint32_t aInterfaces) :
  21. xpcAccessibleHyperText(aProxy, aInterfaces) {}
  22. NS_DECL_ISUPPORTS_INHERITED
  23. // nsIAccessibleTableCell
  24. NS_IMETHOD GetTable(nsIAccessibleTable** aTable) final override;
  25. NS_IMETHOD GetColumnIndex(int32_t* aColIdx) final override;
  26. NS_IMETHOD GetRowIndex(int32_t* aRowIdx) final override;
  27. NS_IMETHOD GetColumnExtent(int32_t* aExtent) final override;
  28. NS_IMETHOD GetRowExtent(int32_t* aExtent) final override;
  29. NS_IMETHOD GetColumnHeaderCells(nsIArray** aHeaderCells) final override;
  30. NS_IMETHOD GetRowHeaderCells(nsIArray** aHeaderCells) final override;
  31. NS_IMETHOD IsSelected(bool* aSelected) final override;
  32. protected:
  33. virtual ~xpcAccessibleTableCell() {}
  34. private:
  35. TableCellAccessible* Intl()
  36. {
  37. if (Accessible* acc = mIntl.AsAccessible()) {
  38. return acc->AsTableCell();
  39. }
  40. return nullptr;
  41. }
  42. xpcAccessibleTableCell(const xpcAccessibleTableCell&) = delete;
  43. xpcAccessibleTableCell& operator =(const xpcAccessibleTableCell&) = delete;
  44. };
  45. } // namespace a11y
  46. } // namespace mozilla
  47. #endif // mozilla_a11y_xpcom_xpcAccessibletableCell_h_