AnimationEvent.h (1565B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #ifndef mozilla_dom_AnimationEvent_h_ 7 #define mozilla_dom_AnimationEvent_h_ 8 9 #include "mozilla/EventForwards.h" 10 #include "mozilla/dom/AnimationEventBinding.h" 11 #include "mozilla/dom/Event.h" 12 #include "nsStringFwd.h" 13 14 namespace mozilla::dom { 15 16 class AnimationEvent : public Event { 17 public: 18 AnimationEvent(EventTarget* aOwner, nsPresContext* aPresContext, 19 InternalAnimationEvent* aEvent); 20 21 NS_INLINE_DECL_REFCOUNTING_INHERITED(AnimationEvent, Event) 22 23 static already_AddRefed<AnimationEvent> Constructor( 24 const GlobalObject& aGlobal, const nsAString& aType, 25 const AnimationEventInit& aParam); 26 27 virtual JSObject* WrapObjectInternal( 28 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override { 29 return AnimationEvent_Binding::Wrap(aCx, this, aGivenProto); 30 } 31 32 void GetAnimationName(nsAString& aAnimationName); 33 34 float ElapsedTime(); 35 36 void GetPseudoElement(nsAString& aPseudoElement); 37 38 protected: 39 ~AnimationEvent() = default; 40 }; 41 42 } // namespace mozilla::dom 43 44 already_AddRefed<mozilla::dom::AnimationEvent> NS_NewDOMAnimationEvent( 45 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, 46 mozilla::InternalAnimationEvent* aEvent); 47 48 #endif // mozilla_dom_AnimationEvent_h_