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_FormControlAccessible_H_
7 #define MOZILLA_A11Y_FormControlAccessible_H_
9 #include "BaseAccessibles.h"
15 * Checkbox accessible.
17 class CheckboxAccessible
: public LeafAccessible
{
19 enum { eAction_Click
= 0 };
21 CheckboxAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
)
22 : LeafAccessible(aContent
, aDoc
) {
23 // Ignore "CheckboxStateChange" DOM event in lieu of document observer
24 // state change notification.
25 if (aContent
->IsHTMLElement()) {
26 mStateFlags
|= eIgnoreDOMUIEvent
;
31 virtual mozilla::a11y::role
NativeRole() const override
;
32 virtual uint64_t NativeState() const override
;
35 virtual void ActionNameAt(uint8_t aIndex
, nsAString
& aName
) override
;
36 virtual bool HasPrimaryAction() const override
;
39 virtual bool IsWidget() const override
;
43 * Generic class used for radio buttons.
45 class RadioButtonAccessible
: public LeafAccessible
{
47 RadioButtonAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
);
50 virtual mozilla::a11y::role
NativeRole() const override
;
53 virtual void ActionNameAt(uint8_t aIndex
, nsAString
& aName
) override
;
54 virtual bool HasPrimaryAction() const override
;
56 enum { eAction_Click
= 0 };
59 virtual bool IsWidget() const override
;
63 } // namespace mozilla