accessible/src/generic/RootAccessible.h

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

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

mercurial