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-06-10 16:44:50 -07:00
|
|
|
#ifndef mozilla_a11y_XULMenuAccessible_h__
|
|
|
|
#define mozilla_a11y_XULMenuAccessible_h__
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
#include "AccessibleWrap.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIDOMXULSelectCntrlEl.h"
|
2000-12-31 16:12:15 -08:00
|
|
|
#include "XULSelectControlAccessible.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
/**
|
|
|
|
* Used for XUL menu, menuitem elements.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2012-06-10 16:44:50 -07:00
|
|
|
class XULMenuitemAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum { eAction_Click = 0 };
|
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
XULMenuitemAccessible(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 void Description(nsString& aDescription) override;
|
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
|
|
|
virtual uint64_t NativeInteractiveState() const override;
|
|
|
|
virtual int32_t GetLevelInternal() override;
|
2008-10-10 05:26:55 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool CanHaveAnonChildren() override;
|
2011-07-19 01:30:24 -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;
|
|
|
|
virtual KeyBinding AccessKey() const override;
|
|
|
|
virtual KeyBinding KeyboardShortcut() const override;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
|
|
|
// Widgets
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsActiveWidget() const override;
|
|
|
|
virtual bool AreItemsOperable() const override;
|
|
|
|
virtual Accessible* ContainerWidget() const 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 menuseparator element.
|
|
|
|
*/
|
2012-06-10 16:44:50 -07:00
|
|
|
class XULMenuSeparatorAccessible : public XULMenuitemAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-10 16:44:50 -07:00
|
|
|
XULMenuSeparatorAccessible(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 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;
|
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
|
|
|
};
|
|
|
|
|
2009-11-09 21:58:52 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for XUL menupopup and panel.
|
|
|
|
*/
|
2012-06-10 16:44:50 -07:00
|
|
|
class XULMenupopupAccessible : public XULSelectControlAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-10 16:44:50 -07:00
|
|
|
XULMenupopupAccessible(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 a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() 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;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual Accessible* ContainerWidget() const 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 menubar element.
|
|
|
|
*/
|
2012-06-10 16:44:50 -07:00
|
|
|
class XULMenubarAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-10 16:44:50 -07:00
|
|
|
XULMenubarAccessible(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 a11y::role NativeRole() override;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
|
|
|
// Widget
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsActiveWidget() const override;
|
|
|
|
virtual bool AreItemsOperable() const override;
|
|
|
|
virtual Accessible* CurrentItem() override;
|
|
|
|
virtual void SetCurrentItem(Accessible* aItem) 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
|
|
|
};
|
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2000-12-31 16:12:15 -08:00
|
|
|
#endif
|