2001-09-25 00:48:50 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 21:52:36 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2001-03-04 02:31:28 +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-03-04 02:31:28 +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-03-04 02:31:28 +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-03-04 02:31:28 +00:00
|
|
|
*
|
2001-09-25 00:48:50 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* 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-03-04 02:31:28 +00:00
|
|
|
|
|
|
|
#ifndef _nsRootAccessible_H_
|
|
|
|
#define _nsRootAccessible_H_
|
|
|
|
|
2008-06-16 06:16:18 +00:00
|
|
|
#include "nsCaretAccessible.h"
|
2003-04-01 20:02:51 +00:00
|
|
|
#include "nsDocAccessibleWrap.h"
|
2008-06-16 06:16:18 +00:00
|
|
|
|
2001-06-30 00:25:09 +00:00
|
|
|
#include "nsIAccessibleDocument.h"
|
2008-09-05 11:30:19 +00:00
|
|
|
#ifdef MOZ_XUL
|
2008-06-16 06:16:18 +00:00
|
|
|
#include "nsIAccessibleTreeCache.h"
|
2008-09-05 11:30:19 +00:00
|
|
|
#endif
|
2008-06-16 06:16:18 +00:00
|
|
|
|
|
|
|
#include "nsHashtable.h"
|
2007-06-14 17:12:50 +00:00
|
|
|
#include "nsCaretAccessible.h"
|
2003-04-28 10:24:52 +00:00
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsIDOMFocusListener.h"
|
2001-05-11 21:11:38 +00:00
|
|
|
#include "nsIDOMFormListener.h"
|
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
|
|
|
#include "nsIDOMXULListener.h"
|
2005-06-01 14:14:29 +00:00
|
|
|
#include "nsITimer.h"
|
2001-09-25 08:34:42 +00:00
|
|
|
|
2006-07-13 05:42:32 +00:00
|
|
|
#define NS_ROOTACCESSIBLE_IMPL_CID \
|
|
|
|
{ /* 7565f0d1-1465-4b71-906c-a623ac279f5d */ \
|
|
|
|
0x7565f0d1, \
|
|
|
|
0x1465, \
|
|
|
|
0x4b71, \
|
|
|
|
{ 0x90, 0x6c, 0xa6, 0x23, 0xac, 0x27, 0x9f, 0x5d } \
|
|
|
|
}
|
|
|
|
|
2002-05-08 20:21:03 +00:00
|
|
|
const PRInt32 SCROLL_HASH_START_SIZE = 6;
|
2001-04-17 23:06:38 +00:00
|
|
|
|
2003-04-01 20:02:51 +00:00
|
|
|
class nsRootAccessible : public nsDocAccessibleWrap,
|
2006-04-07 13:51:04 +00:00
|
|
|
public nsIDOMEventListener
|
2001-03-04 02:31:28 +00:00
|
|
|
{
|
2001-04-17 23:06:38 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
public:
|
2003-04-01 20:02:51 +00:00
|
|
|
nsRootAccessible(nsIDOMNode *aDOMNode, nsIWeakReference* aShell);
|
2001-04-17 23:06:38 +00:00
|
|
|
virtual ~nsRootAccessible();
|
2001-03-04 02:31:28 +00:00
|
|
|
|
2007-06-02 03:01:38 +00:00
|
|
|
// nsIAccessible
|
2005-02-01 08:50:50 +00:00
|
|
|
NS_IMETHOD GetName(nsAString& aName);
|
2003-07-31 08:09:39 +00:00
|
|
|
NS_IMETHOD GetParent(nsIAccessible * *aParent);
|
2009-02-10 10:03:30 +00:00
|
|
|
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
|
|
|
|
nsIAccessibleRelation **aRelation);
|
2001-03-04 02:31:28 +00:00
|
|
|
|
2007-01-10 20:25:20 +00:00
|
|
|
// ----- nsPIAccessibleDocument -----------------------
|
|
|
|
NS_IMETHOD FireDocLoadEvents(PRUint32 aEventType);
|
|
|
|
|
2001-05-11 21:11:38 +00:00
|
|
|
// ----- nsIDOMEventListener --------------------------
|
2001-09-25 08:34:42 +00:00
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
|
2001-05-17 21:28:37 +00:00
|
|
|
|
2008-11-01 03:58:07 +00:00
|
|
|
// nsAccessNode
|
|
|
|
virtual nsresult Init();
|
|
|
|
virtual nsresult Shutdown();
|
2003-04-01 20:02:51 +00:00
|
|
|
|
2008-11-04 03:37:46 +00:00
|
|
|
// nsAccessible
|
2009-03-07 15:38:58 +00:00
|
|
|
virtual nsresult GetRoleInternal(PRUint32 *aRole);
|
2008-11-04 03:37:46 +00:00
|
|
|
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
|
|
|
|
|
2003-04-15 08:45:55 +00:00
|
|
|
void ShutdownAll();
|
2006-07-13 05:42:32 +00:00
|
|
|
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ROOTACCESSIBLE_IMPL_CID)
|
2003-04-15 08:45:55 +00:00
|
|
|
|
2007-04-09 13:40:25 +00:00
|
|
|
/**
|
|
|
|
* Fire an accessible focus event for the current focusAccssible
|
|
|
|
* and attach a new selection listener, if necessary.
|
|
|
|
* @param aFocusAccessible The accessible which has received focus.
|
|
|
|
* @param aFocusNode The DOM Node which has received focus.
|
|
|
|
* @param aFocusEvent DOM focus event that caused the node/accessible to receive focus
|
|
|
|
* @param aForceEvent Fire a focus event even if the last focused item was the same
|
|
|
|
* @return Boolean -- was a focus event actually fired
|
|
|
|
*/
|
|
|
|
PRBool FireAccessibleFocusEvent(nsIAccessible *aFocusAccessible,
|
|
|
|
nsIDOMNode *aFocusNode,
|
|
|
|
nsIDOMEvent *aFocusEvent,
|
2007-08-11 01:44:44 +00:00
|
|
|
PRBool aForceEvent = PR_FALSE,
|
|
|
|
PRBool aIsAsynch = PR_FALSE);
|
2008-07-03 07:10:16 +00:00
|
|
|
/**
|
|
|
|
* Fire an accessible focus event for the current focused node,
|
|
|
|
* if there is a focus.
|
|
|
|
*/
|
|
|
|
void FireCurrentFocusEvent();
|
2007-03-10 23:11:04 +00:00
|
|
|
|
2007-06-14 19:19:19 +00:00
|
|
|
nsCaretAccessible *GetCaretAccessible();
|
2007-06-14 17:12:50 +00:00
|
|
|
|
2005-06-01 14:14:29 +00:00
|
|
|
private:
|
|
|
|
nsCOMPtr<nsITimer> mFireFocusTimer;
|
|
|
|
static void FireFocusCallback(nsITimer *aTimer, void *aClosure);
|
|
|
|
|
2001-06-30 00:25:09 +00:00
|
|
|
protected:
|
2003-07-22 14:55:22 +00:00
|
|
|
nsresult AddEventListeners();
|
|
|
|
nsresult RemoveEventListeners();
|
2007-05-29 06:53:50 +00:00
|
|
|
nsresult HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|
|
|
nsIDOMNode* aTargetNode);
|
2003-04-28 10:24:52 +00:00
|
|
|
static void GetTargetNode(nsIDOMEvent *aEvent, nsIDOMNode **aTargetNode);
|
2006-04-24 20:19:44 +00:00
|
|
|
void TryFireEarlyLoadEvent(nsIDOMNode *aDocNode);
|
2003-06-26 08:49:18 +00:00
|
|
|
void GetChromeEventHandler(nsIDOMEventTarget **aChromeTarget);
|
2008-02-08 12:55:57 +00:00
|
|
|
|
|
|
|
/**
|
2008-12-03 09:04:02 +00:00
|
|
|
* Used in HandleEventWithTarget().
|
2008-02-08 12:55:57 +00:00
|
|
|
*/
|
2008-12-03 09:04:02 +00:00
|
|
|
nsresult HandlePopupShownEvent(nsIAccessible *aAccessible);
|
|
|
|
nsresult HandlePopupHidingEvent(nsIDOMNode *aNode,
|
|
|
|
nsIAccessible *aAccessible);
|
|
|
|
|
2008-09-05 11:30:19 +00:00
|
|
|
#ifdef MOZ_XUL
|
2008-02-08 12:55:57 +00:00
|
|
|
nsresult HandleTreeRowCountChangedEvent(nsIDOMEvent *aEvent,
|
2008-06-16 06:16:18 +00:00
|
|
|
nsIAccessibleTreeCache *aAccessible);
|
2008-02-08 12:55:57 +00:00
|
|
|
nsresult HandleTreeInvalidatedEvent(nsIDOMEvent *aEvent,
|
2008-06-16 06:16:18 +00:00
|
|
|
nsIAccessibleTreeCache *aAccessible);
|
2008-02-08 12:55:57 +00:00
|
|
|
|
2007-01-28 03:58:18 +00:00
|
|
|
PRUint32 GetChromeFlags();
|
|
|
|
#endif
|
2006-07-17 14:10:24 +00:00
|
|
|
already_AddRefed<nsIDocShellTreeItem>
|
|
|
|
GetContentDocShell(nsIDocShellTreeItem *aStart);
|
2007-06-14 17:12:50 +00:00
|
|
|
nsRefPtr<nsCaretAccessible> mCaretAccessible;
|
2007-11-09 18:44:18 +00:00
|
|
|
nsCOMPtr<nsIDOMNode> mCurrentARIAMenubar;
|
2001-03-04 02:31:28 +00:00
|
|
|
};
|
|
|
|
|
2006-07-13 05:42:32 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsRootAccessible, NS_ROOTACCESSIBLE_IMPL_CID)
|
|
|
|
|
2001-03-04 02:31:28 +00:00
|
|
|
#endif
|