tor-browser

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

XULComboboxAccessible.h (1867B)


      1 /* -*- Mode: C++; tab-width: 4; 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_XULComboboxAccessible_h__
      7 #define mozilla_a11y_XULComboboxAccessible_h__
      8 
      9 #include "XULMenuAccessible.h"
     10 
     11 namespace mozilla {
     12 namespace a11y {
     13 
     14 /**
     15 * Used for XUL comboboxes like xul:menulist and autocomplete textbox.
     16 */
     17 class XULComboboxAccessible : public AccessibleWrap {
     18 public:
     19  enum { eAction_Click = 0 };
     20 
     21  XULComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
     22 
     23  // LocalAccessible
     24  EDescriptionValueFlag Description(nsString& aDescription) const override;
     25  void Value(nsString& aValue) const override;
     26  a11y::role NativeRole() const override;
     27  uint64_t NativeState() const override;
     28  bool IsAcceptableChild(nsIContent*) const override;
     29 
     30  // ActionAccessible
     31  bool HasPrimaryAction() const override;
     32  void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
     33  bool DoAction(uint8_t aIndex) const override;
     34 
     35  // Widgets
     36  bool IsActiveWidget() const override;
     37  MOZ_CAN_RUN_SCRIPT_BOUNDARY bool AreItemsOperable() const override;
     38 };
     39 
     40 /**
     41 * Used for the singular, global instance of a XULCombobox which is rendered
     42 * in the parent process and contains the options of the focused and expanded
     43 * HTML select in a content document. This combobox should have
     44 * id=ContentSelectDropdown
     45 */
     46 class XULContentSelectDropdownAccessible : public XULComboboxAccessible {
     47 public:
     48  XULContentSelectDropdownAccessible(nsIContent* aContent, DocAccessible* aDoc)
     49      : XULComboboxAccessible(aContent, aDoc) {}
     50  // Accessible
     51 
     52  virtual Accessible* Parent() const override;
     53 };
     54 
     55 }  // namespace a11y
     56 }  // namespace mozilla
     57 
     58 #endif