2007-08-04 09:27:27 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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-04 09:27:27 +04:00
|
|
|
|
2012-06-11 03:44:50 +04:00
|
|
|
#ifndef mozilla_a11y_XULSliderAccessible_h__
|
|
|
|
#define mozilla_a11y_XULSliderAccessible_h__
|
2007-08-04 09:27:27 +04:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
#include "AccessibleWrap.h"
|
2007-08-04 09:27:27 +04:00
|
|
|
|
|
|
|
#include "nsIDOMElement.h"
|
|
|
|
|
2012-06-11 03:44:50 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
/**
|
|
|
|
* Used for XUL slider and scale elements.
|
|
|
|
*/
|
2012-06-11 03:44:50 +04:00
|
|
|
class XULSliderAccessible : public AccessibleWrap
|
2007-08-04 09:27:27 +04:00
|
|
|
{
|
|
|
|
public:
|
2012-06-11 03:44:50 +04:00
|
|
|
XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-08-04 09:27:27 +04:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2015-03-21 19:28:04 +03: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 18:38:58 +03:00
|
|
|
|
2013-11-20 01:01:15 +04:00
|
|
|
// Value
|
2015-03-21 19:28:04 +03: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-20 01:01:15 +04:00
|
|
|
|
2011-06-05 23:35:43 +04:00
|
|
|
// ActionAccessible
|
2015-03-21 19:28:04 +03: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 23:35:43 +04:00
|
|
|
|
2007-08-04 09:27:27 +04:00
|
|
|
protected:
|
2012-05-28 08:52:53 +04:00
|
|
|
/**
|
|
|
|
* Return anonymous slider element.
|
|
|
|
*/
|
2012-06-04 09:41:06 +04:00
|
|
|
nsIContent* GetSliderElement() const;
|
2009-05-11 19:20:03 +04:00
|
|
|
|
2013-11-20 01:01:15 +04:00
|
|
|
nsresult GetSliderAttr(nsIAtom *aName, nsAString& aValue) const;
|
2007-08-04 09:27:27 +04:00
|
|
|
nsresult SetSliderAttr(nsIAtom *aName, const nsAString& aValue);
|
|
|
|
|
2013-11-20 01:01:15 +04:00
|
|
|
double GetSliderAttr(nsIAtom *aName) const;
|
|
|
|
bool SetSliderAttr(nsIAtom *aName, double aValue);
|
2009-05-11 19:20:03 +04:00
|
|
|
|
|
|
|
private:
|
2012-06-04 09:41:06 +04:00
|
|
|
mutable nsCOMPtr<nsIContent> mSliderNode;
|
2007-08-04 09:27:27 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
/**
|
|
|
|
* Used for slider's thumb element.
|
|
|
|
*/
|
2012-06-11 03:44:50 +04:00
|
|
|
class XULThumbAccessible : public AccessibleWrap
|
2007-08-04 09:27:27 +04:00
|
|
|
{
|
|
|
|
public:
|
2012-06-11 03:44:50 +04:00
|
|
|
XULThumbAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-08-04 09:27:27 +04:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual a11y::role NativeRole() override;
|
2007-08-04 09:27:27 +04:00
|
|
|
};
|
|
|
|
|
2012-06-11 03:44:50 +04:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2007-08-04 09:27:27 +04:00
|
|
|
#endif
|
|
|
|
|