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
|
|
|
|
2013-03-07 12:16:10 +00:00
|
|
|
#include "HyperTextAccessible.h"
|
2012-05-27 09:01:40 +00:00
|
|
|
#include "DocAccessibleWrap.h"
|
2008-06-16 06:16:18 +00:00
|
|
|
|
2011-08-08 18:26:26 +00:00
|
|
|
#include "nsIDOMEventListener.h"
|
2001-09-25 08:34:42 +00:00
|
|
|
|
2013-03-22 00:05:19 +00:00
|
|
|
class nsIDocument;
|
|
|
|
|
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);
|
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
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2013-10-29 03:30:55 +00:00
|
|
|
virtual void Shutdown();
|
2012-05-01 03:08:31 +00:00
|
|
|
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
2013-10-19 18:19:50 +00:00
|
|
|
virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
|
2012-01-12 03:07:35 +00:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual uint64_t NativeState();
|
2003-04-01 20:02:51 +00:00
|
|
|
|
2012-05-04 06:09:22 +00:00
|
|
|
// RootAccessible
|
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:
|
2014-07-08 21:23:18 +00:00
|
|
|
virtual ~RootAccessible();
|
2010-01-25 15:08:08 +00:00
|
|
|
|
2011-01-18 08:03:38 +00:00
|
|
|
/**
|
2012-11-20 03:54:41 +00:00
|
|
|
* Add/remove DOM event listeners.
|
2011-01-18 08:03:38 +00:00
|
|
|
*/
|
2012-11-20 03:54:41 +00:00
|
|
|
virtual nsresult AddEventListeners();
|
2011-01-18 08:03:38 +00:00
|
|
|
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,
|
2012-06-08 10:28:27 +00:00
|
|
|
XULTreeAccessible* aAccessible);
|
2011-01-18 08:03:38 +00:00
|
|
|
void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
|
2012-06-08 10:28:27 +00:00
|
|
|
XULTreeAccessible* aAccessible);
|
2008-02-08 12:55:57 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t GetChromeFlags();
|
2007-01-28 03:58:18 +00:00
|
|
|
#endif
|
2001-03-04 02:31:28 +00:00
|
|
|
};
|
|
|
|
|
2012-11-18 02:01:44 +00:00
|
|
|
inline RootAccessible*
|
2012-05-29 01:18:45 +00:00
|
|
|
Accessible::AsRoot()
|
2011-03-02 05:16:28 +00:00
|
|
|
{
|
2012-12-18 05:22:26 +00:00
|
|
|
return IsRoot() ? static_cast<mozilla::a11y::RootAccessible*>(this) : nullptr;
|
2011-03-02 05:16:28 +00:00
|
|
|
}
|
|
|
|
|
2012-11-18 02:01:44 +00:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2011-01-18 08:03:38 +00:00
|
|
|
#endif
|