2001-09-25 00:48:50 +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-03-04 02:31:28 +00:00
|
|
|
|
2012-05-04 06:09:22 +00:00
|
|
|
#ifndef mozilla_a11y_RootAccessible_h__
|
|
|
|
#define mozilla_a11y_RootAccessible_h__
|
2001-03-04 02:31:28 +00:00
|
|
|
|
2008-06-16 06:16:18 +00:00
|
|
|
#include "nsCaretAccessible.h"
|
2012-05-27 09:01:40 +00:00
|
|
|
#include "DocAccessibleWrap.h"
|
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"
|
2011-08-08 18:26:26 +00:00
|
|
|
#include "nsIDOMEventListener.h"
|
2001-09-25 08:34:42 +00:00
|
|
|
|
2012-03-27 22:24:06 +00:00
|
|
|
class nsXULTreeAccessible;
|
2011-08-10 01:44:00 +00:00
|
|
|
class Relation;
|
|
|
|
|
2012-05-04 06:09:22 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
2001-04-17 23:06:38 +00:00
|
|
|
|
2012-05-27 09:01:40 +00:00
|
|
|
class RootAccessible : public DocAccessibleWrap,
|
2012-05-04 06:09:22 +00:00
|
|
|
public nsIDOMEventListener
|
2001-03-04 02:31:28 +00:00
|
|
|
{
|
2001-04-17 23:06:38 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2009-06-25 02:08:53 +00:00
|
|
|
public:
|
2012-05-04 06:09:22 +00:00
|
|
|
RootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
|
|
|
|
nsIPresShell* aPresShell);
|
|
|
|
virtual ~RootAccessible();
|
2001-03-04 02:31:28 +00:00
|
|
|
|
2009-06-25 02:08:53 +00:00
|
|
|
// nsIDOMEventListener
|
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
|
2007-01-10 20:25:20 +00:00
|
|
|
|
2009-06-25 02:08:53 +00:00
|
|
|
// nsAccessNode
|
2010-06-12 04:04:35 +00:00
|
|
|
virtual void Shutdown();
|
2001-05-17 21:28:37 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2012-05-01 03:08:31 +00:00
|
|
|
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
2011-08-10 01:44:00 +00:00
|
|
|
virtual Relation RelationByType(PRUint32 aType);
|
2012-01-12 03:07:35 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2011-04-09 23:38:06 +00:00
|
|
|
virtual PRUint64 NativeState();
|
2003-04-01 20:02:51 +00:00
|
|
|
|
2012-05-04 06:09:22 +00:00
|
|
|
// RootAccessible
|
2012-04-10 10:52:00 +00:00
|
|
|
nsCaretAccessible* GetCaretAccessible();
|
2007-06-14 17:12:50 +00:00
|
|
|
|
2011-03-02 14:41:42 +00:00
|
|
|
/**
|
|
|
|
* Notify that the sub document presshell was activated.
|
|
|
|
*/
|
2012-05-27 09:01:40 +00:00
|
|
|
virtual void DocumentActivated(DocAccessible* aDocument);
|
2011-03-02 14:41:42 +00:00
|
|
|
|
2010-01-25 15:08:08 +00:00
|
|
|
protected:
|
|
|
|
|
2011-01-18 08:03:38 +00:00
|
|
|
/**
|
|
|
|
* Add/remove DOM event listeners.
|
|
|
|
*/
|
|
|
|
virtual nsresult AddEventListeners();
|
|
|
|
virtual nsresult RemoveEventListeners();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Process the DOM event.
|
|
|
|
*/
|
|
|
|
void ProcessDOMEvent(nsIDOMEvent* aEvent);
|
2010-06-11 08:23:18 +00:00
|
|
|
|
|
|
|
/**
|
2010-07-01 02:18:08 +00:00
|
|
|
* Process "popupshown" event. Used by HandleEvent().
|
2010-06-11 08:23:18 +00:00
|
|
|
*/
|
2012-05-29 01:18:45 +00:00
|
|
|
void HandlePopupShownEvent(Accessible* aAccessible);
|
2010-06-11 08:23:18 +00:00
|
|
|
|
|
|
|
/*
|
2010-07-01 02:18:08 +00:00
|
|
|
* Process "popuphiding" event. Used by HandleEvent().
|
2010-06-11 08:23:18 +00:00
|
|
|
*/
|
2011-09-28 01:46:11 +00:00
|
|
|
void HandlePopupHidingEvent(nsINode* aNode);
|
2008-12-03 09:04:02 +00:00
|
|
|
|
2008-09-05 11:30:19 +00:00
|
|
|
#ifdef MOZ_XUL
|
2011-01-18 08:03:38 +00:00
|
|
|
void HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
|
|
|
|
nsXULTreeAccessible* aAccessible);
|
|
|
|
void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
|
|
|
|
nsXULTreeAccessible* aAccessible);
|
2008-02-08 12:55:57 +00:00
|
|
|
|
2007-01-28 03:58:18 +00:00
|
|
|
PRUint32 GetChromeFlags();
|
|
|
|
#endif
|
2012-01-31 06:40:06 +00:00
|
|
|
|
2007-06-14 17:12:50 +00:00
|
|
|
nsRefPtr<nsCaretAccessible> mCaretAccessible;
|
2001-03-04 02:31:28 +00:00
|
|
|
};
|
|
|
|
|
2012-05-04 06:09:22 +00:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
inline mozilla::a11y::RootAccessible*
|
2012-05-29 01:18:45 +00:00
|
|
|
Accessible::AsRoot()
|
2011-03-02 05:16:28 +00:00
|
|
|
{
|
|
|
|
return mFlags & eRootAccessible ?
|
2012-05-04 06:09:22 +00:00
|
|
|
static_cast<mozilla::a11y::RootAccessible*>(this) : nsnull;
|
2011-03-02 05:16:28 +00:00
|
|
|
}
|
|
|
|
|
2011-01-18 08:03:38 +00:00
|
|
|
#endif
|