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