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 CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 void SetTapToClick(bool enabled); | 90 void SetTapToClick(bool enabled); |
91 bool GetTapToClick() const; | 91 bool GetTapToClick() const; |
92 | 92 |
93 void SetThreeFingerClick(bool enabled); | 93 void SetThreeFingerClick(bool enabled); |
94 bool GetThreeFingerClick() const; | 94 bool GetThreeFingerClick() const; |
95 | 95 |
96 void SetTapDragging(bool enabled); | 96 void SetTapDragging(bool enabled); |
97 bool GetTapDragging() const; | 97 bool GetTapDragging() const; |
98 | 98 |
| 99 void SetNaturalScroll(bool enabled); |
| 100 bool GetNaturalScroll() const; |
| 101 |
99 // Updates |this| with |settings|. If at least one setting was updated returns | 102 // Updates |this| with |settings|. If at least one setting was updated returns |
100 // true. | 103 // true. |
101 // |argv| is filled with arguments of script, that should be launched in order | 104 // |argv| is filled with arguments of script, that should be launched in order |
102 // to apply update. This argument is optional and could be NULL. | 105 // to apply update. This argument is optional and could be NULL. |
103 bool Update(const TouchpadSettings& settings, std::vector<std::string>* argv); | 106 bool Update(const TouchpadSettings& settings, std::vector<std::string>* argv); |
104 | 107 |
105 private: | 108 private: |
106 internal::Optional<int> sensitivity_; | 109 internal::Optional<int> sensitivity_; |
107 internal::Optional<bool> tap_to_click_; | 110 internal::Optional<bool> tap_to_click_; |
108 internal::Optional<bool> three_finger_click_; | 111 internal::Optional<bool> three_finger_click_; |
109 internal::Optional<bool> tap_dragging_; | 112 internal::Optional<bool> tap_dragging_; |
| 113 internal::Optional<bool> natural_scroll_; |
110 }; | 114 }; |
111 | 115 |
112 // Auxiliary class used to update several mouse settings at a time. User | 116 // Auxiliary class used to update several mouse settings at a time. User |
113 // should set any number of settings and pass object to UpdateMouseSettings | 117 // should set any number of settings and pass object to UpdateMouseSettings |
114 // method of InputDeviceSettings. | 118 // method of InputDeviceSettings. |
115 // Objects of this class have no default values for settings, so it is error | 119 // Objects of this class have no default values for settings, so it is error |
116 // to call Get* method before calling corresponding Set* method at least | 120 // to call Get* method before calling corresponding Set* method at least |
117 // once. | 121 // once. |
118 class MouseSettings { | 122 class MouseSettings { |
119 public: | 123 public: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 170 |
167 // Turns tap to click on/off. | 171 // Turns tap to click on/off. |
168 virtual void SetTapToClick(bool enabled) = 0; | 172 virtual void SetTapToClick(bool enabled) = 0; |
169 | 173 |
170 // Switch for three-finger click. | 174 // Switch for three-finger click. |
171 virtual void SetThreeFingerClick(bool enabled) = 0; | 175 virtual void SetThreeFingerClick(bool enabled) = 0; |
172 | 176 |
173 // Turns tap-dragging on/off. | 177 // Turns tap-dragging on/off. |
174 virtual void SetTapDragging(bool enabled) = 0; | 178 virtual void SetTapDragging(bool enabled) = 0; |
175 | 179 |
| 180 // Turns natural scrolling on/off for all devices except wheel mice |
| 181 virtual void SetNaturalScroll(bool enabled) = 0; |
| 182 |
176 // Calls |callback| asynchronously after determining if a mouse is connected. | 183 // Calls |callback| asynchronously after determining if a mouse is connected. |
177 virtual void MouseExists(const DeviceExistsCallback& callback) = 0; | 184 virtual void MouseExists(const DeviceExistsCallback& callback) = 0; |
178 | 185 |
179 // Updates several mouse settings at a time. Updates only settings that | 186 // Updates several mouse settings at a time. Updates only settings that |
180 // are set in |settings| object. It is more efficient to use this method to | 187 // are set in |settings| object. It is more efficient to use this method to |
181 // update several settings then calling Set* methods one by one. | 188 // update several settings then calling Set* methods one by one. |
182 virtual void UpdateMouseSettings(const MouseSettings& settings) = 0; | 189 virtual void UpdateMouseSettings(const MouseSettings& settings) = 0; |
183 | 190 |
184 // Sets the mouse sensitivity in the range [kMinPointerSensitivity, | 191 // Sets the mouse sensitivity in the range [kMinPointerSensitivity, |
185 // kMaxPointerSensitivity]. | 192 // kMaxPointerSensitivity]. |
(...skipping 10 matching lines...) Expand all Loading... |
196 virtual void ReapplyTouchpadSettings() = 0; | 203 virtual void ReapplyTouchpadSettings() = 0; |
197 | 204 |
198 // Reapplies previously set mouse settings. | 205 // Reapplies previously set mouse settings. |
199 virtual void ReapplyMouseSettings() = 0; | 206 virtual void ReapplyMouseSettings() = 0; |
200 }; | 207 }; |
201 | 208 |
202 } // namespace system | 209 } // namespace system |
203 } // namespace chromeos | 210 } // namespace chromeos |
204 | 211 |
205 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ | 212 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ |
OLD | NEW |