AccessibleNode.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
  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 A11Y_AOM_ACCESSIBLENODE_H
  6. #define A11Y_AOM_ACCESSIBLENODE_H
  7. #include "nsWrapperCache.h"
  8. #include "mozilla/RefPtr.h"
  9. class nsINode;
  10. namespace mozilla {
  11. namespace a11y {
  12. class Accessible;
  13. }
  14. namespace dom {
  15. struct ParentObject;
  16. class AccessibleNode : public nsISupports,
  17. public nsWrapperCache
  18. {
  19. public:
  20. explicit AccessibleNode(nsINode* aNode);
  21. NS_DECL_CYCLE_COLLECTING_ISUPPORTS;
  22. NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AccessibleNode);
  23. virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override final;
  24. virtual dom::ParentObject GetParentObject() const final;
  25. void GetRole(nsAString& aRole);
  26. nsINode* GetDOMNode();
  27. protected:
  28. AccessibleNode(const AccessibleNode& aCopy) = delete;
  29. AccessibleNode& operator=(const AccessibleNode& aCopy) = delete;
  30. virtual ~AccessibleNode();
  31. RefPtr<a11y::Accessible> mIntl;
  32. RefPtr<nsINode> mDOMNode;
  33. };
  34. } // dom
  35. } // mozilla
  36. #endif // A11Y_JSAPI_ACCESSIBLENODE