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"
14 class HTMLLinkAccessible
: public HyperTextAccessibleWrap
{
16 HTMLLinkAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
);
18 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLinkAccessible
,
19 HyperTextAccessibleWrap
)
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
;
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
;
39 * Returns true if the link has href attribute.
41 bool IsLinked() const;
44 virtual ~HTMLLinkAccessible() {}
46 virtual bool AttributeChangesState(nsAtom
* aAttribute
) override
;
48 virtual void DOMAttributeChanged(int32_t aNameSpaceID
, nsAtom
* aAttribute
,
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;
61 } // namespace mozilla