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_WIDGET_WIDGET_H_ | 5 #ifndef UI_VIEWS_WIDGET_WIDGET_H_ |
6 #define UI_VIEWS_WIDGET_WIDGET_H_ | 6 #define UI_VIEWS_WIDGET_WIDGET_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <stack> | 9 #include <stack> |
10 #include <vector> | 10 #include <vector> |
(...skipping 19 matching lines...) Expand all Loading... |
30 #undef IsMaximized | 30 #undef IsMaximized |
31 #endif | 31 #endif |
32 #if defined(IsMinimized) | 32 #if defined(IsMinimized) |
33 #undef IsMinimized | 33 #undef IsMinimized |
34 #endif | 34 #endif |
35 #if defined(CreateWindow) | 35 #if defined(CreateWindow) |
36 #undef CreateWindow | 36 #undef CreateWindow |
37 #endif | 37 #endif |
38 #endif | 38 #endif |
39 | 39 |
| 40 namespace base { |
| 41 class TimeDelta; |
| 42 } |
| 43 |
40 namespace gfx { | 44 namespace gfx { |
41 class Canvas; | 45 class Canvas; |
42 class Point; | 46 class Point; |
43 class Rect; | 47 class Rect; |
44 } | 48 } |
45 | 49 |
46 namespace ui { | 50 namespace ui { |
47 class Accelerator; | 51 class Accelerator; |
48 class Compositor; | 52 class Compositor; |
49 class DefaultThemeProvider; | 53 class DefaultThemeProvider; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 130 |
127 // Behavior when escape is pressed during a move loop. | 131 // Behavior when escape is pressed during a move loop. |
128 enum MoveLoopEscapeBehavior { | 132 enum MoveLoopEscapeBehavior { |
129 // Indicates the window should be hidden. | 133 // Indicates the window should be hidden. |
130 MOVE_LOOP_ESCAPE_BEHAVIOR_HIDE, | 134 MOVE_LOOP_ESCAPE_BEHAVIOR_HIDE, |
131 | 135 |
132 // Indicates the window should not be hidden. | 136 // Indicates the window should not be hidden. |
133 MOVE_LOOP_ESCAPE_BEHAVIOR_DONT_HIDE, | 137 MOVE_LOOP_ESCAPE_BEHAVIOR_DONT_HIDE, |
134 }; | 138 }; |
135 | 139 |
| 140 // Type of visibility change transition that should animate. |
| 141 enum VisibilityTransition { |
| 142 ANIMATE_SHOW = 0x1, |
| 143 ANIMATE_HIDE = 0x2, |
| 144 ANIMATE_BOTH = ANIMATE_SHOW | ANIMATE_HIDE, |
| 145 ANIMATE_NONE = 0x4, |
| 146 }; |
| 147 |
136 struct VIEWS_EXPORT InitParams { | 148 struct VIEWS_EXPORT InitParams { |
137 enum Type { | 149 enum Type { |
138 TYPE_WINDOW, // A decorated Window, like a frame window. | 150 TYPE_WINDOW, // A decorated Window, like a frame window. |
139 // Widgets of TYPE_WINDOW will have a NonClientView. | 151 // Widgets of TYPE_WINDOW will have a NonClientView. |
140 TYPE_PANEL, // Always on top window managed by PanelManager. | 152 TYPE_PANEL, // Always on top window managed by PanelManager. |
141 // Widgets of TYPE_PANEL will have a NonClientView. | 153 // Widgets of TYPE_PANEL will have a NonClientView. |
142 TYPE_WINDOW_FRAMELESS, | 154 TYPE_WINDOW_FRAMELESS, |
143 // An undecorated Window. | 155 // An undecorated Window. |
144 TYPE_CONTROL, // A control, like a button. | 156 TYPE_CONTROL, // A control, like a button. |
145 TYPE_POPUP, // An undecorated Window, with transient properties. | 157 TYPE_POPUP, // An undecorated Window, with transient properties. |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 425 |
414 // Like SetBounds(), but ensures the Widget is fully visible on screen, | 426 // Like SetBounds(), but ensures the Widget is fully visible on screen, |
415 // resizing and/or repositioning as necessary. This is only useful for | 427 // resizing and/or repositioning as necessary. This is only useful for |
416 // non-child widgets. | 428 // non-child widgets. |
417 void SetBoundsConstrained(const gfx::Rect& bounds); | 429 void SetBoundsConstrained(const gfx::Rect& bounds); |
418 | 430 |
419 // Sets whether animations that occur when visibility is changed are enabled. | 431 // Sets whether animations that occur when visibility is changed are enabled. |
420 // Default is true. | 432 // Default is true. |
421 void SetVisibilityChangedAnimationsEnabled(bool value); | 433 void SetVisibilityChangedAnimationsEnabled(bool value); |
422 | 434 |
| 435 // Sets the duration of visibility change animations. |
| 436 void SetVisibilityAnimationDuration(const base::TimeDelta& duration); |
| 437 |
| 438 // Sets the visibility transitions that should animate. |
| 439 // Default behavior is to animate both show and hide. |
| 440 void SetVisibilityAnimationTransition(VisibilityTransition transition); |
| 441 |
423 // Starts a nested message loop that moves the window. This can be used to | 442 // Starts a nested message loop that moves the window. This can be used to |
424 // start a window move operation from a mouse or touch event. This returns | 443 // start a window move operation from a mouse or touch event. This returns |
425 // when the move completes. |drag_offset| is the offset from the top left | 444 // when the move completes. |drag_offset| is the offset from the top left |
426 // corner of the window to the point where the cursor is dragging, and is used | 445 // corner of the window to the point where the cursor is dragging, and is used |
427 // to offset the bounds of the window from the cursor. | 446 // to offset the bounds of the window from the cursor. |
428 MoveLoopResult RunMoveLoop(const gfx::Vector2d& drag_offset, | 447 MoveLoopResult RunMoveLoop(const gfx::Vector2d& drag_offset, |
429 MoveLoopSource source, | 448 MoveLoopSource source, |
430 MoveLoopEscapeBehavior escape_behavior); | 449 MoveLoopEscapeBehavior escape_behavior); |
431 | 450 |
432 // Stops a previously started move loop. This is not immediate. | 451 // Stops a previously started move loop. This is not immediate. |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 bool movement_disabled_; | 971 bool movement_disabled_; |
953 | 972 |
954 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; | 973 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; |
955 | 974 |
956 DISALLOW_COPY_AND_ASSIGN(Widget); | 975 DISALLOW_COPY_AND_ASSIGN(Widget); |
957 }; | 976 }; |
958 | 977 |
959 } // namespace views | 978 } // namespace views |
960 | 979 |
961 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 980 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |