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_HTMLFormControlAccessible_H_
|
|
|
|
#define MOZILLA_A11Y_HTMLFormControlAccessible_H_
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-04-12 04:11:40 -07:00
|
|
|
#include "FormControlAccessible.h"
|
2012-05-31 01:04:41 -07:00
|
|
|
#include "HyperTextAccessibleWrap.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-04-12 04:11:40 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2011-05-11 19:55:12 -07:00
|
|
|
/**
|
|
|
|
* Accessible for HTML progress element.
|
|
|
|
*/
|
|
|
|
typedef ProgressMeterAccessible<1> HTMLProgressMeterAccessible;
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Accessible for HTML input@type="checkbox".
|
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class HTMLCheckboxAccessible : public LeafAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum { eAction_Click = 0 };
|
|
|
|
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-11-03 19:37:46 -08:00
|
|
|
|
|
|
|
// nsIAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
|
|
|
|
NS_IMETHOD DoAction(uint8_t index);
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint64_t NativeState();
|
2011-06-05 12:35:43 -07:00
|
|
|
|
|
|
|
// ActionAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint8_t ActionCount();
|
2011-09-28 20:13:08 -07:00
|
|
|
|
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible for HTML input@type="radio" element.
|
|
|
|
*/
|
2012-04-12 04:11:40 -07:00
|
|
|
class HTMLRadioButtonAccessible : public RadioButtonAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLRadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-03-27 05:17:11 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint64_t NativeState();
|
|
|
|
virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
|
|
|
|
int32_t *aSetSize);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible for HTML input@type="button", @type="submit", @type="image"
|
2012-02-22 03:33:37 -08:00
|
|
|
* and HTML button elements.
|
2010-06-11 01:23:18 -07:00
|
|
|
*/
|
2012-05-31 01:04:41 -07:00
|
|
|
class HTMLButtonAccessible : public HyperTextAccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum { eAction_Click = 0 };
|
|
|
|
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-10-10 05:26:55 -07:00
|
|
|
|
|
|
|
// nsIAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
|
|
|
|
NS_IMETHOD DoAction(uint8_t index);
|
2008-10-10 05:26:55 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint64_t State();
|
|
|
|
virtual uint64_t NativeState();
|
2011-06-05 12:35:43 -07:00
|
|
|
|
|
|
|
// ActionAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint8_t ActionCount();
|
2011-09-28 20:13:08 -07:00
|
|
|
|
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
2012-10-13 21:18:39 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Accessible
|
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible for HTML input@type="text" element.
|
|
|
|
*/
|
2012-05-31 01:04:41 -07:00
|
|
|
class HTMLTextFieldAccessible : public HyperTextAccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum { eAction_Click = 0 };
|
|
|
|
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLTextFieldAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-11-09 11:27:07 -08:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2008-10-10 05:26:55 -07:00
|
|
|
// nsIAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
|
|
|
|
NS_IMETHOD DoAction(uint8_t index);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-31 01:04:41 -07:00
|
|
|
// HyperTextAccessible
|
2012-03-07 19:28:38 -08:00
|
|
|
virtual already_AddRefed<nsIEditor> GetEditor() const;
|
2008-10-14 01:27:02 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-04-09 02:48:41 -07:00
|
|
|
virtual void Value(nsString& aValue);
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual void ApplyARIAState(uint64_t* aState) const;
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint64_t NativeState();
|
2011-06-05 12:35:43 -07:00
|
|
|
|
|
|
|
// ActionAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint8_t ActionCount();
|
2011-09-27 18:46:11 -07:00
|
|
|
|
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
2012-05-28 18:18:45 -07:00
|
|
|
virtual Accessible* ContainerWidget() const;
|
2012-10-13 21:18:39 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Accessible
|
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
|
2011-11-30 04:36:20 -08:00
|
|
|
/**
|
|
|
|
* Accessible for input@type="file" element.
|
|
|
|
*/
|
2012-05-31 01:04:41 -07:00
|
|
|
class HTMLFileInputAccessible : public HyperTextAccessibleWrap
|
2011-11-30 04:36:20 -08:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLFileInputAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2011-11-30 04:36:20 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2011-11-30 04:36:20 -08:00
|
|
|
virtual nsresult HandleAccEvent(AccEvent* aAccEvent);
|
|
|
|
};
|
|
|
|
|
2013-04-27 17:54:54 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for input@type="range" element.
|
|
|
|
*/
|
|
|
|
class HTMLRangeAccessible : public LeafAccessible
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
HTMLRangeAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
|
|
|
LeafAccessible(aContent, aDoc)
|
|
|
|
{
|
|
|
|
mStateFlags |= eHasNumericValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_NSIACCESSIBLEVALUE
|
|
|
|
|
|
|
|
// Accessible
|
|
|
|
virtual void Value(nsString& aValue);
|
|
|
|
virtual mozilla::a11y::role NativeRole();
|
|
|
|
|
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Accessible for HTML fieldset element.
|
|
|
|
*/
|
2012-05-31 01:04:41 -07:00
|
|
|
class HTMLGroupboxAccessible : public HyperTextAccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-10-10 05:26:55 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Relation RelationByType(uint32_t aType);
|
2008-10-10 05:26:55 -07:00
|
|
|
|
2007-06-30 13:06:13 -07:00
|
|
|
protected:
|
2012-10-13 21:18:39 -07:00
|
|
|
// Accessible
|
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// HTMLGroupboxAccessible
|
2007-06-30 13:06:13 -07:00
|
|
|
nsIContent* GetLegend();
|
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible for HTML legend element.
|
|
|
|
*/
|
2012-05-31 01:04:41 -07:00
|
|
|
class HTMLLegendAccessible : public HyperTextAccessibleWrap
|
2007-06-30 13:06:13 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLLegendAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-02-10 02:03:30 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Relation RelationByType(uint32_t aType);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2011-12-04 22:04:06 -08:00
|
|
|
/**
|
|
|
|
* Accessible for HTML5 figure element.
|
|
|
|
*/
|
2012-05-31 01:04:41 -07:00
|
|
|
class HTMLFigureAccessible : public HyperTextAccessibleWrap
|
2011-12-04 22:04:06 -08:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLFigureAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2011-12-04 22:04:06 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-10-19 00:15:23 -07:00
|
|
|
virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Relation RelationByType(uint32_t aType);
|
2011-12-04 22:04:06 -08:00
|
|
|
|
|
|
|
protected:
|
2012-10-13 21:18:39 -07:00
|
|
|
// Accessible
|
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// HTMLLegendAccessible
|
2011-12-04 22:04:06 -08:00
|
|
|
nsIContent* Caption() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible for HTML5 figcaption element.
|
|
|
|
*/
|
2012-05-31 01:04:41 -07:00
|
|
|
class HTMLFigcaptionAccessible : public HyperTextAccessibleWrap
|
2011-12-04 22:04:06 -08:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
HTMLFigcaptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2011-12-04 22:04:06 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Relation RelationByType(uint32_t aType);
|
2011-12-04 22:04:06 -08:00
|
|
|
};
|
|
|
|
|
2012-04-12 04:11:40 -07:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2011-12-04 22:04:06 -08:00
|
|
|
#endif
|