OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_OZONE_PUBLIC_INPUT_CONTROLLER_H_ | 5 #ifndef UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ |
6 #define UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ | 6 #define UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ |
7 | 7 |
| 8 #include <set> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "ui/events/keycodes/keyboard_codes.h" |
10 #include "ui/ozone/ozone_export.h" | 13 #include "ui/ozone/ozone_export.h" |
11 | 14 |
12 namespace ui { | 15 namespace ui { |
13 | 16 |
14 // Platform-specific interface for controlling input devices. | 17 // Platform-specific interface for controlling input devices. |
15 // | 18 // |
16 // The object provides methods for the preference page to configure input | 19 // The object provides methods for the preference page to configure input |
17 // devices w.r.t. the user setting. On ChromeOS, this replaces the inputcontrol | 20 // devices w.r.t. the user setting. On ChromeOS, this replaces the inputcontrol |
18 // script that is originally located at /opt/google/chrome/. | 21 // script that is originally located at /opt/google/chrome/. |
19 class OZONE_EXPORT InputController { | 22 class OZONE_EXPORT InputController { |
20 public: | 23 public: |
21 InputController() {} | 24 InputController() {} |
22 virtual ~InputController() {} | 25 virtual ~InputController() {} |
23 | 26 |
24 // Functions for checking devices existence. | 27 // Functions for checking devices existence. |
25 virtual bool HasMouse() = 0; | 28 virtual bool HasMouse() = 0; |
26 virtual bool HasTouchpad() = 0; | 29 virtual bool HasTouchpad() = 0; |
27 | 30 |
| 31 // Disables the internal touchpad. |
| 32 virtual void DisableInternalTouchpad() = 0; |
| 33 |
| 34 // Enables the internal touchpad. |
| 35 virtual void EnableInternalTouchpad() = 0; |
| 36 |
| 37 // Disables all keys on the internal keyboard except |excepted_keys|. |
| 38 virtual void DisableInternalKeyboardExceptKeys( |
| 39 scoped_ptr<std::set<KeyboardCode>> excepted_keys) = 0; |
| 40 |
| 41 // Enables all keys on the internal keyboard. |
| 42 virtual void EnableInternalKeyboard() = 0; |
| 43 |
28 // Functions for changing device settings. | 44 // Functions for changing device settings. |
29 // | 45 // |
30 // See c/b/c/system/input_device_settings.h for more context. | 46 // See c/b/c/system/input_device_settings.h for more context. |
31 virtual void SetTouchpadSensitivity(int value) = 0; | 47 virtual void SetTouchpadSensitivity(int value) = 0; |
32 virtual void SetTapToClick(bool enabled) = 0; | 48 virtual void SetTapToClick(bool enabled) = 0; |
33 virtual void SetThreeFingerClick(bool enabled) = 0; | 49 virtual void SetThreeFingerClick(bool enabled) = 0; |
34 virtual void SetTapDragging(bool enabled) = 0; | 50 virtual void SetTapDragging(bool enabled) = 0; |
35 virtual void SetNaturalScroll(bool enabled) = 0; | 51 virtual void SetNaturalScroll(bool enabled) = 0; |
36 virtual void SetMouseSensitivity(int value) = 0; | 52 virtual void SetMouseSensitivity(int value) = 0; |
37 virtual void SetPrimaryButtonRight(bool right) = 0; | 53 virtual void SetPrimaryButtonRight(bool right) = 0; |
38 | 54 |
39 private: | 55 private: |
40 DISALLOW_COPY_AND_ASSIGN(InputController); | 56 DISALLOW_COPY_AND_ASSIGN(InputController); |
41 }; | 57 }; |
42 | 58 |
43 // Create an input controller that does nothing. | 59 // Create an input controller that does nothing. |
44 OZONE_EXPORT scoped_ptr<InputController> CreateStubInputController(); | 60 OZONE_EXPORT scoped_ptr<InputController> CreateStubInputController(); |
45 | 61 |
46 } // namespace ui | 62 } // namespace ui |
47 | 63 |
48 #endif // UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ | 64 #endif // UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ |
OLD | NEW |