Another take on menu's. This uses the hosting menu scroll view container as a menuba...
[chromium-blink-merge.git] / app / tween.h
blob8909906d54fcf3bfff7652e0f2587eb9666b6ce1
1 // Copyright (c) 2010 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.
5 #ifndef APP_TWEEN_H_
6 #define APP_TWEEN_H_
7 #pragma once
9 #include "base/basictypes.h"
11 namespace gfx {
12 class Rect;
15 class Tween {
16 public:
17 enum Type {
18 LINEAR, // Linear.
19 EASE_OUT, // Fast in, slow out (default).
20 EASE_IN, // Slow in, fast out.
21 EASE_IN_OUT, // Slow in and out, fast in the middle.
22 FAST_IN_OUT, // Fast in and out, slow in the middle.
23 EASE_OUT_SNAP, // Fast in, slow out, snap to final value.
24 ZERO, // Returns a value of 0 always.
27 // Returns the value based on the tween type. |state| is from 0-1.
28 static double CalculateValue(Type type, double state);
30 // Conveniences for getting a value between a start and end point.
31 static double ValueBetween(double value, double start, double target);
32 static int ValueBetween(double value, int start, int target);
33 static gfx::Rect ValueBetween(double value,
34 const gfx::Rect& start_bounds,
35 const gfx::Rect& target_bounds);
37 private:
38 Tween();
39 ~Tween();
41 DISALLOW_COPY_AND_ASSIGN(Tween);
44 #endif // APP_TWEEN_H_