2001-10-09 21:52:36 +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/. */
|
2001-10-09 21:52:36 +00:00
|
|
|
|
2012-04-12 11:11:40 +00:00
|
|
|
#ifndef MOZILLA_A11Y_XULFormControlAccessible_H_
|
|
|
|
#define MOZILLA_A11Y_XULFormControlAccessible_H_
|
2001-10-09 21:52:36 +00:00
|
|
|
|
|
|
|
// NOTE: alphabetically ordered
|
2012-05-29 01:18:45 +00:00
|
|
|
#include "AccessibleWrap.h"
|
2012-04-12 11:11:40 +00:00
|
|
|
#include "FormControlAccessible.h"
|
2012-05-31 08:04:41 +00:00
|
|
|
#include "HyperTextAccessibleWrap.h"
|
2001-01-01 00:12:15 +00:00
|
|
|
#include "XULSelectControlAccessible.h"
|
2001-10-09 21:52:36 +00:00
|
|
|
|
2012-04-12 11:11:40 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2011-05-12 02:55:12 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL progressmeter element.
|
|
|
|
*/
|
|
|
|
typedef ProgressMeterAccessible<100> XULProgressMeterAccessible;
|
|
|
|
|
2009-11-10 05:58:52 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL button.
|
|
|
|
*
|
2012-06-04 12:32:29 +00:00
|
|
|
* @note Don't inherit from LeafAccessible - it doesn't allow children
|
2009-11-10 05:58:52 +00:00
|
|
|
* and a button can have a dropmarker child.
|
|
|
|
*/
|
2012-05-29 01:18:45 +00:00
|
|
|
class XULButtonAccessible : public AccessibleWrap
|
2001-10-09 21:52:36 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-07-31 04:31:13 +00:00
|
|
|
enum { eAction_Click = 0 };
|
2012-05-27 09:01:40 +00:00
|
|
|
XULButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-11-04 03:37:46 +00:00
|
|
|
|
2009-11-10 05:58:52 +00:00
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t NativeState() MOZ_OVERRIDE;
|
2008-11-04 03:37:46 +00:00
|
|
|
|
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
|
|
|
|
2011-09-28 01:46:11 +00:00
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
|
|
|
virtual bool IsActiveWidget() const;
|
|
|
|
virtual bool AreItemsOperable() const;
|
2012-05-29 01:18:45 +00:00
|
|
|
virtual Accessible* ContainerWidget() const;
|
2011-09-28 01:46:11 +00:00
|
|
|
|
2013-09-06 19:27:07 +00:00
|
|
|
virtual bool IsAcceptableChild(Accessible* aPossibleChild) const MOZ_OVERRIDE;
|
2009-11-10 05:58:52 +00:00
|
|
|
|
2013-09-06 19:27:07 +00:00
|
|
|
protected:
|
2014-07-08 21:23:18 +00:00
|
|
|
virtual ~XULButtonAccessible();
|
|
|
|
|
2012-04-12 11:11:40 +00:00
|
|
|
// XULButtonAccessible
|
2014-09-16 17:30:23 +00:00
|
|
|
bool ContainsMenu() const;
|
2001-10-09 21:52:36 +00:00
|
|
|
};
|
|
|
|
|
2009-11-10 05:58:52 +00:00
|
|
|
|
|
|
|
/**
|
2010-06-11 08:23:18 +00:00
|
|
|
* Used for XUL checkbox element.
|
2009-11-10 05:58:52 +00:00
|
|
|
*/
|
2012-06-04 12:32:29 +00:00
|
|
|
class XULCheckboxAccessible : public LeafAccessible
|
2001-10-09 21:52:36 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-10-02 19:33:49 +00:00
|
|
|
enum { eAction_Click = 0 };
|
2012-05-27 09:01:40 +00:00
|
|
|
XULCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-11-04 03:37:46 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t NativeState() 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;
|
2001-10-09 21:52:36 +00:00
|
|
|
};
|
|
|
|
|
2010-06-11 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL dropmarker element.
|
|
|
|
*/
|
2012-06-04 12:32:29 +00:00
|
|
|
class XULDropmarkerAccessible : public LeafAccessible
|
2002-01-09 10:02:29 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-10-02 19:33:49 +00:00
|
|
|
enum { eAction_Click = 0 };
|
2012-05-27 09:01:40 +00:00
|
|
|
XULDropmarkerAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-11-04 03:37:46 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t NativeState() MOZ_OVERRIDE;
|
2008-11-04 03:37:46 +00:00
|
|
|
|
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
|
|
|
|
2002-01-09 10:02:29 +00:00
|
|
|
private:
|
2014-09-16 17:30:23 +00:00
|
|
|
bool DropmarkerOpen(bool aToggleOpen) const;
|
2002-01-09 10:02:29 +00:00
|
|
|
};
|
|
|
|
|
2010-06-11 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL groupbox element.
|
|
|
|
*/
|
2014-08-05 17:33:55 +00:00
|
|
|
class XULGroupboxAccessible MOZ_FINAL : public AccessibleWrap
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 02:05:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 09:01:40 +00:00
|
|
|
XULGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-10-10 12:26:55 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
2013-10-19 18:19:50 +00:00
|
|
|
virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
|
2012-10-14 04:18:39 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Accessible
|
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 02:05:26 +00:00
|
|
|
};
|
|
|
|
|
2010-01-06 10:36:50 +00:00
|
|
|
/**
|
2010-06-11 08:23:18 +00:00
|
|
|
* Used for XUL radio element (radio button).
|
2010-01-06 10:36:50 +00:00
|
|
|
*/
|
2012-04-12 11:11:40 +00:00
|
|
|
class XULRadioButtonAccessible : public RadioButtonAccessible
|
2001-12-11 20:49:49 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2012-05-27 09:01:40 +00:00
|
|
|
XULRadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-11-04 03:37:46 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual uint64_t NativeState() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
|
2011-09-28 01:46:11 +00:00
|
|
|
|
|
|
|
// Widgets
|
2012-05-29 01:18:45 +00:00
|
|
|
virtual Accessible* ContainerWidget() const;
|
2001-12-11 20:49:49 +00:00
|
|
|
};
|
|
|
|
|
2010-06-11 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL radiogroup element.
|
|
|
|
*/
|
2012-04-12 11:11:40 +00:00
|
|
|
class XULRadioGroupAccessible : public XULSelectControlAccessible
|
2001-12-11 20:49:49 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 09:01:40 +00:00
|
|
|
XULRadioGroupAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-11-04 03:37:46 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
|
2011-09-28 01:46:11 +00:00
|
|
|
|
|
|
|
// Widgets
|
|
|
|
virtual bool IsWidget() const;
|
|
|
|
virtual bool IsActiveWidget() const;
|
|
|
|
virtual bool AreItemsOperable() const;
|
2001-12-11 20:49:49 +00:00
|
|
|
};
|
|
|
|
|
2010-06-11 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL statusbar element.
|
|
|
|
*/
|
2012-05-29 01:18:45 +00:00
|
|
|
class XULStatusBarAccessible : public AccessibleWrap
|
2002-01-09 10:02:29 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 09:01:40 +00:00
|
|
|
XULStatusBarAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-03-07 15:38:58 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
2002-01-09 10:02:29 +00:00
|
|
|
};
|
|
|
|
|
2010-06-11 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL toolbarbutton element.
|
|
|
|
*/
|
2012-04-12 11:11:40 +00:00
|
|
|
class XULToolbarButtonAccessible : public XULButtonAccessible
|
2007-07-11 07:58:50 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 09:01:40 +00:00
|
|
|
XULToolbarButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2010-01-06 10:36:50 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
|
|
|
|
int32_t *aSetSize);
|
2010-01-06 10:36:50 +00:00
|
|
|
|
2010-01-11 14:14:06 +00:00
|
|
|
// nsXULToolbarButtonAccessible
|
2012-05-29 01:18:45 +00:00
|
|
|
static bool IsSeparator(Accessible* aAccessible);
|
2007-07-11 07:58:50 +00:00
|
|
|
};
|
|
|
|
|
2010-06-11 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL toolbar element.
|
|
|
|
*/
|
2012-05-29 01:18:45 +00:00
|
|
|
class XULToolbarAccessible : public AccessibleWrap
|
2002-11-06 01:29:58 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 09:01:40 +00:00
|
|
|
XULToolbarAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-03-07 15:38:58 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
2012-10-14 04:18:39 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Accessible
|
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
|
2002-11-06 01:29:58 +00:00
|
|
|
};
|
|
|
|
|
2010-06-11 08:23:18 +00:00
|
|
|
/**
|
|
|
|
* Used for XUL toolbarseparator element.
|
|
|
|
*/
|
2012-06-04 12:32:29 +00:00
|
|
|
class XULToolbarSeparatorAccessible : public LeafAccessible
|
2002-11-06 01:29:58 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-04-12 11:11:40 +00:00
|
|
|
XULToolbarSeparatorAccessible(nsIContent* aContent,
|
2012-05-27 09:01:40 +00:00
|
|
|
DocAccessible* aDoc);
|
2008-11-04 03:37:46 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2014-09-16 17:30:23 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t NativeState() MOZ_OVERRIDE;
|
2002-11-06 01:29:58 +00:00
|
|
|
};
|
|
|
|
|
2012-04-12 11:11:40 +00:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
2004-06-02 04:06:28 +00:00
|
|
|
|
2001-01-01 00:12:15 +00:00
|
|
|
#endif
|
2001-11-07 00:12:16 +00:00
|
|
|
|