2007-08-03 22:27:27 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-08-03 22:27:27 -07:00
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
#ifndef mozilla_a11y_XULSliderAccessible_h__
|
|
|
|
#define mozilla_a11y_XULSliderAccessible_h__
|
2007-08-03 22:27:27 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
#include "AccessibleWrap.h"
|
2007-08-03 22:27:27 -07:00
|
|
|
|
|
|
|
#include "nsIDOMElement.h"
|
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL slider and scale elements.
|
|
|
|
*/
|
2012-06-10 16:44:50 -07:00
|
|
|
class XULSliderAccessible : public AccessibleWrap
|
2007-08-03 22:27:27 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-10 16:44:50 -07:00
|
|
|
XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-08-03 22:27:27 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void Value(nsString& aValue) override;
|
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeInteractiveState() const override;
|
|
|
|
virtual bool NativelyUnavailable() const override;
|
|
|
|
virtual bool CanHaveAnonChildren() override;
|
2009-03-07 07:38:58 -08:00
|
|
|
|
2013-11-19 13:01:15 -08:00
|
|
|
// Value
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual double MaxValue() const override;
|
|
|
|
virtual double MinValue() const override;
|
|
|
|
virtual double CurValue() const override;
|
|
|
|
virtual double Step() const override;
|
|
|
|
virtual bool SetCurValue(double aValue) override;
|
2013-11-19 13:01:15 -08:00
|
|
|
|
2011-06-05 12:35:43 -07:00
|
|
|
// ActionAccessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual uint8_t ActionCount() override;
|
|
|
|
virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
|
|
|
|
virtual bool DoAction(uint8_t aIndex) override;
|
2011-06-05 12:35:43 -07:00
|
|
|
|
2007-08-03 22:27:27 -07:00
|
|
|
protected:
|
2012-05-27 21:52:53 -07:00
|
|
|
/**
|
|
|
|
* Return anonymous slider element.
|
|
|
|
*/
|
2012-06-03 22:41:06 -07:00
|
|
|
nsIContent* GetSliderElement() const;
|
2009-05-11 08:20:03 -07:00
|
|
|
|
2013-11-19 13:01:15 -08:00
|
|
|
nsresult GetSliderAttr(nsIAtom *aName, nsAString& aValue) const;
|
2007-08-03 22:27:27 -07:00
|
|
|
nsresult SetSliderAttr(nsIAtom *aName, const nsAString& aValue);
|
|
|
|
|
2013-11-19 13:01:15 -08:00
|
|
|
double GetSliderAttr(nsIAtom *aName) const;
|
|
|
|
bool SetSliderAttr(nsIAtom *aName, double aValue);
|
2009-05-11 08:20:03 -07:00
|
|
|
|
|
|
|
private:
|
2012-06-03 22:41:06 -07:00
|
|
|
mutable nsCOMPtr<nsIContent> mSliderNode;
|
2007-08-03 22:27:27 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for slider's thumb element.
|
|
|
|
*/
|
2012-06-10 16:44:50 -07:00
|
|
|
class XULThumbAccessible : public AccessibleWrap
|
2007-08-03 22:27:27 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-10 16:44:50 -07:00
|
|
|
XULThumbAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-08-03 22:27:27 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual a11y::role NativeRole() override;
|
2007-08-03 22:27:27 -07:00
|
|
|
};
|
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2007-08-03 22:27:27 -07:00
|
|
|
#endif
|
|
|
|
|