accessible/src/xul/XULSliderAccessible.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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_XULSliderAccessible_h__
     7 #define mozilla_a11y_XULSliderAccessible_h__
     9 #include "AccessibleWrap.h"
    11 #include "nsIDOMElement.h"
    13 namespace mozilla {
    14 namespace a11y {
    16 /**
    17  * Used for XUL slider and scale elements.
    18  */
    19 class XULSliderAccessible : public AccessibleWrap
    20 {
    21 public:
    22   XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc);
    24   // nsIAccessible
    25   NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
    26   NS_IMETHOD DoAction(uint8_t aIndex);
    28   // Accessible
    29   virtual void Value(nsString& aValue);
    30   virtual a11y::role NativeRole();
    31   virtual uint64_t NativeInteractiveState() const;
    32   virtual bool NativelyUnavailable() const;
    33   virtual bool CanHaveAnonChildren();
    35   // Value
    36   virtual double MaxValue() const MOZ_OVERRIDE;
    37   virtual double MinValue() const MOZ_OVERRIDE;
    38   virtual double CurValue() const MOZ_OVERRIDE;
    39   virtual double Step() const MOZ_OVERRIDE;
    40   virtual bool SetCurValue(double aValue) MOZ_OVERRIDE;
    42   // ActionAccessible
    43   virtual uint8_t ActionCount();
    45 protected:
    46   /**
    47    * Return anonymous slider element.
    48    */
    49   nsIContent* GetSliderElement() const;
    51   nsresult GetSliderAttr(nsIAtom *aName, nsAString& aValue) const;
    52   nsresult SetSliderAttr(nsIAtom *aName, const nsAString& aValue);
    54   double GetSliderAttr(nsIAtom *aName) const;
    55   bool SetSliderAttr(nsIAtom *aName, double aValue);
    57 private:
    58   mutable nsCOMPtr<nsIContent> mSliderNode;
    59 };
    62 /**
    63  * Used for slider's thumb element.
    64  */
    65 class XULThumbAccessible : public AccessibleWrap
    66 {
    67 public:
    68   XULThumbAccessible(nsIContent* aContent, DocAccessible* aDoc);
    70   // Accessible
    71   virtual a11y::role NativeRole();
    72 };
    74 } // namespace a11y
    75 } // namespace mozilla
    77 #endif

mercurial