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_XULFormControlAccessible_H_
|
|
|
|
#define MOZILLA_A11Y_XULFormControlAccessible_H_
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// NOTE: alphabetically ordered
|
2012-05-28 18:18:45 -07:00
|
|
|
#include "AccessibleWrap.h"
|
2012-04-12 04:11:40 -07:00
|
|
|
#include "FormControlAccessible.h"
|
2012-05-31 01:04:41 -07:00
|
|
|
#include "HyperTextAccessibleWrap.h"
|
2000-12-31 16:12:15 -08:00
|
|
|
#include "XULSelectControlAccessible.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
|
|
|
/**
|
|
|
|
* Used for XUL progressmeter element.
|
|
|
|
*/
|
|
|
|
typedef ProgressMeterAccessible<100> XULProgressMeterAccessible;
|
|
|
|
|
2009-11-09 21:58:52 -08:00
|
|
|
/**
|
|
|
|
* Used for XUL button.
|
|
|
|
*
|
2012-06-04 05:32:29 -07:00
|
|
|
* @note Don't inherit from LeafAccessible - it doesn't allow children
|
2009-11-09 21:58:52 -08:00
|
|
|
* and a button can have a dropmarker child.
|
|
|
|
*/
|
2012-05-28 18:18:45 -07:00
|
|
|
class XULButtonAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum { eAction_Click = 0 };
|
2012-05-27 02:01:40 -07:00
|
|
|
XULButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2009-11-09 21:58:52 -08:00
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
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();
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2011-06-05 12:35:43 -07:00
|
|
|
// ActionAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint8_t ActionCount();
|
2011-06-05 12:35:43 -07:00
|
|
|
|
2011-09-27 18:46:11 -07:00
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
|
|
|
virtual bool IsActiveWidget() const;
|
|
|
|
virtual bool AreItemsOperable() const;
|
2012-05-28 18:18:45 -07:00
|
|
|
virtual Accessible* ContainerWidget() const;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
2013-09-06 12:27:07 -07:00
|
|
|
virtual bool IsAcceptableChild(Accessible* aPossibleChild) const MOZ_OVERRIDE;
|
2009-11-09 21:58:52 -08:00
|
|
|
|
2013-09-06 12:27:07 -07:00
|
|
|
protected:
|
2014-07-08 14:23:18 -07:00
|
|
|
virtual ~XULButtonAccessible();
|
|
|
|
|
2012-04-12 04:11:40 -07:00
|
|
|
// XULButtonAccessible
|
2011-09-28 23:19:26 -07:00
|
|
|
bool ContainsMenu();
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2009-11-09 21:58:52 -08:00
|
|
|
|
|
|
|
/**
|
2010-06-11 01:23:18 -07:00
|
|
|
* Used for XUL checkbox element.
|
2009-11-09 21:58:52 -08:00
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class XULCheckboxAccessible : public LeafAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum { eAction_Click = 0 };
|
2012-05-27 02:01:40 -07:00
|
|
|
XULCheckboxAccessible(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();
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL dropmarker element.
|
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class XULDropmarkerAccessible : public LeafAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum { eAction_Click = 0 };
|
2012-05-27 02:01:40 -07:00
|
|
|
XULDropmarkerAccessible(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);
|
2007-03-22 10:30:00 -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 NativeState();
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2011-06-05 12:35:43 -07:00
|
|
|
// ActionAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint8_t ActionCount();
|
2011-06-05 12:35:43 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
2011-09-28 23:19:26 -07:00
|
|
|
bool DropmarkerOpen(bool aToggleOpen);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL groupbox element.
|
|
|
|
*/
|
2012-05-28 18:18:45 -07:00
|
|
|
class XULGroupboxAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
XULGroupboxAccessible(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();
|
2013-10-19 11:19:50 -07:00
|
|
|
virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
|
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-01-06 02:36:50 -08:00
|
|
|
/**
|
2010-06-11 01:23:18 -07:00
|
|
|
* Used for XUL radio element (radio button).
|
2010-01-06 02:36:50 -08:00
|
|
|
*/
|
2012-04-12 04:11:40 -07:00
|
|
|
class XULRadioButtonAccessible : public RadioButtonAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
XULRadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint64_t NativeState();
|
|
|
|
virtual uint64_t NativeInteractiveState() const;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
|
|
|
// Widgets
|
2012-05-28 18:18:45 -07:00
|
|
|
virtual Accessible* ContainerWidget() const;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL radiogroup element.
|
|
|
|
*/
|
2012-04-12 04:11:40 -07:00
|
|
|
class XULRadioGroupAccessible : public XULSelectControlAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
XULRadioGroupAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
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 NativeInteractiveState() const;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
|
|
|
virtual bool IsActiveWidget() const;
|
|
|
|
virtual bool AreItemsOperable() const;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL statusbar element.
|
|
|
|
*/
|
2012-05-28 18:18:45 -07:00
|
|
|
class XULStatusBarAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
XULStatusBarAccessible(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();
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL toolbarbutton element.
|
|
|
|
*/
|
2012-04-12 04:11:40 -07:00
|
|
|
class XULToolbarButtonAccessible : public XULButtonAccessible
|
2007-07-11 00:58:50 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
XULToolbarButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2010-01-06 02:36:50 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
|
|
|
|
int32_t *aSetSize);
|
2010-01-06 02:36:50 -08:00
|
|
|
|
2010-01-11 06:14:06 -08:00
|
|
|
// nsXULToolbarButtonAccessible
|
2012-05-28 18:18:45 -07:00
|
|
|
static bool IsSeparator(Accessible* aAccessible);
|
2007-07-11 00:58:50 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL toolbar element.
|
|
|
|
*/
|
2012-05-28 18:18:45 -07:00
|
|
|
class XULToolbarAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
XULToolbarAccessible(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();
|
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
|
|
|
/**
|
|
|
|
* Used for XUL toolbarseparator element.
|
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class XULToolbarSeparatorAccessible : public LeafAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-04-12 04:11:40 -07:00
|
|
|
XULToolbarSeparatorAccessible(nsIContent* aContent,
|
2012-05-27 02:01:40 -07:00
|
|
|
DocAccessible* aDoc);
|
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();
|
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
|
|
|
|
2000-12-31 16:12:15 -08:00
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|