|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef mozilla_a11y_Accessible_inl_h_ |
|
8 #define mozilla_a11y_Accessible_inl_h_ |
|
9 |
|
10 #include "Accessible.h" |
|
11 #include "ARIAMap.h" |
|
12 |
|
13 namespace mozilla { |
|
14 namespace a11y { |
|
15 |
|
16 inline mozilla::a11y::role |
|
17 Accessible::Role() |
|
18 { |
|
19 if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole) |
|
20 return ARIATransformRole(NativeRole()); |
|
21 |
|
22 return ARIATransformRole(mRoleMapEntry->role); |
|
23 } |
|
24 |
|
25 inline bool |
|
26 Accessible::IsARIARole(nsIAtom* aARIARole) const |
|
27 { |
|
28 return mRoleMapEntry && mRoleMapEntry->Is(aARIARole); |
|
29 } |
|
30 |
|
31 inline mozilla::a11y::role |
|
32 Accessible::ARIARole() |
|
33 { |
|
34 if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole) |
|
35 return mozilla::a11y::roles::NOTHING; |
|
36 |
|
37 return ARIATransformRole(mRoleMapEntry->role); |
|
38 } |
|
39 |
|
40 inline bool |
|
41 Accessible::HasGenericType(AccGenericType aType) const |
|
42 { |
|
43 return (mGenericTypes & aType) || |
|
44 (mRoleMapEntry && mRoleMapEntry->IsOfType(aType)); |
|
45 } |
|
46 |
|
47 inline bool |
|
48 Accessible::HasNumericValue() const |
|
49 { |
|
50 if (mStateFlags & eHasNumericValue) |
|
51 return true; |
|
52 |
|
53 return mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue; |
|
54 } |
|
55 |
|
56 } // namespace a11y |
|
57 } // namespace mozilla |
|
58 |
|
59 #endif |