3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
7 <link rel="import" href="/tvcm.html">
11 tvcm.exportTo('tvcm.ui', function() {
13 * Represents a procedural animation that can be run by an
14 * tvcm.ui.AnimationController.
18 function Animation() {
21 Animation.prototype = {
24 * Called when an animation has been queued after a running animation.
26 * @return {boolean} True if the animation can take on the responsibilities
27 * of the running animation. If true, takeOverFor will be called on the
30 * This can be used to build animations that accelerate as pairs of them are
33 canTakeOverFor: function(existingAnimation) {
34 throw new Error('Not implemented');
38 * Called to take over responsiblities of an existingAnimation.
40 * At this point, the existingAnimation has been ticked one last time, then
41 * stopped. This animation will be started after this returns and has the
42 * job of finishing(or transitioning away from) the effect the existing
43 * animation was trying to accomplish.
45 takeOverFor: function(existingAnimation, newStartTimestamp, target) {
46 throw new Error('Not implemented');
49 start: function(timestamp, target) {
50 throw new Error('Not implemented');
54 * Called when an animation is stopped before it finishes. The animation can
55 * do what it wants here, usually nothing.
57 * @param {Number} timestamp When the animation was stopped.
58 * @param {Object} target The object being animated. May be undefined, take
60 * @param {boolean} willBeTakenOverByAnotherAnimation Whether this animation
61 * is going to be handed to another animation's takeOverFor function.
63 didStopEarly: function(timestamp, target,
64 willBeTakenOverByAnotherAnimation) {
68 * @return {boolean} true if the animation is finished.
70 tick: function(timestamp, target) {
71 throw new Error('Not implemented');