Bug 1856666 - run snap tests as cron r=releng-reviewers,ahal
[gecko.git] / accessible / generic / FormControlAccessible.h
blob44c142d4e2bd6f0e9356b6e91a28ca1612a87424
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"
11 namespace mozilla {
12 namespace a11y {
14 /**
15 * Checkbox accessible.
17 class CheckboxAccessible : public LeafAccessible {
18 public:
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;
30 // LocalAccessible
31 virtual mozilla::a11y::role NativeRole() const override;
32 virtual uint64_t NativeState() const override;
34 // ActionAccessible
35 virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
36 virtual bool HasPrimaryAction() const override;
38 // Widgets
39 virtual bool IsWidget() const override;
42 /**
43 * Generic class used for radio buttons.
45 class RadioButtonAccessible : public LeafAccessible {
46 public:
47 RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
49 // LocalAccessible
50 virtual mozilla::a11y::role NativeRole() const override;
52 // ActionAccessible
53 virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
54 virtual bool HasPrimaryAction() const override;
56 enum { eAction_Click = 0 };
58 // Widgets
59 virtual bool IsWidget() const override;
62 } // namespace a11y
63 } // namespace mozilla
65 #endif