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_EventQueue_h_
7 #define mozilla_a11y_EventQueue_h_
17 * Used to organize and coalesce pending events.
21 explicit EventQueue(DocAccessible
* aDocument
) : mDocument(aDocument
) {}
24 * Put an accessible event into the queue to process it later.
26 bool PushEvent(AccEvent
* aEvent
);
29 * Puts name and/or description change events into the queue, if needed.
31 bool PushNameOrDescriptionChange(LocalAccessible
* aTarget
);
34 * Process events from the queue and fires events.
36 void ProcessEventQueue();
39 EventQueue(const EventQueue
&) = delete;
40 EventQueue
& operator=(const EventQueue
&) = delete;
42 // Event queue processing
44 * Coalesce redundant events from the queue.
46 void CoalesceEvents();
49 * Coalesce events from the same subtree.
51 void CoalesceReorderEvents(AccEvent
* aTailEvent
);
54 * Coalesce two selection change events within the same select control.
56 void CoalesceSelChangeEvents(AccSelChangeEvent
* aTailEvent
,
57 AccSelChangeEvent
* aThisEvent
,
62 * The document accessible reference owning this queue.
64 DocAccessible
* mDocument
;
67 * Pending events array. Don't make this an AutoTArray; we use
68 * SwapElements() on it.
70 nsTArray
<RefPtr
<AccEvent
>> mEvents
;
74 } // namespace mozilla
76 #endif // mozilla_a11y_EventQueue_h_