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