2001-09-25 00:48:50 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
2001-03-04 02:31:28 +00:00
|
|
|
*
|
2001-09-25 00:48:50 +00:00
|
|
|
* The contents of this file are subject to the Netscape 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/NPL/
|
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.
|
|
|
|
*
|
2001-09-25 00:48:50 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* 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
|
|
|
|
* either 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"),
|
|
|
|
* 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
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* 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
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2001-03-04 02:31:28 +00:00
|
|
|
|
|
|
|
#ifndef _nsRootAccessible_H_
|
|
|
|
#define _nsRootAccessible_H_
|
|
|
|
|
|
|
|
#include "nsAccessible.h"
|
2001-04-17 23:06:38 +00:00
|
|
|
#include "nsIAccessibleEventReceiver.h"
|
|
|
|
#include "nsIAccessibleEventListener.h"
|
2001-06-30 00:25:09 +00:00
|
|
|
#include "nsIAccessibleDocument.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"
|
2001-04-17 23:06:38 +00:00
|
|
|
#include "nsIDOMFocusListener.h"
|
2001-05-11 21:11:38 +00:00
|
|
|
#include "nsIDocument.h"
|
2001-08-14 06:01:48 +00:00
|
|
|
#include "nsIAccessibilityService.h"
|
2001-09-25 08:34:42 +00:00
|
|
|
#include "nsIWebProgressListener.h"
|
|
|
|
#include "nsIWeakReference.h"
|
|
|
|
#include "nsITimer.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 "nsIWebProgress.h"
|
2002-05-08 20:21:03 +00:00
|
|
|
#include "nsIScrollPositionListener.h"
|
|
|
|
#include "nsIScrollableView.h"
|
|
|
|
#include "nsHashtable.h"
|
2001-09-25 08:34:42 +00:00
|
|
|
|
2002-05-08 20:21:03 +00:00
|
|
|
const PRInt32 SCROLL_HASH_START_SIZE = 6;
|
2001-04-17 23:06:38 +00:00
|
|
|
|
2001-06-30 00:25:09 +00:00
|
|
|
class nsDocAccessibleMixin
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsDocAccessibleMixin(nsIDocument *doc);
|
|
|
|
nsDocAccessibleMixin(nsIWeakReference *aShell);
|
|
|
|
virtual ~nsDocAccessibleMixin();
|
2001-10-26 23:47:52 +00:00
|
|
|
|
2001-06-30 00:25:09 +00:00
|
|
|
NS_DECL_NSIACCESSIBLEDOCUMENT
|
|
|
|
|
|
|
|
protected:
|
2001-10-26 23:47:52 +00:00
|
|
|
NS_IMETHOD GetDocShellFromPS(nsIPresShell* aPresShell, nsIDocShell** aDocShell);
|
2001-06-30 00:25:09 +00:00
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
|
|
|
};
|
|
|
|
|
2001-04-17 23:06:38 +00:00
|
|
|
class nsRootAccessible : public nsAccessible,
|
2001-06-30 00:25:09 +00:00
|
|
|
public nsDocAccessibleMixin,
|
|
|
|
public nsIAccessibleDocument,
|
2001-04-17 23:06:38 +00:00
|
|
|
public nsIAccessibleEventReceiver,
|
2001-05-11 21:11:38 +00:00
|
|
|
public nsIDOMFocusListener,
|
2001-09-25 08:34:42 +00:00
|
|
|
public nsIDOMFormListener,
|
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
|
|
|
public nsIDOMXULListener,
|
2001-09-25 08:34:42 +00:00
|
|
|
public nsIWebProgressListener,
|
2002-05-08 20:21:03 +00:00
|
|
|
public nsIScrollPositionListener,
|
2001-09-25 08:34:42 +00:00
|
|
|
public nsSupportsWeakReference
|
|
|
|
|
2001-03-04 02:31:28 +00:00
|
|
|
{
|
2001-04-17 23:06:38 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
public:
|
2001-09-25 08:34:42 +00:00
|
|
|
enum EBusyState {eBusyStateUninitialized, eBusyStateLoading, eBusyStateDone};
|
|
|
|
|
2001-05-11 21:11:38 +00:00
|
|
|
nsRootAccessible(nsIWeakReference* aShell);
|
2001-04-17 23:06:38 +00:00
|
|
|
virtual ~nsRootAccessible();
|
2001-03-04 02:31:28 +00:00
|
|
|
|
|
|
|
/* attribute wstring accName; */
|
2002-03-23 21:52:27 +00:00
|
|
|
NS_IMETHOD GetAccName(nsAString& aAccName);
|
|
|
|
NS_IMETHOD GetAccValue(nsAString& aAccValue);
|
2001-03-04 02:31:28 +00:00
|
|
|
NS_IMETHOD GetAccParent(nsIAccessible * *aAccParent);
|
2001-05-11 21:11:38 +00:00
|
|
|
NS_IMETHOD GetAccRole(PRUint32 *aAccRole);
|
2001-08-01 02:52:57 +00:00
|
|
|
NS_IMETHOD GetAccState(PRUint32 *aAccState);
|
2003-03-05 02:10:57 +00:00
|
|
|
NS_IMETHOD HandleEvent(PRUint32 aEvent, nsIAccessible *aTarget, void * aData);
|
2001-03-04 02:31:28 +00:00
|
|
|
|
2001-05-11 21:11:38 +00:00
|
|
|
// ----- nsIAccessibleEventReceiver -------------------
|
2001-04-17 23:06:38 +00:00
|
|
|
NS_IMETHOD AddAccessibleEventListener(nsIAccessibleEventListener *aListener);
|
2001-09-25 08:34:42 +00:00
|
|
|
NS_IMETHOD RemoveAccessibleEventListener();
|
2001-04-17 23:06:38 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
// ----- nsIDOMFocusListener --------------------------
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
NS_IMETHOD Focus(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Blur(nsIDOMEvent* aEvent);
|
2001-04-17 23:06:38 +00:00
|
|
|
|
2001-05-17 21:28:37 +00:00
|
|
|
// ----- nsIDOMFormListener ---------------------------
|
2001-05-11 21:11:38 +00:00
|
|
|
NS_IMETHOD Submit(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Reset(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Change(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Select(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Input(nsIDOMEvent* aEvent);
|
|
|
|
|
2002-08-17 01:46:58 +00:00
|
|
|
// ----- nsIDOMXULListener ---------------------------
|
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
|
|
|
NS_IMETHOD PopupShowing(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Close(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Command(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent);
|
|
|
|
|
2002-05-08 20:21:03 +00:00
|
|
|
// ----- nsIScrollPositionListener ---------------------------
|
|
|
|
NS_IMETHOD ScrollPositionWillChange(nsIScrollableView *aView, nscoord aX, nscoord aY);
|
|
|
|
NS_IMETHOD ScrollPositionDidChange(nsIScrollableView *aView, nscoord aX, nscoord aY);
|
|
|
|
|
2001-06-30 00:25:09 +00:00
|
|
|
NS_DECL_NSIACCESSIBLEDOCUMENT
|
2001-09-25 08:34:42 +00:00
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
2001-06-30 00:25:09 +00:00
|
|
|
|
|
|
|
protected:
|
2001-08-14 06:01:48 +00:00
|
|
|
NS_IMETHOD GetTargetNode(nsIDOMEvent *aEvent, nsCOMPtr<nsIDOMNode>& aTargetNode);
|
2001-06-30 00:25:09 +00:00
|
|
|
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
|
|
|
|
virtual nsIFrame* GetFrame();
|
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
|
|
|
void FireAccessibleFocusEvent(nsIAccessible *focusAccessible, nsIDOMNode *focusNode);
|
2002-05-08 20:21:03 +00:00
|
|
|
void AddScrollListener(nsIPresShell *aPresShell);
|
|
|
|
void RemoveScrollListener(nsIPresShell *aPresShell);
|
2002-10-30 07:46:34 +00:00
|
|
|
void AddContentDocListeners();
|
|
|
|
void RemoveContentDocListeners();
|
|
|
|
void FireDocLoadFinished();
|
|
|
|
|
|
|
|
static void DocLoadCallback(nsITimer *aTimer, void *aClosure);
|
|
|
|
static void ScrollTimerCallback(nsITimer *aTimer, void *aClosure);
|
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
|
|
|
|
|
|
|
static PRUint32 gInstanceCount;
|
2001-06-30 00:25:09 +00:00
|
|
|
|
2001-09-25 08:34:42 +00:00
|
|
|
// mListener is not a com pointer. We don't own the listener
|
2001-06-30 00:25:09 +00:00
|
|
|
// it is the callers responsibility to remove the listener
|
|
|
|
// otherwise we will get into circular referencing problems
|
2001-09-25 08:34:42 +00:00
|
|
|
// We don't need a weak reference, because we're owned by this listener
|
|
|
|
nsIAccessibleEventListener *mListener;
|
|
|
|
|
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
|
|
|
static nsIDOMNode * gLastFocusedNode; // we do our own refcounting for this
|
|
|
|
|
2002-10-30 07:46:34 +00:00
|
|
|
nsCOMPtr<nsITimer> mScrollWatchTimer;
|
|
|
|
nsCOMPtr<nsITimer> mDocLoadTimer;
|
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
|
|
|
nsCOMPtr<nsIWebProgress> mWebProgress;
|
2001-08-14 06:01:48 +00:00
|
|
|
nsCOMPtr<nsIAccessibilityService> mAccService;
|
2001-09-25 08:34:42 +00:00
|
|
|
EBusyState mBusy;
|
2002-10-30 07:46:34 +00:00
|
|
|
PRPackedBool mIsNewDocument;
|
2002-05-08 20:21:03 +00:00
|
|
|
|
|
|
|
// Used for tracking scroll events
|
|
|
|
PRUint32 mScrollPositionChangedTicks;
|
2002-06-25 22:54:23 +00:00
|
|
|
nsCOMPtr<nsIAccessibleCaret> mCaretAccessible;
|
2001-03-04 02:31:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|