2007-03-22 10:30:00 -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-03-22 10:30:00 -07:00
|
|
|
|
2012-04-12 04:11:40 -07:00
|
|
|
#ifndef MOZILLA_A11Y_FormControlAccessible_H_
|
|
|
|
#define MOZILLA_A11Y_FormControlAccessible_H_
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-04 05:32:29 -07:00
|
|
|
#include "BaseAccessibles.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-04-12 04:11:40 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-05-11 19:55:12 -07:00
|
|
|
/**
|
|
|
|
* Generic class used for progress meters.
|
|
|
|
*/
|
|
|
|
template<int Max>
|
2012-06-04 05:32:29 -07:00
|
|
|
class ProgressMeterAccessible : public LeafAccessible
|
2011-05-11 19:55:12 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
ProgressMeterAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-06-04 05:32:29 -07:00
|
|
|
LeafAccessible(aContent, aDoc)
|
2011-05-12 05:03:17 -07:00
|
|
|
{
|
2013-08-02 09:42:36 -07:00
|
|
|
// Ignore 'ValueChange' DOM event in lieu of @value attribute change
|
|
|
|
// notifications.
|
|
|
|
mStateFlags |= eHasNumericValue | eIgnoreDOMUIEvent;
|
2012-12-17 21:22:26 -08:00
|
|
|
mType = eProgressType;
|
2011-05-12 05:03:17 -07:00
|
|
|
}
|
2011-05-11 19:55:12 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-04-09 02:48:41 -07:00
|
|
|
virtual void Value(nsString& aValue);
|
2014-09-16 10:30:23 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t NativeState() MOZ_OVERRIDE;
|
2011-09-28 20:13:08 -07:00
|
|
|
|
2013-11-19 13:01:15 -08: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-09-28 20:13:08 -07:00
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
2014-07-08 14:23:18 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~ProgressMeterAccessible() {}
|
2011-05-11 19:55:12 -07:00
|
|
|
};
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
2010-06-11 01:23:18 -07:00
|
|
|
* Generic class used for radio buttons.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class RadioButtonAccessible : public LeafAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-03-07 07:38:58 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2009-03-07 07:38:58 -08:00
|
|
|
|
2011-06-05 12:35:43 -07:00
|
|
|
// ActionAccessible
|
2014-09-16 10:30:23 -07: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 12:35:43 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
enum { eAction_Click = 0 };
|
2011-09-28 20:13:08 -07:00
|
|
|
|
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2012-04-12 04:11:40 -07:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|