tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

FormControlAccessible.h (1756B)


      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/. */
      5 
      6 #ifndef MOZILLA_A11Y_FormControlAccessible_H_
      7 #define MOZILLA_A11Y_FormControlAccessible_H_
      8 
      9 #include "BaseAccessibles.h"
     10 
     11 namespace mozilla {
     12 namespace a11y {
     13 
     14 /**
     15 * Checkbox accessible.
     16 */
     17 class CheckboxAccessible : public LeafAccessible {
     18 public:
     19  enum { eAction_Click = 0 };
     20 
     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;
     27    }
     28  }
     29 
     30  // LocalAccessible
     31  virtual mozilla::a11y::role NativeRole() const override;
     32  virtual uint64_t NativeState() const override;
     33 
     34  // ActionAccessible
     35  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
     36  virtual bool HasPrimaryAction() const override;
     37 
     38  // Widgets
     39  virtual bool IsWidget() const override;
     40 };
     41 
     42 /**
     43 * Generic class used for radio buttons.
     44 */
     45 class RadioButtonAccessible : public LeafAccessible {
     46 public:
     47  RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
     48 
     49  // LocalAccessible
     50  virtual mozilla::a11y::role NativeRole() const override;
     51 
     52  // ActionAccessible
     53  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
     54  virtual bool HasPrimaryAction() const override;
     55 
     56  enum { eAction_Click = 0 };
     57 
     58  // Widgets
     59  virtual bool IsWidget() const override;
     60 };
     61 
     62 }  // namespace a11y
     63 }  // namespace mozilla
     64 
     65 #endif