michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_a11y_Accessible_inl_h_ michael@0: #define mozilla_a11y_Accessible_inl_h_ michael@0: michael@0: #include "Accessible.h" michael@0: #include "ARIAMap.h" michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: inline mozilla::a11y::role michael@0: Accessible::Role() michael@0: { michael@0: if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole) michael@0: return ARIATransformRole(NativeRole()); michael@0: michael@0: return ARIATransformRole(mRoleMapEntry->role); michael@0: } michael@0: michael@0: inline bool michael@0: Accessible::IsARIARole(nsIAtom* aARIARole) const michael@0: { michael@0: return mRoleMapEntry && mRoleMapEntry->Is(aARIARole); michael@0: } michael@0: michael@0: inline mozilla::a11y::role michael@0: Accessible::ARIARole() michael@0: { michael@0: if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole) michael@0: return mozilla::a11y::roles::NOTHING; michael@0: michael@0: return ARIATransformRole(mRoleMapEntry->role); michael@0: } michael@0: michael@0: inline bool michael@0: Accessible::HasGenericType(AccGenericType aType) const michael@0: { michael@0: return (mGenericTypes & aType) || michael@0: (mRoleMapEntry && mRoleMapEntry->IsOfType(aType)); michael@0: } michael@0: michael@0: inline bool michael@0: Accessible::HasNumericValue() const michael@0: { michael@0: if (mStateFlags & eHasNumericValue) michael@0: return true; michael@0: michael@0: return mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue; michael@0: } michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif