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_EventTree_h_
7 #define mozilla_a11y_EventTree_h_
10 #include "LocalAccessible.h"
12 #include "mozilla/a11y/DocAccessible.h"
13 #include "mozilla/RefPtr.h"
14 #include "mozilla/UniquePtr.h"
19 class NotificationController
;
22 * This class makes sure required tasks are done before and after tree
23 * mutations. Currently this only includes group info invalidation. You must
24 * have an object of this class on the stack when calling methods that mutate
25 * the accessible tree.
27 class TreeMutation final
{
29 static const bool kNoEvents
= true;
30 static const bool kNoShutdown
= true;
32 explicit TreeMutation(LocalAccessible
* aParent
, bool aNoEvents
= false);
35 void AfterInsertion(LocalAccessible
* aChild
);
36 void BeforeRemoval(LocalAccessible
* aChild
, bool aNoShutdown
= false);
40 NotificationController
* Controller() const {
41 return mParent
->Document()->Controller();
44 LocalAccessible
* mParent
;
46 uint32_t mStateFlagsCopy
;
49 * True if mutation events should be queued.
59 } // namespace mozilla
61 #endif // mozilla_a11y_EventQueue_h_