michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_a11y_XULSliderAccessible_h__ michael@0: #define mozilla_a11y_XULSliderAccessible_h__ michael@0: michael@0: #include "AccessibleWrap.h" michael@0: michael@0: #include "nsIDOMElement.h" michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: /** michael@0: * Used for XUL slider and scale elements. michael@0: */ michael@0: class XULSliderAccessible : public AccessibleWrap michael@0: { michael@0: public: michael@0: XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc); michael@0: michael@0: // nsIAccessible michael@0: NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName); michael@0: NS_IMETHOD DoAction(uint8_t aIndex); michael@0: michael@0: // Accessible michael@0: virtual void Value(nsString& aValue); michael@0: virtual a11y::role NativeRole(); michael@0: virtual uint64_t NativeInteractiveState() const; michael@0: virtual bool NativelyUnavailable() const; michael@0: virtual bool CanHaveAnonChildren(); michael@0: michael@0: // Value michael@0: virtual double MaxValue() const MOZ_OVERRIDE; michael@0: virtual double MinValue() const MOZ_OVERRIDE; michael@0: virtual double CurValue() const MOZ_OVERRIDE; michael@0: virtual double Step() const MOZ_OVERRIDE; michael@0: virtual bool SetCurValue(double aValue) MOZ_OVERRIDE; michael@0: michael@0: // ActionAccessible michael@0: virtual uint8_t ActionCount(); michael@0: michael@0: protected: michael@0: /** michael@0: * Return anonymous slider element. michael@0: */ michael@0: nsIContent* GetSliderElement() const; michael@0: michael@0: nsresult GetSliderAttr(nsIAtom *aName, nsAString& aValue) const; michael@0: nsresult SetSliderAttr(nsIAtom *aName, const nsAString& aValue); michael@0: michael@0: double GetSliderAttr(nsIAtom *aName) const; michael@0: bool SetSliderAttr(nsIAtom *aName, double aValue); michael@0: michael@0: private: michael@0: mutable nsCOMPtr mSliderNode; michael@0: }; michael@0: michael@0: michael@0: /** michael@0: * Used for slider's thumb element. michael@0: */ michael@0: class XULThumbAccessible : public AccessibleWrap michael@0: { michael@0: public: michael@0: XULThumbAccessible(nsIContent* aContent, DocAccessible* aDoc); michael@0: michael@0: // Accessible michael@0: virtual a11y::role NativeRole(); michael@0: }; michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif michael@0: