Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_a11y_XULSliderAccessible_h__ |
michael@0 | 7 | #define mozilla_a11y_XULSliderAccessible_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "AccessibleWrap.h" |
michael@0 | 10 | |
michael@0 | 11 | #include "nsIDOMElement.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace a11y { |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * Used for XUL slider and scale elements. |
michael@0 | 18 | */ |
michael@0 | 19 | class XULSliderAccessible : public AccessibleWrap |
michael@0 | 20 | { |
michael@0 | 21 | public: |
michael@0 | 22 | XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc); |
michael@0 | 23 | |
michael@0 | 24 | // nsIAccessible |
michael@0 | 25 | NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName); |
michael@0 | 26 | NS_IMETHOD DoAction(uint8_t aIndex); |
michael@0 | 27 | |
michael@0 | 28 | // Accessible |
michael@0 | 29 | virtual void Value(nsString& aValue); |
michael@0 | 30 | virtual a11y::role NativeRole(); |
michael@0 | 31 | virtual uint64_t NativeInteractiveState() const; |
michael@0 | 32 | virtual bool NativelyUnavailable() const; |
michael@0 | 33 | virtual bool CanHaveAnonChildren(); |
michael@0 | 34 | |
michael@0 | 35 | // Value |
michael@0 | 36 | virtual double MaxValue() const MOZ_OVERRIDE; |
michael@0 | 37 | virtual double MinValue() const MOZ_OVERRIDE; |
michael@0 | 38 | virtual double CurValue() const MOZ_OVERRIDE; |
michael@0 | 39 | virtual double Step() const MOZ_OVERRIDE; |
michael@0 | 40 | virtual bool SetCurValue(double aValue) MOZ_OVERRIDE; |
michael@0 | 41 | |
michael@0 | 42 | // ActionAccessible |
michael@0 | 43 | virtual uint8_t ActionCount(); |
michael@0 | 44 | |
michael@0 | 45 | protected: |
michael@0 | 46 | /** |
michael@0 | 47 | * Return anonymous slider element. |
michael@0 | 48 | */ |
michael@0 | 49 | nsIContent* GetSliderElement() const; |
michael@0 | 50 | |
michael@0 | 51 | nsresult GetSliderAttr(nsIAtom *aName, nsAString& aValue) const; |
michael@0 | 52 | nsresult SetSliderAttr(nsIAtom *aName, const nsAString& aValue); |
michael@0 | 53 | |
michael@0 | 54 | double GetSliderAttr(nsIAtom *aName) const; |
michael@0 | 55 | bool SetSliderAttr(nsIAtom *aName, double aValue); |
michael@0 | 56 | |
michael@0 | 57 | private: |
michael@0 | 58 | mutable nsCOMPtr<nsIContent> mSliderNode; |
michael@0 | 59 | }; |
michael@0 | 60 | |
michael@0 | 61 | |
michael@0 | 62 | /** |
michael@0 | 63 | * Used for slider's thumb element. |
michael@0 | 64 | */ |
michael@0 | 65 | class XULThumbAccessible : public AccessibleWrap |
michael@0 | 66 | { |
michael@0 | 67 | public: |
michael@0 | 68 | XULThumbAccessible(nsIContent* aContent, DocAccessible* aDoc); |
michael@0 | 69 | |
michael@0 | 70 | // Accessible |
michael@0 | 71 | virtual a11y::role NativeRole(); |
michael@0 | 72 | }; |
michael@0 | 73 | |
michael@0 | 74 | } // namespace a11y |
michael@0 | 75 | } // namespace mozilla |
michael@0 | 76 | |
michael@0 | 77 | #endif |
michael@0 | 78 |