2007-11-12 01:05:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2001-09-25 00:48:50 +00:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 21:52:36 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2001-02-14 20:51:33 +00:00
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
2001-02-14 20:51:33 +00:00
|
|
|
*
|
2001-09-25 00:48:50 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
2001-02-14 20:51:33 +00:00
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-25 00:48:50 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2001-02-14 20:51:33 +00:00
|
|
|
*
|
2001-09-25 00:48:50 +00:00
|
|
|
* Contributor(s):
|
2004-04-17 21:52:36 +00:00
|
|
|
* John Gaunt (jgaunt@netscape.com)
|
2001-09-25 00:48:50 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-17 21:52:36 +00:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-25 00:48:50 +00:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-17 21:52:36 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-25 00:48:50 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-17 21:52:36 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
2001-09-25 00:48:50 +00:00
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2001-02-14 20:51:33 +00:00
|
|
|
|
|
|
|
#ifndef _nsAccessible_H_
|
|
|
|
#define _nsAccessible_H_
|
|
|
|
|
2003-04-01 20:02:51 +00:00
|
|
|
#include "nsAccessNodeWrap.h"
|
2007-05-20 02:41:33 +00:00
|
|
|
|
2009-02-19 07:06:14 +00:00
|
|
|
#include "nsARIAMap.h"
|
|
|
|
#include "nsRelUtils.h"
|
|
|
|
#include "nsTextEquivUtils.h"
|
|
|
|
|
2001-10-09 21:52:36 +00:00
|
|
|
#include "nsIAccessible.h"
|
2006-06-21 13:29:10 +00:00
|
|
|
#include "nsIAccessibleHyperLink.h"
|
2005-07-14 14:20:21 +00:00
|
|
|
#include "nsIAccessibleSelectable.h"
|
2006-06-15 16:55:32 +00:00
|
|
|
#include "nsIAccessibleValue.h"
|
2007-05-20 02:41:33 +00:00
|
|
|
#include "nsIAccessibleRole.h"
|
|
|
|
#include "nsIAccessibleStates.h"
|
2007-06-02 03:01:38 +00:00
|
|
|
#include "nsIAccessibleEvent.h"
|
2007-05-20 02:41:33 +00:00
|
|
|
|
2001-10-26 23:47:52 +00:00
|
|
|
#include "nsIDOMNodeList.h"
|
2005-06-24 16:29:15 +00:00
|
|
|
#include "nsINameSpaceManager.h"
|
|
|
|
#include "nsWeakReference.h"
|
2003-04-15 08:45:55 +00:00
|
|
|
#include "nsString.h"
|
2009-01-18 20:14:14 +00:00
|
|
|
#include "nsTArray.h"
|
2007-03-08 15:25:35 +00:00
|
|
|
#include "nsIDOMDOMStringList.h"
|
2001-02-14 20:51:33 +00:00
|
|
|
|
2003-04-15 08:45:55 +00:00
|
|
|
struct nsRect;
|
2001-10-09 21:52:36 +00:00
|
|
|
class nsIContent;
|
|
|
|
class nsIFrame;
|
2003-04-15 08:45:55 +00:00
|
|
|
class nsIPresShell;
|
|
|
|
class nsIDOMNode;
|
|
|
|
class nsIAtom;
|
2007-03-19 06:45:35 +00:00
|
|
|
class nsIView;
|
2001-02-14 20:51:33 +00:00
|
|
|
|
2008-12-16 16:13:49 +00:00
|
|
|
// see nsAccessible::GetAttrValue
|
2007-08-04 05:27:27 +00:00
|
|
|
#define NS_OK_NO_ARIA_VALUE \
|
|
|
|
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x21)
|
|
|
|
|
2008-12-16 16:13:49 +00:00
|
|
|
// see nsAccessible::GetNameInternal
|
|
|
|
#define NS_OK_EMPTY_NAME \
|
|
|
|
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x23)
|
|
|
|
|
2009-02-27 10:54:39 +00:00
|
|
|
// see nsAccessible::GetNameInternal
|
|
|
|
#define NS_OK_NAME_FROM_TOOLTIP \
|
|
|
|
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x25)
|
|
|
|
|
2006-05-18 17:47:32 +00:00
|
|
|
// Saves a data member -- if child count equals this value we haven't
|
|
|
|
// cached children or child count yet
|
2006-05-29 05:43:12 +00:00
|
|
|
enum { eChildCountUninitialized = -1 };
|
2006-05-18 17:47:32 +00:00
|
|
|
|
2007-03-08 15:53:55 +00:00
|
|
|
class nsAccessibleDOMStringList : public nsIDOMDOMStringList
|
2007-03-08 15:25:35 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-03-08 15:53:55 +00:00
|
|
|
nsAccessibleDOMStringList();
|
|
|
|
virtual ~nsAccessibleDOMStringList();
|
2007-03-08 15:25:35 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMDOMSTRINGLIST
|
|
|
|
|
|
|
|
PRBool Add(const nsAString& aName) {
|
2009-01-18 20:14:14 +00:00
|
|
|
return mNames.AppendElement(aName) != nsnull;
|
2007-03-08 15:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2009-01-18 20:14:14 +00:00
|
|
|
nsTArray<nsString> mNames;
|
2007-03-08 15:25:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-10-10 12:26:55 +00:00
|
|
|
#define NS_ACCESSIBLE_IMPL_CID \
|
2009-06-18 07:37:38 +00:00
|
|
|
{ /* 53cfa871-be42-47fc-b416-0033653b3151 */ \
|
|
|
|
0x53cfa871, \
|
|
|
|
0xbe42, \
|
|
|
|
0x47fc, \
|
|
|
|
{ 0xb4, 0x16, 0x00, 0x33, 0x65, 0x3b, 0x31, 0x51 } \
|
2008-10-10 12:26:55 +00:00
|
|
|
}
|
|
|
|
|
2003-07-09 07:01:46 +00:00
|
|
|
class nsAccessible : public nsAccessNodeWrap,
|
|
|
|
public nsIAccessible,
|
2006-06-21 13:29:10 +00:00
|
|
|
public nsIAccessibleHyperLink,
|
2006-06-15 16:55:32 +00:00
|
|
|
public nsIAccessibleSelectable,
|
|
|
|
public nsIAccessibleValue
|
2001-02-14 20:51:33 +00:00
|
|
|
{
|
2001-06-30 00:25:09 +00:00
|
|
|
public:
|
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
|
|
|
nsAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
|
|
|
|
virtual ~nsAccessible();
|
|
|
|
|
2003-04-01 20:02:51 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2008-08-06 12:19:56 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsAccessible, nsAccessNode)
|
|
|
|
|
2003-04-01 20:02:51 +00:00
|
|
|
NS_DECL_NSIACCESSIBLE
|
2006-06-21 13:29:10 +00:00
|
|
|
NS_DECL_NSIACCESSIBLEHYPERLINK
|
2005-07-14 14:20:21 +00:00
|
|
|
NS_DECL_NSIACCESSIBLESELECTABLE
|
2006-06-15 16:55:32 +00:00
|
|
|
NS_DECL_NSIACCESSIBLEVALUE
|
2008-10-10 12:26:55 +00:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLE_IMPL_CID)
|
2003-04-01 20:02:51 +00:00
|
|
|
|
2008-11-01 03:58:07 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsAccessNode
|
|
|
|
|
|
|
|
virtual nsresult Shutdown();
|
2003-05-01 10:25:45 +00:00
|
|
|
|
2008-10-10 12:26:55 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Public methods
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the accessible name specified by ARIA.
|
|
|
|
*/
|
|
|
|
nsresult GetARIAName(nsAString& aName);
|
|
|
|
|
2009-06-18 07:37:38 +00:00
|
|
|
/**
|
|
|
|
* Maps ARIA state attributes to state of accessible. Note the given state
|
|
|
|
* argument should hold states for accessible before you pass it into this
|
|
|
|
* method.
|
|
|
|
*
|
|
|
|
* @param [in/out] where to fill the states into.
|
2009-06-25 02:12:38 +00:00
|
|
|
* @param [in/out] where to fill the extra states into
|
2009-06-18 07:37:38 +00:00
|
|
|
*/
|
2009-06-25 02:12:38 +00:00
|
|
|
virtual nsresult GetARIAState(PRUint32 *aState, PRUint32 *aExtraState);
|
2009-06-18 07:37:38 +00:00
|
|
|
|
2008-10-10 12:26:55 +00:00
|
|
|
/**
|
|
|
|
* Returns the accessible name provided by native markup. It doesn't take
|
2008-12-16 16:13:49 +00:00
|
|
|
* into account ARIA markup used to specify the name.
|
|
|
|
*
|
|
|
|
* @param aName [out] the accessible name
|
|
|
|
*
|
|
|
|
* @return NS_OK_EMPTY_NAME points empty name was specified by native markup
|
|
|
|
* explicitly (see nsIAccessible::name attribute for
|
|
|
|
* details)
|
2008-10-10 12:26:55 +00:00
|
|
|
*/
|
|
|
|
virtual nsresult GetNameInternal(nsAString& aName);
|
|
|
|
|
2009-03-07 15:38:58 +00:00
|
|
|
/**
|
|
|
|
* Returns enumerated accessible role from native markup (see constants in
|
|
|
|
* nsIAccessibleRole). Doesn't take into account ARIA roles.
|
|
|
|
*
|
|
|
|
* @param aRole [out] accessible role.
|
|
|
|
*/
|
|
|
|
virtual nsresult GetRoleInternal(PRUint32 *aRole);
|
|
|
|
|
2007-04-02 15:56:24 +00:00
|
|
|
/**
|
|
|
|
* Return the state of accessible that doesn't take into account ARIA states.
|
2008-11-04 03:37:46 +00:00
|
|
|
* Use nsIAccessible::state to get all states for accessible. If
|
2007-04-02 15:56:24 +00:00
|
|
|
* second argument is omitted then second bit field of accessible state won't
|
|
|
|
* be calculated.
|
|
|
|
*/
|
2008-11-04 03:37:46 +00:00
|
|
|
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
|
2007-04-02 15:56:24 +00:00
|
|
|
|
2007-04-07 09:07:24 +00:00
|
|
|
/**
|
|
|
|
* Returns attributes for accessible without explicitly setted ARIA
|
|
|
|
* attributes.
|
|
|
|
*/
|
|
|
|
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
|
|
|
|
2009-05-11 10:57:28 +00:00
|
|
|
/**
|
|
|
|
* Return direct or deepest child at the given point.
|
|
|
|
*
|
|
|
|
* @param aX [in] x coordinate relative screen
|
|
|
|
* @param aY [in] y coordinate relative screen
|
|
|
|
* @param aDeepestChild [in] flag points if deep child should be returned
|
|
|
|
* @param aChild [out] found child
|
|
|
|
*/
|
|
|
|
virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
|
|
|
|
PRBool aDeepestChild,
|
|
|
|
nsIAccessible **aChild);
|
|
|
|
|
2008-10-10 12:26:55 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-06-18 07:37:38 +00:00
|
|
|
// Initializing and cache methods
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set accessible parent.
|
|
|
|
*/
|
2009-09-19 06:30:07 +00:00
|
|
|
void SetParent(nsIAccessible *aParent);
|
2009-06-18 07:37:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set first accessible child.
|
|
|
|
*/
|
|
|
|
void SetFirstChild(nsIAccessible *aFirstChild);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set next sibling accessible.
|
|
|
|
*/
|
|
|
|
void SetNextSibling(nsIAccessible *aNextSibling);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the ARIA role map entry for a new accessible.
|
|
|
|
* For a newly created accessible, specify which role map entry should be used.
|
|
|
|
*
|
|
|
|
* @param aRoleMapEntry The ARIA nsRoleMapEntry* for the accessible, or
|
|
|
|
* nsnull if none.
|
|
|
|
*/
|
|
|
|
virtual void SetRoleMapEntry(nsRoleMapEntry *aRoleMapEntry);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the child count to -1 (unknown) and null out cached child pointers
|
|
|
|
*/
|
|
|
|
virtual void InvalidateChildren();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return parent accessible only if cached.
|
|
|
|
*/
|
|
|
|
already_AddRefed<nsIAccessible> GetCachedParent();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return first child accessible only if cached.
|
|
|
|
*/
|
|
|
|
already_AddRefed<nsIAccessible> GetCachedFirstChild();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Assert if child not in parent's cache.
|
|
|
|
*/
|
|
|
|
void TestChildCache(nsIAccessible *aCachedChild);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Miscellaneous methods.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fire accessible event.
|
|
|
|
*/
|
|
|
|
virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aAccEvent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if there are accessible children in anonymous content
|
|
|
|
*/
|
|
|
|
virtual PRBool GetAllowsAnonChildAccessibles();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns text of accessible if accessible has text role otherwise empty
|
|
|
|
* string.
|
|
|
|
*
|
|
|
|
* @param aText returned text of the accessible
|
|
|
|
* @param aStartOffset start offset inside of the accesible
|
|
|
|
* @param aLength required lenght of text
|
|
|
|
*/
|
|
|
|
virtual nsresult AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
|
|
|
|
PRUint32 aLength);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2008-10-10 12:26:55 +00:00
|
|
|
// Helper methods
|
2006-10-23 09:45:34 +00:00
|
|
|
|
|
|
|
already_AddRefed<nsIAccessible> GetParent() {
|
|
|
|
nsIAccessible *parent = nsnull;
|
|
|
|
GetParent(&parent);
|
|
|
|
return parent;
|
|
|
|
}
|
2007-11-12 01:05:37 +00:00
|
|
|
|
2001-02-14 20:51:33 +00:00
|
|
|
protected:
|
2001-03-28 00:49:05 +00:00
|
|
|
virtual nsIFrame* GetBoundsFrame();
|
2003-07-31 08:09:39 +00:00
|
|
|
virtual void GetBoundsRect(nsRect& aRect, nsIFrame** aRelativeFrame);
|
2007-01-28 03:58:18 +00:00
|
|
|
PRBool IsVisible(PRBool *aIsOffscreen);
|
2007-03-18 14:08:33 +00:00
|
|
|
|
2008-12-03 07:18:41 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name helpers.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Compute the name of HTML node.
|
|
|
|
*/
|
|
|
|
nsresult GetHTMLName(nsAString& aName);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Compute the name for XUL node.
|
|
|
|
*/
|
|
|
|
nsresult GetXULName(nsAString& aName);
|
|
|
|
|
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
|
|
|
// helper method to verify frames
|
2002-05-08 20:43:49 +00:00
|
|
|
static nsresult GetFullKeyName(const nsAString& aModifierName, const nsAString& aKeyName, nsAString& aStringOut);
|
2002-03-23 21:52:27 +00:00
|
|
|
static nsresult GetTranslatedString(const nsAString& aKey, nsAString& aStringOut);
|
2008-07-16 15:24:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Walk into subtree and calculate the string which is used as the accessible
|
|
|
|
* name or description.
|
|
|
|
*
|
|
|
|
* @param aContent [in] traversed content
|
|
|
|
* @param aFlatString [in, out] result string
|
|
|
|
* @param aIsRootHidden [in] specifies whether root content (we started to
|
|
|
|
* traverse from) is hidden, in this case the result
|
|
|
|
* string is calculated from hidden children
|
|
|
|
* (this is used when hidden root content is explicitly
|
|
|
|
* specified as label or description by author)
|
|
|
|
*/
|
|
|
|
nsresult AppendFlatStringFromSubtreeRecurse(nsIContent *aContent,
|
|
|
|
nsAString *aFlatString,
|
|
|
|
PRBool aIsRootHidden);
|
2006-06-21 13:29:10 +00:00
|
|
|
|
|
|
|
// Helpers for dealing with children
|
2006-07-26 19:38:25 +00:00
|
|
|
virtual void CacheChildren();
|
2006-10-23 09:45:34 +00:00
|
|
|
|
|
|
|
// nsCOMPtr<>& is useful here, because getter_AddRefs() nulls the comptr's value, and NextChild
|
|
|
|
// depends on the passed-in comptr being null or already set to a child (finding the next sibling).
|
2006-06-21 13:29:10 +00:00
|
|
|
nsIAccessible *NextChild(nsCOMPtr<nsIAccessible>& aAccessible);
|
2006-10-23 09:45:34 +00:00
|
|
|
|
2006-06-21 13:29:10 +00:00
|
|
|
already_AddRefed<nsIAccessible> GetNextWithState(nsIAccessible *aStart, PRUint32 matchState);
|
2001-09-25 22:32:32 +00:00
|
|
|
|
2007-03-06 13:44:42 +00:00
|
|
|
/**
|
2009-11-02 01:02:09 +00:00
|
|
|
* Return an accessible for the given DOM node, or if that node isn't
|
|
|
|
* accessible, return the accessible for the next DOM node which has one
|
|
|
|
* (based on forward depth first search).
|
|
|
|
*
|
|
|
|
* @param aStartNode [in] the DOM node to start from
|
|
|
|
* @return the resulting accessible
|
2007-03-06 13:44:42 +00:00
|
|
|
*/
|
2009-11-02 01:02:09 +00:00
|
|
|
already_AddRefed<nsIAccessible>
|
|
|
|
GetFirstAvailableAccessible(nsIDOMNode *aStartNode);
|
2007-03-06 13:44:42 +00:00
|
|
|
|
2006-06-21 13:29:10 +00:00
|
|
|
// Hyperlink helpers
|
|
|
|
virtual nsresult GetLinkOffset(PRInt32* aStartOffset, PRInt32* aEndOffset);
|
|
|
|
|
2009-08-20 06:45:19 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Action helpers
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used to describe click action target. See DoCommand() method.
|
|
|
|
*/
|
|
|
|
struct nsCommandClosure
|
|
|
|
{
|
|
|
|
nsCommandClosure(nsAccessible *aAccessible, nsIContent *aContent,
|
|
|
|
PRUint32 aActionIndex) :
|
|
|
|
accessible(aAccessible), content(aContent), actionIndex(aActionIndex) {}
|
|
|
|
|
|
|
|
nsRefPtr<nsAccessible> accessible;
|
|
|
|
nsCOMPtr<nsIContent> content;
|
|
|
|
PRUint32 actionIndex;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prepares click action that will be invoked in timeout.
|
|
|
|
*
|
|
|
|
* @note DoCommand() prepares an action in timeout because when action
|
|
|
|
* command opens a modal dialog/window, it won't return until the
|
|
|
|
* dialog/window is closed. If executing action command directly in
|
|
|
|
* nsIAccessible::DoAction() method, it will block AT tools (e.g. GOK) that
|
|
|
|
* invoke action of mozilla accessibles direclty (see bug 277888 for details).
|
|
|
|
*
|
|
|
|
* @param aContent [in, optional] element to click
|
|
|
|
* @param aActionIndex [in, optional] index of accessible action
|
|
|
|
*/
|
|
|
|
nsresult DoCommand(nsIContent *aContent = nsnull, PRUint32 aActionIndex = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatch click event to target by calling DispatchClickEvent() method.
|
|
|
|
*
|
|
|
|
* @param aTimer [in] timer object
|
|
|
|
* @param aClosure [in] nsCommandClosure object describing a target.
|
|
|
|
*/
|
2005-02-01 09:40:36 +00:00
|
|
|
static void DoCommandCallback(nsITimer *aTimer, void *aClosure);
|
2009-08-20 06:45:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatch click event.
|
|
|
|
*/
|
|
|
|
virtual void DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Helpers
|
2005-02-01 09:40:36 +00:00
|
|
|
|
2007-03-19 06:45:35 +00:00
|
|
|
// Check the visibility across both parent content and chrome
|
|
|
|
PRBool CheckVisibilityInParentChain(nsIDocument* aDocument, nsIView* aView);
|
|
|
|
|
2007-09-18 21:40:04 +00:00
|
|
|
/**
|
2007-12-12 02:10:26 +00:00
|
|
|
* Get the container node for an atomic region, defined by aria-atomic="true"
|
2007-09-18 21:40:04 +00:00
|
|
|
* @return the container node
|
|
|
|
*/
|
|
|
|
nsIDOMNode* GetAtomicRegion();
|
|
|
|
|
2007-08-04 05:27:27 +00:00
|
|
|
/**
|
2007-09-25 01:19:03 +00:00
|
|
|
* Get numeric value of the given ARIA attribute.
|
2007-08-04 05:27:27 +00:00
|
|
|
*
|
2007-09-25 01:19:03 +00:00
|
|
|
* @param aAriaProperty - the ARIA property we're using
|
2007-08-04 05:27:27 +00:00
|
|
|
* @param aValue - value of the attribute
|
|
|
|
*
|
|
|
|
* @return - NS_OK_NO_ARIA_VALUE if there is no setted ARIA attribute
|
|
|
|
*/
|
2007-12-12 02:10:26 +00:00
|
|
|
nsresult GetAttrValue(nsIAtom *aAriaProperty, double *aValue);
|
2007-08-04 05:27:27 +00:00
|
|
|
|
2008-10-08 12:54:58 +00:00
|
|
|
/**
|
|
|
|
* Return the action rule based on ARIA enum constants EActionRule
|
|
|
|
* (see nsARIAMap.h). Used by GetNumActions() and GetActionName().
|
|
|
|
*
|
|
|
|
* @param aStates [in] states of the accessible
|
|
|
|
*/
|
|
|
|
PRUint32 GetActionRule(PRUint32 aStates);
|
|
|
|
|
2009-01-05 07:41:30 +00:00
|
|
|
/**
|
|
|
|
* Compute group attributes ('posinset', 'setsize' and 'level') based
|
|
|
|
* on accessible hierarchy. Used by GetAttributes() method if group attributes
|
|
|
|
* weren't provided by ARIA or by internal accessible implementation.
|
|
|
|
*
|
|
|
|
* @param aRole [in] role of this accessible
|
|
|
|
* @param aAttributes [in, out] object attributes
|
|
|
|
*/
|
|
|
|
nsresult ComputeGroupAttributes(PRUint32 aRole,
|
|
|
|
nsIPersistentProperties *aAttributes);
|
|
|
|
|
2008-06-16 06:16:18 +00:00
|
|
|
/**
|
|
|
|
* Fires platform accessible event. It's notification method only. It does
|
|
|
|
* change nothing on Gecko side. Mostly you should use
|
|
|
|
* nsIAccessible::FireAccessibleEvent excepting special cases like we have
|
|
|
|
* in xul:tree accessible to lie to AT. Must be overridden in wrap classes.
|
|
|
|
*
|
|
|
|
* @param aEvent the accessible event to fire.
|
|
|
|
*/
|
|
|
|
virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent) = 0;
|
|
|
|
|
2001-05-11 21:11:38 +00:00
|
|
|
// Data Members
|
2003-06-24 08:41:28 +00:00
|
|
|
nsCOMPtr<nsIAccessible> mParent;
|
2008-08-06 12:19:56 +00:00
|
|
|
nsCOMPtr<nsIAccessible> mFirstChild;
|
|
|
|
nsCOMPtr<nsIAccessible> mNextSibling;
|
|
|
|
|
2005-01-28 02:35:26 +00:00
|
|
|
nsRoleMapEntry *mRoleMapEntry; // Non-null indicates author-supplied role; possibly state & value as well
|
2006-05-29 05:43:12 +00:00
|
|
|
PRInt32 mAccChildCount;
|
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
|
|
|
};
|
|
|
|
|
2008-10-10 12:26:55 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsAccessible,
|
|
|
|
NS_ACCESSIBLE_IMPL_CID)
|
2005-01-28 02:35:26 +00:00
|
|
|
|
2001-02-14 20:51:33 +00:00
|
|
|
#endif
|
2003-04-15 08:45:55 +00:00
|
|
|
|