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_AURA_GESTURES_GESTURE_CONFIGURATION_H_ | 5 #ifndef UI_AURA_GESTURES_GESTURE_CONFIGURATION_H_ |
6 #define UI_AURA_GESTURES_GESTURE_CONFIGURATION_H_ | 6 #define UI_AURA_GESTURES_GESTURE_CONFIGURATION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
11 | 11 |
12 namespace aura { | 12 namespace aura { |
13 | 13 |
14 // TODO: Expand this design to support multiple OS configuration | 14 // TODO: Expand this design to support multiple OS configuration |
15 // approaches (windows, chrome, others). This would turn into an | 15 // approaches (windows, chrome, others). This would turn into an |
16 // abstract base class. | 16 // abstract base class. |
17 | 17 |
18 class AURA_EXPORT GestureConfiguration { | 18 class AURA_EXPORT GestureConfiguration { |
19 public: | 19 public: |
20 static double max_touch_down_duration_in_seconds_for_click() { | 20 // Ordered alphabetically ignoring underscores, to align with the |
21 return max_touch_down_duration_in_seconds_for_click_; | 21 // associated list of prefs in gesture_prefs_aura.cc. |
| 22 static double long_press_time_in_seconds() { |
| 23 return long_press_time_in_seconds_; |
22 } | 24 } |
23 static void set_max_touch_down_duration_in_seconds_for_click(double val) { | 25 static void set_long_press_time_in_seconds(double val) { |
24 max_touch_down_duration_in_seconds_for_click_ = val; | 26 long_press_time_in_seconds_ = val; |
25 } | |
26 static double min_touch_down_duration_in_seconds_for_click() { | |
27 return min_touch_down_duration_in_seconds_for_click_; | |
28 } | |
29 static void set_min_touch_down_duration_in_seconds_for_click(double val) { | |
30 min_touch_down_duration_in_seconds_for_click_ = val; | |
31 } | 27 } |
32 static double max_seconds_between_double_click() { | 28 static double max_seconds_between_double_click() { |
33 return max_seconds_between_double_click_; | 29 return max_seconds_between_double_click_; |
34 } | 30 } |
35 static void set_max_seconds_between_double_click(double val) { | 31 static void set_max_seconds_between_double_click(double val) { |
36 max_seconds_between_double_click_ = val; | 32 max_seconds_between_double_click_ = val; |
37 } | 33 } |
| 34 static int max_separation_for_gesture_touches_in_pixels() { |
| 35 return max_separation_for_gesture_touches_in_pixels_; |
| 36 } |
| 37 static void set_max_separation_for_gesture_touches_in_pixels(int val) { |
| 38 max_separation_for_gesture_touches_in_pixels_ = val; |
| 39 } |
| 40 static double max_touch_down_duration_in_seconds_for_click() { |
| 41 return max_touch_down_duration_in_seconds_for_click_; |
| 42 } |
| 43 static void set_max_touch_down_duration_in_seconds_for_click(double val) { |
| 44 max_touch_down_duration_in_seconds_for_click_ = val; |
| 45 } |
38 static double max_touch_move_in_pixels_for_click() { | 46 static double max_touch_move_in_pixels_for_click() { |
39 return max_touch_move_in_pixels_for_click_; | 47 return max_touch_move_in_pixels_for_click_; |
40 } | 48 } |
41 static void set_max_touch_move_in_pixels_for_click(double val) { | 49 static void set_max_touch_move_in_pixels_for_click(double val) { |
42 max_touch_move_in_pixels_for_click_ = val; | 50 max_touch_move_in_pixels_for_click_ = val; |
43 } | 51 } |
| 52 static double min_distance_for_pinch_scroll_in_pixels() { |
| 53 return min_distance_for_pinch_scroll_in_pixels_; |
| 54 } |
| 55 static void set_min_distance_for_pinch_scroll_in_pixels(double val) { |
| 56 min_distance_for_pinch_scroll_in_pixels_ = val; |
| 57 } |
44 static double min_flick_speed_squared() { | 58 static double min_flick_speed_squared() { |
45 return min_flick_speed_squared_; | 59 return min_flick_speed_squared_; |
46 } | 60 } |
47 static void set_min_flick_speed_squared(double val) { | 61 static void set_min_flick_speed_squared(double val) { |
48 min_flick_speed_squared_ = val; | 62 min_flick_speed_squared_ = val; |
49 } | 63 } |
50 static double minimum_pinch_update_distance_in_pixels() { | 64 static double min_pinch_update_distance_in_pixels() { |
51 return minimum_pinch_update_distance_in_pixels_; | 65 return min_pinch_update_distance_in_pixels_; |
52 } | 66 } |
53 static void set_minimum_pinch_update_distance_in_pixels(double val) { | 67 static void set_min_pinch_update_distance_in_pixels(double val) { |
54 minimum_pinch_update_distance_in_pixels_ = val; | 68 min_pinch_update_distance_in_pixels_ = val; |
55 } | 69 } |
56 static double minimum_distance_for_pinch_scroll_in_pixels() { | 70 static double min_rail_break_velocity() { |
57 return minimum_distance_for_pinch_scroll_in_pixels_; | 71 return min_rail_break_velocity_; |
58 } | 72 } |
59 static void set_minimum_distance_for_pinch_scroll_in_pixels(double val) { | 73 static void set_min_rail_break_velocity(double val) { |
60 minimum_distance_for_pinch_scroll_in_pixels_ = val; | 74 min_rail_break_velocity_ = val; |
61 } | 75 } |
62 | 76 static double min_scroll_delta_squared() { |
63 static int max_separation_for_gesture_touches_in_pixels() { | 77 return min_scroll_delta_squared_; |
64 return max_separation_for_gesture_touches_in_pixels_; | |
65 } | 78 } |
66 | 79 static void set_min_scroll_delta_squared(double val) { |
67 static void set_max_separation_for_gesture_touches_in_pixels(int val) { | 80 min_scroll_delta_squared_ = val; |
68 max_separation_for_gesture_touches_in_pixels_ = val; | 81 } |
| 82 static double min_touch_down_duration_in_seconds_for_click() { |
| 83 return min_touch_down_duration_in_seconds_for_click_; |
| 84 } |
| 85 static void set_min_touch_down_duration_in_seconds_for_click(double val) { |
| 86 min_touch_down_duration_in_seconds_for_click_ = val; |
| 87 } |
| 88 static int points_buffered_for_velocity() { |
| 89 return points_buffered_for_velocity_; |
| 90 } |
| 91 static void set_points_buffered_for_velocity(int val) { |
| 92 points_buffered_for_velocity_ = val; |
| 93 } |
| 94 static double rail_break_proportion() { |
| 95 return rail_break_proportion_; |
| 96 } |
| 97 static void set_rail_break_proportion(double val) { |
| 98 rail_break_proportion_ = val; |
| 99 } |
| 100 static double rail_start_proportion() { |
| 101 return rail_start_proportion_; |
| 102 } |
| 103 static void set_rail_start_proportion(double val) { |
| 104 rail_start_proportion_ = val; |
69 } | 105 } |
70 | 106 |
71 private: | 107 private: |
| 108 // These are listed in alphabetical order ignoring underscores, to |
| 109 // align with the associated list of preferences in |
| 110 // gesture_prefs_aura.cc. These two lists should be kept in sync. |
| 111 static double long_press_time_in_seconds_; |
| 112 static double max_seconds_between_double_click_; |
| 113 static double max_separation_for_gesture_touches_in_pixels_; |
72 static double max_touch_down_duration_in_seconds_for_click_; | 114 static double max_touch_down_duration_in_seconds_for_click_; |
| 115 static double max_touch_move_in_pixels_for_click_; |
| 116 static double min_distance_for_pinch_scroll_in_pixels_; |
| 117 static double min_flick_speed_squared_; |
| 118 static double min_pinch_update_distance_in_pixels_; |
| 119 static double min_rail_break_velocity_; |
| 120 static double min_scroll_delta_squared_; |
73 static double min_touch_down_duration_in_seconds_for_click_; | 121 static double min_touch_down_duration_in_seconds_for_click_; |
74 static double max_seconds_between_double_click_; | 122 static int points_buffered_for_velocity_; |
75 static double max_touch_move_in_pixels_for_click_; | 123 static double rail_break_proportion_; |
76 static double min_flick_speed_squared_; | 124 static double rail_start_proportion_; |
77 static double minimum_pinch_update_distance_in_pixels_; | |
78 static double minimum_distance_for_pinch_scroll_in_pixels_; | |
79 static int max_separation_for_gesture_touches_in_pixels_; | |
80 | 125 |
81 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); | 126 DISALLOW_COPY_AND_ASSIGN(GestureConfiguration); |
82 }; | 127 }; |
83 | 128 |
84 } // namespace aura | 129 } // namespace aura |
85 | 130 |
86 #endif // UI_AURA_GESTURES_GESTURE_CONFIGURATION_H_ | 131 #endif // UI_AURA_GESTURES_GESTURE_CONFIGURATION_H_ |
OLD | NEW |