Bug 1753131 - Dispatch devicechange events even without an actively capturing MediaSt...
[gecko.git] / accessible / html / HTMLLinkAccessible.h
blob5379a8d5bd78975603c5a6b5c2928fc079b7fda0
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/. */
6 #ifndef mozilla_a11y_HTMLLinkAccessible_h__
7 #define mozilla_a11y_HTMLLinkAccessible_h__
9 #include "HyperTextAccessibleWrap.h"
11 namespace mozilla {
12 namespace a11y {
14 class HTMLLinkAccessible : public HyperTextAccessibleWrap {
15 public:
16 HTMLLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
18 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLinkAccessible,
19 HyperTextAccessibleWrap)
21 // LocalAccessible
22 virtual void Value(nsString& aValue) const override;
23 virtual a11y::role NativeRole() const override;
24 virtual uint64_t NativeState() const override;
25 virtual uint64_t NativeLinkState() const override;
26 virtual uint64_t NativeInteractiveState() const override;
28 // ActionAccessible
29 virtual uint8_t ActionCount() const override;
30 virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
31 virtual bool DoAction(uint8_t aIndex) const override;
33 // HyperLinkAccessible
34 virtual bool IsLink() const override;
35 virtual already_AddRefed<nsIURI> AnchorURIAt(
36 uint32_t aAnchorIndex) const override;
38 /**
39 * Returns true if the link has href attribute.
41 bool IsLinked() const;
43 protected:
44 virtual ~HTMLLinkAccessible() {}
46 virtual bool AttributeChangesState(nsAtom* aAttribute) override;
48 virtual void DOMAttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
49 int32_t aModType,
50 const nsAttrValue* aOldValue,
51 uint64_t aOldState) override;
53 enum { eAction_Jump = 0 };
56 inline HTMLLinkAccessible* LocalAccessible::AsHTMLLink() {
57 return IsHTMLLink() ? static_cast<HTMLLinkAccessible*>(this) : nullptr;
60 } // namespace a11y
61 } // namespace mozilla
63 #endif