|
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 |
|
6 #ifndef mozilla_a11y_HTMLLinkAccessible_h__ |
|
7 #define mozilla_a11y_HTMLLinkAccessible_h__ |
|
8 |
|
9 #include "HyperTextAccessibleWrap.h" |
|
10 |
|
11 namespace mozilla { |
|
12 namespace a11y { |
|
13 |
|
14 class HTMLLinkAccessible : public HyperTextAccessibleWrap |
|
15 { |
|
16 public: |
|
17 HTMLLinkAccessible(nsIContent* aContent, DocAccessible* aDoc); |
|
18 |
|
19 NS_DECL_ISUPPORTS_INHERITED |
|
20 |
|
21 // nsIAccessible |
|
22 NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName); |
|
23 NS_IMETHOD DoAction(uint8_t aIndex); |
|
24 |
|
25 // Accessible |
|
26 virtual void Value(nsString& aValue); |
|
27 virtual a11y::role NativeRole(); |
|
28 virtual uint64_t NativeState(); |
|
29 virtual uint64_t NativeLinkState() const; |
|
30 virtual uint64_t NativeInteractiveState() const; |
|
31 |
|
32 // ActionAccessible |
|
33 virtual uint8_t ActionCount(); |
|
34 |
|
35 // HyperLinkAccessible |
|
36 virtual bool IsLink(); |
|
37 virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex); |
|
38 |
|
39 protected: |
|
40 enum { eAction_Jump = 0 }; |
|
41 |
|
42 /** |
|
43 * Returns true if the link has href attribute. |
|
44 */ |
|
45 bool IsLinked(); |
|
46 }; |
|
47 |
|
48 } // namespace a11y |
|
49 } // namespace mozilla |
|
50 |
|
51 #endif |