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
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2011-06-05 12:35:43 -07:00
|
|
|
// ActionAccessible
|
2015-03-21 09:28:04 -07: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 12:35:43 -07:00
|
|
|
|
2011-09-27 18:46:11 -07:00
|
|
|
// Widgets
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsWidget() const override;
|
|
|
|
virtual bool IsActiveWidget() const override;
|
|
|
|
virtual bool AreItemsOperable() const override;
|
|
|
|
virtual Accessible* ContainerWidget() const override;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsAcceptableChild(Accessible* aPossibleChild) const 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
|
2014-09-16 10:30:23 -07:00
|
|
|
bool ContainsMenu() const;
|
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
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2011-06-05 12:35:43 -07:00
|
|
|
|
|
|
|
// ActionAccessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual uint8_t ActionCount() override;
|
|
|
|
virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
|
|
|
|
virtual bool DoAction(uint8_t aIndex) override;
|
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
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2011-06-05 12:35:43 -07:00
|
|
|
// ActionAccessible
|
2015-03-21 09:28:04 -07: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 12:35:43 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
2014-09-16 10:30:23 -07:00
|
|
|
bool DropmarkerOpen(bool aToggleOpen) const;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL groupbox element.
|
|
|
|
*/
|
2015-03-21 09:28:04 -07:00
|
|
|
class XULGroupboxAccessible final : 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
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
|
|
|
virtual Relation RelationByType(RelationType aType) override;
|
2012-10-13 21:18:39 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) 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
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual uint64_t NativeState() override;
|
|
|
|
virtual uint64_t NativeInteractiveState() const override;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
|
|
|
// Widgets
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual Accessible* ContainerWidget() const override;
|
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
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeInteractiveState() const override;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
|
|
|
// Widgets
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsWidget() const override;
|
|
|
|
virtual bool IsActiveWidget() const override;
|
|
|
|
virtual bool AreItemsOperable() const override;
|
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
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
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
|
2015-01-15 12:39:04 -08:00
|
|
|
virtual void GetPositionAndSizeInternal(int32_t* aPosInSet,
|
2015-03-21 09:28:04 -07:00
|
|
|
int32_t* aSetSize) override;
|
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
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
2012-10-13 21:18:39 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) 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
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
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
|
|
|
|