Bug 760064 - don't include NotificationController.h into headers, r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Sat, 02 Jun 2012 03:39:47 +0900
changeset 95549 33d170966fbd1608cc97e2a6dffa30d350d69eac
parent 95548 90d655790bec2651054d74b4695c1171cb070267
child 95550 b178b0631bf0921a69f165d57f699033cf6bffc9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerstbsaunde
bugs760064
milestone15.0a1
Bug 760064 - don't include NotificationController.h into headers, r=tbsaunde
accessible/src/base/FocusManager.cpp
accessible/src/base/nsAccDocManager.cpp
accessible/src/base/nsAccessibilityService.cpp
accessible/src/base/nsCaretAccessible.cpp
accessible/src/base/nsCaretAccessible.h
accessible/src/generic/DocAccessible-inl.h
accessible/src/generic/DocAccessible.h
accessible/src/generic/RootAccessible.cpp
--- a/accessible/src/base/FocusManager.cpp
+++ b/accessible/src/base/FocusManager.cpp
@@ -1,15 +1,16 @@
 /* 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/. */
 
 #include "FocusManager.h"
 
 #include "Accessible-inl.h"
+#include "DocAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "Role.h"
 #include "RootAccessible.h"
 
 #include "nsEventStateManager.h"
 #include "nsFocusManager.h"
 
--- a/accessible/src/base/nsAccDocManager.cpp
+++ b/accessible/src/base/nsAccDocManager.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include "nsAccDocManager.h"
 
 #include "ApplicationAccessible.h"
+#include "DocAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsARIAMap.h"
 #include "RootAccessibleWrap.h"
 #include "States.h"
 
 #ifdef DEBUG
 #include "Logging.h"
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -7,16 +7,17 @@
 
 // NOTE: alphabetically ordered
 #include "Accessible-inl.h"
 #include "ApplicationAccessibleWrap.h"
 #include "ARIAGridAccessibleWrap.h"
 #ifdef MOZ_ACCESSIBILITY_ATK
 #include "AtkSocketAccessible.h"
 #endif
+#include "DocAccessible-inl.h"
 #include "FocusManager.h"
 #include "HTMLListAccessible.h"
 #include "HyperTextAccessibleWrap.h"
 #include "nsAccessiblePivot.h"
 #include "nsAccUtils.h"
 #include "nsARIAMap.h"
 #include "nsIAccessibleProvider.h"
 #include "nsHTMLCanvasAccessible.h"
--- a/accessible/src/base/nsCaretAccessible.cpp
+++ b/accessible/src/base/nsCaretAccessible.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include "nsCaretAccessible.h"
 
+#include "DocAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "nsIAccessibleEvent.h"
 #include "RootAccessible.h"
 
 #include "nsCaret.h"
 #include "nsIDOMDocument.h"
--- a/accessible/src/base/nsCaretAccessible.h
+++ b/accessible/src/base/nsCaretAccessible.h
@@ -2,17 +2,16 @@
 /* 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/. */
 
 #ifndef __nsCaretAccessible_h__
 #define __nsCaretAccessible_h__
 
 #include "HyperTextAccessible.h"
-#include "NotificationController.h"
 
 #include "nsISelectionListener.h"
 
 /*
  * This special accessibility class is for the caret, which is really the currently focused selection.
  * There is only 1 visible caret per top level window (RootAccessible),
  * However, there may be several visible selections.
  *
--- a/accessible/src/generic/DocAccessible-inl.h
+++ b/accessible/src/generic/DocAccessible-inl.h
@@ -4,16 +4,45 @@
  * 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/. */
 
 #ifndef mozilla_a11y_DocAccessible_inl_h_
 #define mozilla_a11y_DocAccessible_inl_h_
 
 #include "DocAccessible.h"
 #include "nsAccessibilityService.h"
+#include "NotificationController.h"
 
 inline DocAccessible*
 DocAccessible::ParentDocument() const
 {
   return GetAccService()->GetDocAccessible(mDocument->GetParentDocument());
 }
 
+inline void
+DocAccessible::BindChildDocument(DocAccessible* aDocument)
+{
+  mNotificationController->ScheduleChildDocBinding(aDocument);
+}
+
+template<class Class, class Arg>
+inline void
+DocAccessible::HandleNotification(Class* aInstance,
+                                  typename TNotification<Class, Arg>::Callback aMethod,
+                                  Arg* aArg)
+{
+  if (mNotificationController) {
+    mNotificationController->HandleNotification<Class, Arg>(aInstance,
+                                                            aMethod, aArg);
+  }
+}
+
+inline void
+DocAccessible::UpdateText(nsIContent* aTextNode)
+{
+  NS_ASSERTION(mNotificationController, "The document was shut down!");
+
+  // Ignore the notification if initial tree construction hasn't been done yet.
+  if (mNotificationController && HasLoadState(eTreeConstructed))
+    mNotificationController->ScheduleTextUpdate(aTextNode);
+}
+
 #endif
--- a/accessible/src/generic/DocAccessible.h
+++ b/accessible/src/generic/DocAccessible.h
@@ -7,30 +7,33 @@
 #define mozilla_a11y_DocAccessible_h__
 
 #include "nsIAccessibleCursorable.h"
 #include "nsIAccessibleDocument.h"
 #include "nsIAccessiblePivot.h"
 
 #include "HyperTextAccessibleWrap.h"
 #include "nsEventShell.h"
-#include "NotificationController.h"
 
 #include "nsClassHashtable.h"
 #include "nsDataHashtable.h"
 #include "nsIDocument.h"
 #include "nsIDocumentObserver.h"
 #include "nsIEditor.h"
 #include "nsIObserver.h"
 #include "nsIScrollPositionListener.h"
 #include "nsITimer.h"
 #include "nsIWeakReference.h"
 #include "nsCOMArray.h"
 #include "nsIDocShellTreeNode.h"
 
+template<class Class, class Arg>
+class TNotification;
+class NotificationController;
+
 class nsIScrollableView;
 class nsAccessiblePivot;
 
 const PRUint32 kDefaultCacheSize = 256;
 
 class DocAccessible : public HyperTextAccessibleWrap,
                       public nsIAccessibleDocument,
                       public nsIDocumentObserver,
@@ -203,38 +206,29 @@ public:
     { return GetAccessibleOrContainer(mAnchorJumpElm); }
 
   void SetAnchorJump(nsIContent* aTargetNode)
     { mAnchorJumpElm = aTargetNode; }
 
   /**
    * Bind the child document to the tree.
    */
-  void BindChildDocument(DocAccessible* aDocument)
-  {
-    mNotificationController->ScheduleChildDocBinding(aDocument);
-  }
+  void BindChildDocument(DocAccessible* aDocument);
 
   /**
    * Process the generic notification.
    *
    * @note  The caller must guarantee that the given instance still exists when
    *          notification is processed.
    * @see   NotificationController::HandleNotification
    */
   template<class Class, class Arg>
   void HandleNotification(Class* aInstance,
-                                 typename TNotification<Class, Arg>::Callback aMethod,
-                                 Arg* aArg)
-  {
-    if (mNotificationController) {
-      mNotificationController->HandleNotification<Class, Arg>(aInstance,
-                                                              aMethod, aArg);
-    }
-  }
+                          typename TNotification<Class, Arg>::Callback aMethod,
+                          Arg* aArg);
 
   /**
    * Return the cached accessible by the given DOM node if it's in subtree of
    * this document accessible or the document accessible itself, otherwise null.
    *
    * @return the accessible object
    */
   Accessible* GetAccessible(nsINode* aNode) const;
@@ -324,24 +318,17 @@ public:
   /**
    * Notify the document accessible that content was removed.
    */
   void ContentRemoved(nsIContent* aContainerNode, nsIContent* aChildNode);
 
   /**
    * Updates accessible tree when rendered text is changed.
    */
-  void UpdateText(nsIContent* aTextNode)
-  {
-    NS_ASSERTION(mNotificationController, "The document was shut down!");
-
-    // Ignore the notification if initial tree construction hasn't been done yet.
-    if (mNotificationController && HasLoadState(eTreeConstructed))
-      mNotificationController->ScheduleTextUpdate(aTextNode);
-  }
+  void UpdateText(nsIContent* aTextNode);
 
   /**
    * Recreate an accessible, results in hide/show events pair.
    */
   void RecreateAccessible(nsIContent* aContent);
 
 protected:
 
--- a/accessible/src/generic/RootAccessible.cpp
+++ b/accessible/src/generic/RootAccessible.cpp
@@ -6,16 +6,17 @@
 #include "RootAccessible.h"
 
 #include "mozilla/Util.h"
 
 #define CreateEvent CreateEventA
 #include "nsIDOMDocument.h"
 
 #include "Accessible-inl.h"
+#include "DocAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 #include "mozilla/dom/Element.h"