Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_a11y_RootAccessible_h__
7 #define mozilla_a11y_RootAccessible_h__
9 #include "HyperTextAccessible.h"
10 #include "DocAccessibleWrap.h"
12 #include "nsIDOMEventListener.h"
14 class nsIDocument;
16 namespace mozilla {
17 namespace a11y {
19 class RootAccessible : public DocAccessibleWrap,
20 public nsIDOMEventListener
21 {
22 NS_DECL_ISUPPORTS_INHERITED
24 public:
25 RootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
26 nsIPresShell* aPresShell);
27 virtual ~RootAccessible();
29 // nsIDOMEventListener
30 NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
32 // Accessible
33 virtual void Shutdown();
34 virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
35 virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
36 virtual mozilla::a11y::role NativeRole();
37 virtual uint64_t NativeState();
39 // RootAccessible
41 /**
42 * Notify that the sub document presshell was activated.
43 */
44 virtual void DocumentActivated(DocAccessible* aDocument);
46 protected:
48 /**
49 * Add/remove DOM event listeners.
50 */
51 virtual nsresult AddEventListeners();
52 virtual nsresult RemoveEventListeners();
54 /**
55 * Process the DOM event.
56 */
57 void ProcessDOMEvent(nsIDOMEvent* aEvent);
59 /**
60 * Process "popupshown" event. Used by HandleEvent().
61 */
62 void HandlePopupShownEvent(Accessible* aAccessible);
64 /*
65 * Process "popuphiding" event. Used by HandleEvent().
66 */
67 void HandlePopupHidingEvent(nsINode* aNode);
69 #ifdef MOZ_XUL
70 void HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
71 XULTreeAccessible* aAccessible);
72 void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
73 XULTreeAccessible* aAccessible);
75 uint32_t GetChromeFlags();
76 #endif
77 };
79 inline RootAccessible*
80 Accessible::AsRoot()
81 {
82 return IsRoot() ? static_cast<mozilla::a11y::RootAccessible*>(this) : nullptr;
83 }
85 } // namespace a11y
86 } // namespace mozilla
88 #endif