Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / events / AnimationPlayerEvent.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef AnimationPlayerEvent_h
6 #define AnimationPlayerEvent_h
7
8 #include "core/events/Event.h"
9
10 namespace blink {
11
12 struct AnimationPlayerEventInit : public EventInit {
13     AnimationPlayerEventInit();
14
15     double currentTime;
16     double timelineTime;
17 };
18
19 class AnimationPlayerEvent FINAL : public Event {
20 public:
21     static PassRefPtrWillBeRawPtr<AnimationPlayerEvent> create()
22     {
23         return adoptRefWillBeNoop(new AnimationPlayerEvent);
24     }
25     static PassRefPtrWillBeRawPtr<AnimationPlayerEvent> create(const AtomicString& type, double currentTime, double timelineTime)
26     {
27         return adoptRefWillBeNoop(new AnimationPlayerEvent(type, currentTime, timelineTime));
28     }
29     static PassRefPtrWillBeRawPtr<AnimationPlayerEvent> create(const AtomicString& type, const AnimationPlayerEventInit& initializer)
30     {
31         return adoptRefWillBeNoop(new AnimationPlayerEvent(type, initializer));
32     }
33
34     virtual ~AnimationPlayerEvent();
35
36     double currentTime() const;
37     double timelineTime() const;
38
39     virtual const AtomicString& interfaceName() const OVERRIDE;
40
41     virtual void trace(Visitor*) OVERRIDE;
42
43 private:
44     AnimationPlayerEvent();
45     AnimationPlayerEvent(const AtomicString& type, double currentTime, double timelineTime);
46     AnimationPlayerEvent(const AtomicString&, const AnimationPlayerEventInit&);
47
48     double m_currentTime;
49     double m_timelineTime;
50 };
51
52 } // namespace blink
53
54 #endif // AnimationPlayerEvent_h