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