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