michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_MutationEvent_h_ michael@0: #define mozilla_dom_MutationEvent_h_ michael@0: michael@0: #include "mozilla/EventForwards.h" michael@0: #include "mozilla/dom/Event.h" michael@0: #include "mozilla/dom/MutationEventBinding.h" michael@0: #include "nsIDOMMutationEvent.h" michael@0: #include "nsINode.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class MutationEvent : public Event, michael@0: public nsIDOMMutationEvent michael@0: { michael@0: public: michael@0: MutationEvent(EventTarget* aOwner, michael@0: nsPresContext* aPresContext, michael@0: InternalMutationEvent* aEvent); michael@0: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: michael@0: NS_DECL_NSIDOMMUTATIONEVENT michael@0: michael@0: // Forward to base class michael@0: NS_FORWARD_TO_EVENT michael@0: michael@0: virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE michael@0: { michael@0: return MutationEventBinding::Wrap(aCx, this); michael@0: } michael@0: michael@0: // xpidl implementation michael@0: // GetPrevValue(nsAString& aPrevValue); michael@0: // GetNewValue(nsAString& aNewValue); michael@0: // GetAttrName(nsAString& aAttrName); michael@0: michael@0: already_AddRefed GetRelatedNode(); michael@0: michael@0: uint16_t AttrChange(); michael@0: michael@0: void InitMutationEvent(const nsAString& aType, michael@0: bool& aCanBubble, bool& aCancelable, michael@0: nsINode* aRelatedNode, michael@0: const nsAString& aPrevValue, michael@0: const nsAString& aNewValue, michael@0: const nsAString& aAttrName, michael@0: uint16_t& aAttrChange, ErrorResult& aRv) michael@0: { michael@0: aRv = InitMutationEvent(aType, aCanBubble, aCancelable, michael@0: aRelatedNode ? aRelatedNode->AsDOMNode() : nullptr, michael@0: aPrevValue, aNewValue, aAttrName, aAttrChange); michael@0: } michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_MutationEvent_h_