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
|
|
|
|
|
|
|
#ifndef _nsBaseWidgetAccessible_H_
|
|
|
|
#define _nsBaseWidgetAccessible_H_
|
|
|
|
|
2003-04-01 20:02:51 +00:00
|
|
|
#include "nsAccessibleWrap.h"
|
2007-05-01 17:08:26 +00:00
|
|
|
#include "nsHyperTextAccessibleWrap.h"
|
2001-10-09 21:52:36 +00:00
|
|
|
#include "nsIContent.h"
|
2003-04-15 08:45:55 +00:00
|
|
|
|
2001-10-09 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* This file contains a number of classes that are used as base
|
|
|
|
* classes for the different accessibility implementations of
|
|
|
|
* the HTML and XUL widget sets. --jgaunt
|
|
|
|
*/
|
2006-10-30 03:05:43 +00:00
|
|
|
|
2001-10-09 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* Leaf version of DOM Accessible -- has no children
|
|
|
|
*/
|
2003-04-01 20:02:51 +00:00
|
|
|
class nsLeafAccessible : public nsAccessibleWrap
|
2001-10-09 21:52:36 +00:00
|
|
|
{
|
2001-11-07 00:12:16 +00:00
|
|
|
public:
|
2010-08-19 02:14:50 +00:00
|
|
|
|
2012-02-07 22:38:54 +00:00
|
|
|
nsLeafAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
2009-05-11 10:57:28 +00:00
|
|
|
|
|
|
|
// nsISupports
|
2003-04-01 20:02:51 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-05-11 10:57:28 +00:00
|
|
|
|
|
|
|
// nsAccessible
|
2011-06-13 22:20:54 +00:00
|
|
|
virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
|
|
|
EWhichChildAtPoint aWhichChild);
|
2009-10-28 10:42:36 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// nsAccessible
|
|
|
|
virtual void CacheChildren();
|
2001-10-09 21:52:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2009-10-27 00:58:36 +00:00
|
|
|
* Used for text or image accessible nodes contained by link accessibles or
|
|
|
|
* accessibles for nodes with registered click event handler. It knows how to
|
|
|
|
* report the state of the host link (traveled or not) and can activate (click)
|
|
|
|
* the host accessible programmatically.
|
|
|
|
*/
|
|
|
|
class nsLinkableAccessible : public nsAccessibleWrap
|
2001-10-09 21:52:36 +00:00
|
|
|
{
|
2001-11-07 00:12:16 +00:00
|
|
|
public:
|
2006-07-31 04:31:13 +00:00
|
|
|
enum { eAction_Jump = 0 };
|
|
|
|
|
2012-02-07 22:38:54 +00:00
|
|
|
nsLinkableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
2008-03-18 11:37:12 +00:00
|
|
|
|
2003-04-01 20:02:51 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2008-03-18 11:37:12 +00:00
|
|
|
|
|
|
|
// nsIAccessible
|
2007-02-25 03:43:20 +00:00
|
|
|
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
2003-07-31 08:09:39 +00:00
|
|
|
NS_IMETHOD DoAction(PRUint8 index);
|
|
|
|
NS_IMETHOD TakeFocus();
|
2008-03-18 11:37:12 +00:00
|
|
|
|
2008-11-01 03:58:07 +00:00
|
|
|
// nsAccessNode
|
2010-06-12 04:04:35 +00:00
|
|
|
virtual void Shutdown();
|
2001-10-09 21:52:36 +00:00
|
|
|
|
2008-11-04 03:37:46 +00:00
|
|
|
// nsAccessible
|
2012-04-09 09:48:41 +00:00
|
|
|
virtual void Value(nsString& aValue);
|
2012-05-17 09:37:37 +00:00
|
|
|
virtual PRUint64 NativeLinkState() const;
|
2008-11-04 03:37:46 +00:00
|
|
|
|
2011-07-19 08:30:24 +00:00
|
|
|
// ActionAccessible
|
2011-06-05 19:35:43 +00:00
|
|
|
virtual PRUint8 ActionCount();
|
2011-07-19 08:30:24 +00:00
|
|
|
virtual KeyBinding AccessKey() const;
|
|
|
|
|
2010-09-01 03:26:13 +00:00
|
|
|
// HyperLinkAccessible
|
2011-06-14 03:56:42 +00:00
|
|
|
virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
|
2010-09-01 03:26:13 +00:00
|
|
|
|
2001-11-07 00:12:16 +00:00
|
|
|
protected:
|
2010-11-12 19:01:04 +00:00
|
|
|
// nsAccessible
|
|
|
|
virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent);
|
2012-03-23 12:21:31 +00:00
|
|
|
virtual void UnbindFromParent();
|
2010-11-12 19:01:04 +00:00
|
|
|
|
2008-03-18 11:37:12 +00:00
|
|
|
/**
|
2011-05-21 07:00:07 +00:00
|
|
|
* Parent accessible that provides an action for this linkable accessible.
|
2008-03-18 11:37:12 +00:00
|
|
|
*/
|
2011-05-21 07:00:07 +00:00
|
|
|
nsAccessible* mActionAcc;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIsLink;
|
|
|
|
bool mIsOnclick;
|
2001-10-09 21:52:36 +00:00
|
|
|
};
|
|
|
|
|
2005-09-30 02:16:13 +00:00
|
|
|
/**
|
|
|
|
* A simple accessible that gets its enumerated role passed into constructor.
|
|
|
|
*/
|
|
|
|
class nsEnumRoleAccessible : public nsAccessibleWrap
|
|
|
|
{
|
|
|
|
public:
|
2012-02-07 22:38:54 +00:00
|
|
|
nsEnumRoleAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
|
2012-01-12 03:07:35 +00:00
|
|
|
mozilla::a11y::role aRole);
|
2005-09-30 02:16:13 +00:00
|
|
|
virtual ~nsEnumRoleAccessible() { }
|
2009-03-07 15:38:58 +00:00
|
|
|
|
2005-09-30 02:16:13 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-03-07 15:38:58 +00:00
|
|
|
|
|
|
|
// nsAccessible
|
2012-01-12 03:07:35 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2005-09-30 02:16:13 +00:00
|
|
|
|
|
|
|
protected:
|
2012-01-12 03:07:35 +00:00
|
|
|
mozilla::a11y::role mRole;
|
2005-09-30 02:16:13 +00:00
|
|
|
};
|
|
|
|
|
2001-10-09 21:52:36 +00:00
|
|
|
#endif
|