XULSelectControlAccessible.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_XULSelectControlAccessible_h__
  6. #define mozilla_a11y_XULSelectControlAccessible_h__
  7. #include "AccessibleWrap.h"
  8. #include "nsIDOMXULSelectCntrlEl.h"
  9. namespace mozilla {
  10. namespace a11y {
  11. /**
  12. * The basic implementation of accessible selection for XUL select controls.
  13. */
  14. class XULSelectControlAccessible : public AccessibleWrap
  15. {
  16. public:
  17. XULSelectControlAccessible(nsIContent* aContent, DocAccessible* aDoc);
  18. virtual ~XULSelectControlAccessible() {}
  19. // Accessible
  20. virtual void Shutdown() override;
  21. // SelectAccessible
  22. virtual void SelectedItems(nsTArray<Accessible*>* aItems) override;
  23. virtual uint32_t SelectedItemCount() override;
  24. virtual Accessible* GetSelectedItem(uint32_t aIndex) override;
  25. virtual bool IsItemSelected(uint32_t aIndex) override;
  26. virtual bool AddItemToSelection(uint32_t aIndex) override;
  27. virtual bool RemoveItemFromSelection(uint32_t aIndex) override;
  28. virtual bool SelectAll() override;
  29. virtual bool UnselectAll() override;
  30. // Widgets
  31. virtual Accessible* CurrentItem() override;
  32. virtual void SetCurrentItem(Accessible* aItem) override;
  33. protected:
  34. // nsIDOMXULMultiSelectControlElement inherits from this, so we'll always have
  35. // one of these if the widget is valid and not defunct
  36. nsCOMPtr<nsIDOMXULSelectControlElement> mSelectControl;
  37. };
  38. } // namespace a11y
  39. } // namespace mozilla
  40. #endif