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.
22 EventQueue(DocAccessible
* aDocument
) : mDocument(aDocument
) { }
25 * Put an accessible event into the queue to process it later.
27 bool PushEvent(AccEvent
* aEvent
);
30 * Process events from the queue and fires events.
32 void ProcessEventQueue();
35 EventQueue(const EventQueue
&) MOZ_DELETE
;
36 EventQueue
& operator = (const EventQueue
&) MOZ_DELETE
;
38 // Event queue processing
40 * Coalesce redundant events from the queue.
42 void CoalesceEvents();
45 * Coalesce events from the same subtree.
47 void CoalesceReorderEvents(AccEvent
* aTailEvent
);
50 * Coalesce two selection change events within the same select control.
52 void CoalesceSelChangeEvents(AccSelChangeEvent
* aTailEvent
,
53 AccSelChangeEvent
* aThisEvent
,
57 * Coalesce text change events caused by sibling hide events.
59 void CoalesceTextChangeEventsFor(AccHideEvent
* aTailEvent
,
60 AccHideEvent
* aThisEvent
);
61 void CoalesceTextChangeEventsFor(AccShowEvent
* aTailEvent
,
62 AccShowEvent
* aThisEvent
);
65 * Create text change event caused by hide or show event. When a node is
66 * hidden/removed or shown/appended, the text in an ancestor hyper text will
67 * lose or get new characters.
69 void CreateTextChangeEventFor(AccMutationEvent
* aEvent
);
74 * The document accessible reference owning this queue.
76 DocAccessible
* mDocument
;
79 * Pending events array. Don't make this an nsAutoTArray; we use
80 * SwapElements() on it.
82 nsTArray
<nsRefPtr
<AccEvent
> > mEvents
;
86 } // namespace mozilla
88 #endif // mozilla_a11y_EventQueue_h_