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
|
|
|
|
2008-06-15 23:16:18 -07:00
|
|
|
#include "nsCaretAccessible.h"
|
2012-05-27 02:01:40 -07:00
|
|
|
#include "DocAccessibleWrap.h"
|
2008-06-15 23:16:18 -07:00
|
|
|
|
|
|
|
#include "nsHashtable.h"
|
2007-06-14 10:12:50 -07:00
|
|
|
#include "nsCaretAccessible.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIDocument.h"
|
2011-08-08 11:26:26 -07:00
|
|
|
#include "nsIDOMEventListener.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
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);
|
|
|
|
virtual ~RootAccessible();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-06-24 19:08:53 -07:00
|
|
|
// nsIDOMEventListener
|
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-06-24 19:08:53 -07:00
|
|
|
// nsAccessNode
|
2010-06-11 21:04:35 -07:00
|
|
|
virtual void Shutdown();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-04-30 20:08:31 -07:00
|
|
|
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Relation RelationByType(uint32_t aType);
|
2012-01-11 19:07:35 -08:00
|
|
|
virtual mozilla::a11y::role NativeRole();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint64_t NativeState();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-03 23:09:22 -07:00
|
|
|
// RootAccessible
|
2012-04-10 03:52:00 -07:00
|
|
|
nsCaretAccessible* GetCaretAccessible();
|
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:
|
|
|
|
|
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
|
|
|
*/
|
2012-11-19 19:54:41 -08:00
|
|
|
virtual nsresult AddEventListeners();
|
2011-01-18 00:03:38 -08:00
|
|
|
virtual nsresult RemoveEventListeners();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-01-30 22:40:06 -08:00
|
|
|
|
2007-06-14 10:12:50 -07:00
|
|
|
nsRefPtr<nsCaretAccessible> mCaretAccessible;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
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
|
|
|
{
|
|
|
|
return mFlags & eRootAccessible ?
|
2012-07-30 07:20:58 -07:00
|
|
|
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
|