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:
|
2012-05-04 10:09:22 +04:00
|
|
|
RootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
|
|
|
|
nsIPresShell* aPresShell);
|
2001-03-04 05:31:28 +03:00
|
|
|
|
2009-06-25 06:08:53 +04:00
|
|
|
// nsIDOMEventListener
|
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
|
2007-01-10 23:25:20 +03:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2013-10-29 07:30:55 +04:00
|
|
|
virtual void Shutdown();
|
2012-05-01 07:08:31 +04:00
|
|
|
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
2013-10-19 22:19:50 +04:00
|
|
|
virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
|
2012-01-12 07:07:35 +04:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual uint64_t NativeState();
|
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
|
|
|
|
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
|
|
|
*/
|
2012-11-20 07:54:41 +04:00
|
|
|
virtual nsresult AddEventListeners();
|
2011-01-18 11:03:38 +03:00
|
|
|
virtual nsresult RemoveEventListeners();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|