1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/src/base/ARIAStateMap.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,66 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef _mozilla_a11y_aria_ARIAStateMap_h_ 1.11 +#define _mozilla_a11y_aria_ARIAStateMap_h_ 1.12 + 1.13 +#include <stdint.h> 1.14 + 1.15 +namespace mozilla { 1.16 + 1.17 +namespace dom { 1.18 +class Element; 1.19 +} 1.20 + 1.21 +namespace a11y { 1.22 +namespace aria { 1.23 + 1.24 +/** 1.25 + * List of the ARIA state mapping rules. 1.26 + */ 1.27 +enum EStateRule 1.28 +{ 1.29 + eARIANone, 1.30 + eARIAAutoComplete, 1.31 + eARIABusy, 1.32 + eARIACheckableBool, 1.33 + eARIACheckableMixed, 1.34 + eARIACheckedMixed, 1.35 + eARIADisabled, 1.36 + eARIAExpanded, 1.37 + eARIAHasPopup, 1.38 + eARIAInvalid, 1.39 + eARIAMultiline, 1.40 + eARIAMultiSelectable, 1.41 + eARIAOrientation, 1.42 + eARIAPressed, 1.43 + eARIAReadonly, 1.44 + eARIAReadonlyOrEditable, 1.45 + eARIAReadonlyOrEditableIfDefined, 1.46 + eARIARequired, 1.47 + eARIASelectable, 1.48 + eARIASelectableIfDefined, 1.49 + eReadonlyUntilEditable, 1.50 + eIndeterminateIfNoValue, 1.51 + eFocusableUntilDisabled 1.52 +}; 1.53 + 1.54 +/** 1.55 + * Expose the accessible states for the given element accordingly to state 1.56 + * mapping rule. 1.57 + * 1.58 + * @param aRule [in] state mapping rule ID 1.59 + * @param aElement [in] node of the accessible 1.60 + * @param aState [in/out] accessible states 1.61 + * @return true if state map rule ID is valid 1.62 + */ 1.63 +bool MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState); 1.64 + 1.65 +} // namespace aria 1.66 +} // namespace a11y 1.67 +} // namespace mozilla 1.68 + 1.69 +#endif