Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
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_FormControlAccessible_H_ |
michael@0 | 7 | #define MOZILLA_A11Y_FormControlAccessible_H_ |
michael@0 | 8 | |
michael@0 | 9 | #include "BaseAccessibles.h" |
michael@0 | 10 | |
michael@0 | 11 | namespace mozilla { |
michael@0 | 12 | namespace a11y { |
michael@0 | 13 | |
michael@0 | 14 | /** |
michael@0 | 15 | * Generic class used for progress meters. |
michael@0 | 16 | */ |
michael@0 | 17 | template<int Max> |
michael@0 | 18 | class ProgressMeterAccessible : public LeafAccessible |
michael@0 | 19 | { |
michael@0 | 20 | public: |
michael@0 | 21 | ProgressMeterAccessible(nsIContent* aContent, DocAccessible* aDoc) : |
michael@0 | 22 | LeafAccessible(aContent, aDoc) |
michael@0 | 23 | { |
michael@0 | 24 | // Ignore 'ValueChange' DOM event in lieu of @value attribute change |
michael@0 | 25 | // notifications. |
michael@0 | 26 | mStateFlags |= eHasNumericValue | eIgnoreDOMUIEvent; |
michael@0 | 27 | mType = eProgressType; |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 31 | |
michael@0 | 32 | // Accessible |
michael@0 | 33 | virtual void Value(nsString& aValue); |
michael@0 | 34 | virtual mozilla::a11y::role NativeRole(); |
michael@0 | 35 | virtual uint64_t NativeState(); |
michael@0 | 36 | |
michael@0 | 37 | // Value |
michael@0 | 38 | virtual double MaxValue() const MOZ_OVERRIDE; |
michael@0 | 39 | virtual double MinValue() const MOZ_OVERRIDE; |
michael@0 | 40 | virtual double CurValue() const MOZ_OVERRIDE; |
michael@0 | 41 | virtual double Step() const MOZ_OVERRIDE; |
michael@0 | 42 | virtual bool SetCurValue(double aValue) MOZ_OVERRIDE; |
michael@0 | 43 | |
michael@0 | 44 | // Widgets |
michael@0 | 45 | virtual bool IsWidget() const; |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | /** |
michael@0 | 49 | * Generic class used for radio buttons. |
michael@0 | 50 | */ |
michael@0 | 51 | class RadioButtonAccessible : public LeafAccessible |
michael@0 | 52 | { |
michael@0 | 53 | |
michael@0 | 54 | public: |
michael@0 | 55 | RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc); |
michael@0 | 56 | |
michael@0 | 57 | // nsIAccessible |
michael@0 | 58 | NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName); |
michael@0 | 59 | NS_IMETHOD DoAction(uint8_t aIndex); |
michael@0 | 60 | |
michael@0 | 61 | // Accessible |
michael@0 | 62 | virtual mozilla::a11y::role NativeRole(); |
michael@0 | 63 | |
michael@0 | 64 | // ActionAccessible |
michael@0 | 65 | virtual uint8_t ActionCount(); |
michael@0 | 66 | |
michael@0 | 67 | enum { eAction_Click = 0 }; |
michael@0 | 68 | |
michael@0 | 69 | // Widgets |
michael@0 | 70 | virtual bool IsWidget() const; |
michael@0 | 71 | }; |
michael@0 | 72 | |
michael@0 | 73 | } // namespace a11y |
michael@0 | 74 | } // namespace mozilla |
michael@0 | 75 | |
michael@0 | 76 | #endif |
michael@0 | 77 |