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