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.
This commit is contained in:
Trevor Saunders 2016-09-02 15:36:22 -04:00
Родитель 9b4d4eb7ea
Коммит 45c050cef9
1 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -202,15 +202,25 @@ private:
friend class EventTree; 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. * Base class for show and hide accessible events.
*/ */
class AccMutationEvent: public AccEvent class AccMutationEvent: public AccTreeMutationEvent
{ {
public: public:
AccMutationEvent(uint32_t aEventType, Accessible* aTarget) : 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 // Don't coalesce these since they are coalesced by reorder event. Coalesce
// contained text change events. // contained text change events.
@ -298,12 +308,11 @@ private:
/** /**
* Class for reorder accessible event. Takes care about * Class for reorder accessible event. Takes care about
*/ */
class AccReorderEvent : public AccEvent class AccReorderEvent : public AccTreeMutationEvent
{ {
public: public:
explicit AccReorderEvent(Accessible* aTarget) : explicit AccReorderEvent(Accessible* aTarget) :
AccEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget, AccTreeMutationEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget) { }
eAutoDetect, eCoalesceReorder) { }
virtual ~AccReorderEvent() { } virtual ~AccReorderEvent() { }
// Event // Event