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 nsIAnimationObserver_h___
7 #define nsIAnimationObserver_h___
9 #include "nsIMutationObserver.h"
11 namespace mozilla::dom
{
13 } // namespace mozilla::dom
15 #define NS_IANIMATION_OBSERVER_IID \
17 0xed025fc7, 0xdeda, 0x48b9, { \
18 0x9c, 0x35, 0xf2, 0xb6, 0x1e, 0xeb, 0xd0, 0x8d \
22 class nsIAnimationObserver
: public nsIMutationObserver
{
24 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IANIMATION_OBSERVER_IID
)
26 virtual void AnimationAdded(mozilla::dom::Animation
* aAnimation
) = 0;
27 virtual void AnimationChanged(mozilla::dom::Animation
* aAnimation
) = 0;
28 virtual void AnimationRemoved(mozilla::dom::Animation
* aAnimation
) = 0;
31 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAnimationObserver
, NS_IANIMATION_OBSERVER_IID
)
33 #define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONADDED \
34 virtual void AnimationAdded(mozilla::dom::Animation* aAnimation) override;
36 #define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONCHANGED \
37 virtual void AnimationChanged(mozilla::dom::Animation* aAnimation) override;
39 #define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONREMOVED \
40 virtual void AnimationRemoved(mozilla::dom::Animation* aAnimation) override;
42 #define NS_IMPL_NSIANIMATIONOBSERVER_STUB(class_) \
43 void class_::AnimationAdded(mozilla::dom::Animation* aAnimation) {} \
44 void class_::AnimationChanged(mozilla::dom::Animation* aAnimation) {} \
45 void class_::AnimationRemoved(mozilla::dom::Animation* aAnimation) {} \
46 NS_IMPL_NSIMUTATIONOBSERVER_CORE_STUB(class_) \
47 NS_IMPL_NSIMUTATIONOBSERVER_CONTENT(class_)
49 #define NS_DECL_NSIANIMATIONOBSERVER \
50 NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONADDED \
51 NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONCHANGED \
52 NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONREMOVED \
53 NS_DECL_NSIMUTATIONOBSERVER
55 #endif // nsIAnimationObserver_h___