Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / public / platform / WebCompositorAnimation.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 WebCompositorAnimation_h
6 #define WebCompositorAnimation_h
7
8 #define WEB_ANIMATION_SUPPORTS_FILL_MODE 1
9
10 namespace blink {
11
12 // A compositor driven animation.
13 class WebCompositorAnimation {
14 public:
15     enum TargetProperty {
16         TargetPropertyTransform = 0,
17         TargetPropertyOpacity,
18         TargetPropertyFilter,
19         TargetPropertyScrollOffset
20     };
21
22     enum Direction {
23         DirectionNormal = 0,
24         DirectionReverse,
25         DirectionAlternate,
26         DirectionAlternateReverse
27     };
28
29     enum FillMode {
30         FillModeNone = 0,
31         FillModeForwards,
32         FillModeBackwards,
33         FillModeBoth
34     };
35
36     virtual ~WebCompositorAnimation() { }
37
38     // An id is effectively the animation's name, and it is not unique.
39     virtual int id() = 0;
40     virtual int group() = 0;
41
42     virtual TargetProperty targetProperty() const = 0;
43
44     // This is the number of times that the animation will play. If this
45     // value is zero the animation will not play. If it is negative, then
46     // the animation will loop indefinitely.
47     virtual double iterations() const = 0;
48     virtual void setIterations(double) = 0;
49
50     virtual double startTime() const = 0;
51     virtual void setStartTime(double monotonicTime) = 0;
52
53     virtual double timeOffset() const = 0;
54     virtual void setTimeOffset(double monotonicTime) = 0;
55
56     virtual Direction direction() const = 0;
57     virtual void setDirection(Direction) = 0;
58
59     virtual double playbackRate() const = 0;
60     virtual void setPlaybackRate(double) = 0;
61
62     virtual FillMode fillMode() const = 0;
63     virtual void setFillMode(FillMode)  = 0;
64
65     virtual double iterationStart() const = 0;
66     virtual void setIterationStart(double) = 0;
67 };
68
69 } // namespace blink
70
71 #endif // WebCompositorAnimation_h