| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_COREWM_WINDOW_ANIMATIONS_H_ | 5 #ifndef UI_WM_CORE_WINDOW_ANIMATIONS_H_ |
| 6 #define UI_VIEWS_COREWM_WINDOW_ANIMATIONS_H_ | 6 #define UI_WM_CORE_WINDOW_ANIMATIONS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ui/views/views_export.h" | 10 #include "ui/wm/core/wm_core_export.h" |
| 11 | 11 |
| 12 namespace aura { | 12 namespace aura { |
| 13 class Window; | 13 class Window; |
| 14 } | 14 } |
| 15 namespace base { | 15 namespace base { |
| 16 class TimeDelta; | 16 class TimeDelta; |
| 17 } | 17 } |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Rect; | 19 class Rect; |
| 20 } | 20 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 51 // Default behavior is to animate both show and hide. | 51 // Default behavior is to animate both show and hide. |
| 52 enum WindowVisibilityAnimationTransition { | 52 enum WindowVisibilityAnimationTransition { |
| 53 ANIMATE_SHOW = 0x1, | 53 ANIMATE_SHOW = 0x1, |
| 54 ANIMATE_HIDE = 0x2, | 54 ANIMATE_HIDE = 0x2, |
| 55 ANIMATE_BOTH = ANIMATE_SHOW | ANIMATE_HIDE, | 55 ANIMATE_BOTH = ANIMATE_SHOW | ANIMATE_HIDE, |
| 56 ANIMATE_NONE = 0x4, | 56 ANIMATE_NONE = 0x4, |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 // These two methods use int for type rather than WindowVisibilityAnimationType | 59 // These two methods use int for type rather than WindowVisibilityAnimationType |
| 60 // since downstream libraries can extend the set of animations. | 60 // since downstream libraries can extend the set of animations. |
| 61 VIEWS_EXPORT void SetWindowVisibilityAnimationType(aura::Window* window, | 61 WM_CORE_EXPORT void SetWindowVisibilityAnimationType(aura::Window* window, |
| 62 int type); | 62 int type); |
| 63 VIEWS_EXPORT int GetWindowVisibilityAnimationType(aura::Window* window); | 63 WM_CORE_EXPORT int GetWindowVisibilityAnimationType(aura::Window* window); |
| 64 | 64 |
| 65 VIEWS_EXPORT void SetWindowVisibilityAnimationTransition( | 65 WM_CORE_EXPORT void SetWindowVisibilityAnimationTransition( |
| 66 aura::Window* window, | 66 aura::Window* window, |
| 67 WindowVisibilityAnimationTransition transition); | 67 WindowVisibilityAnimationTransition transition); |
| 68 | 68 |
| 69 VIEWS_EXPORT bool HasWindowVisibilityAnimationTransition( | 69 WM_CORE_EXPORT bool HasWindowVisibilityAnimationTransition( |
| 70 aura::Window* window, | 70 aura::Window* window, |
| 71 WindowVisibilityAnimationTransition transition); | 71 WindowVisibilityAnimationTransition transition); |
| 72 | 72 |
| 73 VIEWS_EXPORT void SetWindowVisibilityAnimationDuration( | 73 WM_CORE_EXPORT void SetWindowVisibilityAnimationDuration( |
| 74 aura::Window* window, | 74 aura::Window* window, |
| 75 const base::TimeDelta& duration); | 75 const base::TimeDelta& duration); |
| 76 | 76 |
| 77 VIEWS_EXPORT base::TimeDelta GetWindowVisibilityAnimationDuration( | 77 WM_CORE_EXPORT base::TimeDelta GetWindowVisibilityAnimationDuration( |
| 78 const aura::Window& window); | 78 const aura::Window& window); |
| 79 | 79 |
| 80 VIEWS_EXPORT void SetWindowVisibilityAnimationVerticalPosition( | 80 WM_CORE_EXPORT void SetWindowVisibilityAnimationVerticalPosition( |
| 81 aura::Window* window, | 81 aura::Window* window, |
| 82 float position); | 82 float position); |
| 83 | 83 |
| 84 // Creates an ImplicitAnimationObserver that takes ownership of the layers | 84 // Creates an ImplicitAnimationObserver that takes ownership of the layers |
| 85 // associated with a Window so that the animation can continue after the Window | 85 // associated with a Window so that the animation can continue after the Window |
| 86 // has been destroyed. | 86 // has been destroyed. |
| 87 // The returned object deletes itself when the animations are done. | 87 // The returned object deletes itself when the animations are done. |
| 88 VIEWS_EXPORT ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( | 88 WM_CORE_EXPORT ui::ImplicitAnimationObserver* |
| 89 aura::Window* window); | 89 CreateHidingWindowAnimationObserver(aura::Window* window); |
| 90 | 90 |
| 91 // Returns false if the |window| didn't animate. | 91 // Returns false if the |window| didn't animate. |
| 92 VIEWS_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, | 92 WM_CORE_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, |
| 93 bool visible); | 93 bool visible); |
| 94 VIEWS_EXPORT bool AnimateWindow(aura::Window* window, WindowAnimationType type); | 94 WM_CORE_EXPORT bool AnimateWindow(aura::Window* window, |
| 95 WindowAnimationType type); |
| 95 | 96 |
| 96 // Returns true if window animations are disabled for |window|. Window | 97 // Returns true if window animations are disabled for |window|. Window |
| 97 // animations are enabled by default. If |window| is NULL, this just checks | 98 // animations are enabled by default. If |window| is NULL, this just checks |
| 98 // if the global flag disabling window animations is present. | 99 // if the global flag disabling window animations is present. |
| 99 VIEWS_EXPORT bool WindowAnimationsDisabled(aura::Window* window); | 100 WM_CORE_EXPORT bool WindowAnimationsDisabled(aura::Window* window); |
| 100 | 101 |
| 101 } // namespace corewm | 102 } // namespace corewm |
| 102 } // namespace views | 103 } // namespace views |
| 103 | 104 |
| 104 #endif // UI_VIEWS_COREWM_WINDOW_ANIMATIONS_H_ | 105 #endif // UI_WM_CORE_WINDOW_ANIMATIONS_H_ |
| OLD | NEW |