OuterDocAccessible.h 1.8 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
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef MOZILLA_A11Y_OUTERDOCACCESSIBLE_H_
  6. #define MOZILLA_A11Y_OUTERDOCACCESSIBLE_H_
  7. #include "AccessibleWrap.h"
  8. namespace mozilla {
  9. namespace a11y {
  10. class ProxyAccessible;
  11. /**
  12. * Used for <browser>, <frame>, <iframe>, <page> or editor> elements.
  13. *
  14. * In these variable names, "outer" relates to the OuterDocAccessible as
  15. * opposed to the DocAccessibleWrap which is "inner". The outer node is
  16. * a something like tags listed above, whereas the inner node corresponds to
  17. * the inner document root.
  18. */
  19. class OuterDocAccessible final : public AccessibleWrap
  20. {
  21. public:
  22. OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc);
  23. NS_DECL_ISUPPORTS_INHERITED
  24. ProxyAccessible* RemoteChildDoc() const;
  25. // Accessible
  26. virtual void Shutdown() override;
  27. virtual mozilla::a11y::role NativeRole() override;
  28. virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
  29. EWhichChildAtPoint aWhichChild) override;
  30. virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
  31. virtual bool RemoveChild(Accessible* aAccessible) override;
  32. virtual bool IsAcceptableChild(nsIContent* aEl) const override;
  33. #if defined(XP_WIN)
  34. virtual uint32_t ChildCount() const override;
  35. virtual Accessible* GetChildAt(uint32_t aIndex) const override;
  36. #endif // defined(XP_WIN)
  37. protected:
  38. virtual ~OuterDocAccessible() override;
  39. };
  40. inline OuterDocAccessible*
  41. Accessible::AsOuterDoc()
  42. {
  43. return IsOuterDoc() ? static_cast<OuterDocAccessible*>(this) : nullptr;
  44. }
  45. } // namespace a11y
  46. } // namespace mozilla
  47. #endif