2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-03 23:09:22 -07:00
|
|
|
#ifndef mozilla_a11y_RootAccessible_h__
|
|
|
|
#define mozilla_a11y_RootAccessible_h__
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-03-07 04:16:10 -08:00
|
|
|
#include "HyperTextAccessible.h"
|
2012-05-27 02:01:40 -07:00
|
|
|
#include "DocAccessibleWrap.h"
|
2008-06-15 23:16:18 -07:00
|
|
|
|
2011-08-08 11:26:26 -07:00
|
|
|
#include "nsIDOMEventListener.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-03-21 17:05:19 -07:00
|
|
|
class nsIDocument;
|
|
|
|
|
2012-05-03 23:09:22 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-27 02:01:40 -07:00
|
|
|
class RootAccessible : public DocAccessibleWrap,
|
2012-05-03 23:09:22 -07:00
|
|
|
public nsIDOMEventListener
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2009-06-24 19:08:53 -07:00
|
|
|
public:
|
2012-05-03 23:09:22 -07:00
|
|
|
RootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
|
|
|
|
nsIPresShell* aPresShell);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-06-24 19:08:53 -07:00
|
|
|
// nsIDOMEventListener
|
2015-03-21 09:28:04 -07:00
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) override;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void Shutdown() override;
|
|
|
|
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) override;
|
|
|
|
virtual Relation RelationByType(RelationType aType) override;
|
|
|
|
virtual mozilla::a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-03 23:09:22 -07:00
|
|
|
// RootAccessible
|
2007-06-14 10:12:50 -07:00
|
|
|
|
2011-03-02 06:41:42 -08:00
|
|
|
/**
|
|
|
|
* Notify that the sub document presshell was activated.
|
|
|
|
*/
|
2012-05-27 02:01:40 -07:00
|
|
|
virtual void DocumentActivated(DocAccessible* aDocument);
|
2011-03-02 06:41:42 -08:00
|
|
|
|
2010-01-25 07:08:08 -08:00
|
|
|
protected:
|
2014-07-08 14:23:18 -07:00
|
|
|
virtual ~RootAccessible();
|
2010-01-25 07:08:08 -08:00
|
|
|
|
2011-01-18 00:03:38 -08:00
|
|
|
/**
|
2012-11-19 19:54:41 -08:00
|
|
|
* Add/remove DOM event listeners.
|
2011-01-18 00:03:38 -08:00
|
|
|
*/
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult AddEventListeners() override;
|
|
|
|
virtual nsresult RemoveEventListeners() override;
|
2011-01-18 00:03:38 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process the DOM event.
|
|
|
|
*/
|
|
|
|
void ProcessDOMEvent(nsIDOMEvent* aEvent);
|
2010-06-11 01:23:18 -07:00
|
|
|
|
|
|
|
/**
|
2010-06-30 19:18:08 -07:00
|
|
|
* Process "popupshown" event. Used by HandleEvent().
|
2010-06-11 01:23:18 -07:00
|
|
|
*/
|
2012-05-28 18:18:45 -07:00
|
|
|
void HandlePopupShownEvent(Accessible* aAccessible);
|
2010-06-11 01:23:18 -07:00
|
|
|
|
|
|
|
/*
|
2010-06-30 19:18:08 -07:00
|
|
|
* Process "popuphiding" event. Used by HandleEvent().
|
2010-06-11 01:23:18 -07:00
|
|
|
*/
|
2011-09-27 18:46:11 -07:00
|
|
|
void HandlePopupHidingEvent(nsINode* aNode);
|
2008-12-03 01:04:02 -08:00
|
|
|
|
2008-09-05 04:30:19 -07:00
|
|
|
#ifdef MOZ_XUL
|
2011-01-18 00:03:38 -08:00
|
|
|
void HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
|
2012-06-08 03:28:27 -07:00
|
|
|
XULTreeAccessible* aAccessible);
|
2011-01-18 00:03:38 -08:00
|
|
|
void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
|
2012-06-08 03:28:27 -07:00
|
|
|
XULTreeAccessible* aAccessible);
|
2008-02-08 04:55:57 -08:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t GetChromeFlags();
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2012-11-17 18:01:44 -08:00
|
|
|
inline RootAccessible*
|
2012-05-28 18:18:45 -07:00
|
|
|
Accessible::AsRoot()
|
2011-03-01 21:16:28 -08:00
|
|
|
{
|
2012-12-17 21:22:26 -08:00
|
|
|
return IsRoot() ? static_cast<mozilla::a11y::RootAccessible*>(this) : nullptr;
|
2011-03-01 21:16:28 -08:00
|
|
|
}
|
|
|
|
|
2012-11-17 18:01:44 -08:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2011-01-18 00:03:38 -08:00
|
|
|
#endif
|