OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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 ASH_WM_WORKSPACE_WORKSPACE_CYCLER_CONFIGURATION_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_CYCLER_CONFIGURATION_H_ |
| 7 |
| 8 #include "ash/ash_export.h" |
| 9 #include "base/basictypes.h" |
| 10 |
| 11 namespace base { |
| 12 class ListValue; |
| 13 } |
| 14 |
| 15 namespace ash { |
| 16 |
| 17 // Sets and retrieves properties related to cycling workspaces. |
| 18 class ASH_EXPORT WorkspaceCyclerConfiguration { |
| 19 public: |
| 20 enum Property { |
| 21 // The y offsets for the workspaces which are shallower than the selected |
| 22 // workspace with respect to the top of the screen workarea. The offset at |
| 23 // index 0 is for the workspace closest to the selected workspace. The size |
| 24 // of the ListValue limits the amount of visible workspaces shallower than |
| 25 // the selected workspace. |
| 26 SHALLOWER_THAN_SELECTED_Y_OFFSETS, |
| 27 |
| 28 // The y offsets for the workspaces which are deeper than the selected |
| 29 // workspace with respect to the bottom of the screen workarea. The offset |
| 30 // at index 0 is for the workspace closest to the selected workspace. The |
| 31 // size of the ListValue limits the amount of visible workspaces deeper |
| 32 // than the selected workspace. |
| 33 DEEPER_THAN_SELECTED_Y_OFFSETS, |
| 34 |
| 35 // The y offset of the selected workspace with respect to the top of the |
| 36 // screen workarea. |
| 37 SELECTED_Y_OFFSET, |
| 38 |
| 39 SELECTED_SCALE, |
| 40 MIN_SCALE, |
| 41 MAX_SCALE, |
| 42 MIN_BRIGHTNESS, |
| 43 |
| 44 // The background opacity while the user is cycling through workspaces. |
| 45 BACKGROUND_OPACITY, |
| 46 |
| 47 // The vertical scroll distance in pixels to initiate workspace cycling. |
| 48 DISTANCE_TO_INITIATE_CYCLING, |
| 49 |
| 50 // The vertical scroll distance in pixels to cycle to the next / previous |
| 51 // workspace. |
| 52 SCROLL_DISTANCE_TO_CYCLE_TO_NEXT_WORKSPACE, |
| 53 |
| 54 // The ratio of the duration of the animation in milliseconds to the amount |
| 55 // that the user has scrolled vertically in pixels. |
| 56 // The duration of the animation is computed by: distance_scrolled * ratio |
| 57 CYCLER_STEP_ANIMATION_DURATION_RATIO, |
| 58 |
| 59 // The duration in milliseconds of the animations when animating starting |
| 60 // the cycler. |
| 61 START_CYCLER_ANIMATION_DURATION, |
| 62 |
| 63 // The duration in milliseconds of the animations when animating stopping |
| 64 // the cycler. |
| 65 STOP_CYCLER_ANIMATION_DURATION, |
| 66 }; |
| 67 |
| 68 // Returns true if the cycler is enabled. |
| 69 static bool IsCyclerEnabled(); |
| 70 |
| 71 // Returns true if |property| is of type base::ListValue. |
| 72 static bool IsListProperty(Property property); |
| 73 |
| 74 // Sets |property| to |list_value|. |
| 75 static void SetListValue(Property property, |
| 76 const base::ListValue& list_value); |
| 77 |
| 78 // Sets |property| to |value|. |
| 79 static void SetDouble(Property property, double value); |
| 80 |
| 81 // Gets the ListValue associated with |property|. |
| 82 static const base::ListValue& GetListValue(Property property); |
| 83 |
| 84 // Gets the double associated with |property|. |
| 85 static double GetDouble(Property property); |
| 86 |
| 87 private: |
| 88 DISALLOW_IMPLICIT_CONSTRUCTORS(WorkspaceCyclerConfiguration); |
| 89 }; |
| 90 |
| 91 } // namespace ash |
| 92 |
| 93 #endif // ASH_WM_WORKSPACE_WORKSPACE_CYCLER_ANIMATOR_CONFIGURATION_H_ |
OLD | NEW |