From 001e173dface3dd56b5ec18a4781d4c75b8fcd59 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Fri, 2 Sep 2016 15:36:22 -0400 Subject: [PATCH] bug 1270916 - add a common base class of AccMutationEvent and AccReorderEvent r=davidb Soon we will want to operate on either a reorder event or a mutation event. --- accessible/base/AccEvent.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/accessible/base/AccEvent.h b/accessible/base/AccEvent.h index 4c7ec47eecaa..dfe6fc4e7be0 100644 --- a/accessible/base/AccEvent.h +++ b/accessible/base/AccEvent.h @@ -202,15 +202,25 @@ private: friend class EventTree; }; +/** + * A base class for events related to tree mutation, either an AccMutation + * event, or an AccReorderEvent. + */ +class AccTreeMutationEvent : public AccEvent +{ +public: + AccTreeMutationEvent(uint32_t aEventType, Accessible* aTarget) : + AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder) {} +}; /** * Base class for show and hide accessible events. */ -class AccMutationEvent: public AccEvent +class AccMutationEvent: public AccTreeMutationEvent { public: AccMutationEvent(uint32_t aEventType, Accessible* aTarget) : - AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder) + AccTreeMutationEvent(aEventType, aTarget) { // Don't coalesce these since they are coalesced by reorder event. Coalesce // contained text change events. @@ -298,12 +308,11 @@ private: /** * Class for reorder accessible event. Takes care about */ -class AccReorderEvent : public AccEvent +class AccReorderEvent : public AccTreeMutationEvent { public: explicit AccReorderEvent(Accessible* aTarget) : - AccEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget, - eAutoDetect, eCoalesceReorder) { } + AccTreeMutationEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget) { } virtual ~AccReorderEvent() { } // Event