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_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 28 matching lines...) Expand all Loading... |
39 scoped_refptr<base::SingleThreadTaskRunner> dispatch_runner, | 39 scoped_refptr<base::SingleThreadTaskRunner> dispatch_runner, |
40 CursorDelegateEvdev* cursor); | 40 CursorDelegateEvdev* cursor); |
41 ~InputDeviceFactoryEvdev(); | 41 ~InputDeviceFactoryEvdev(); |
42 | 42 |
43 // Open & start reading a newly plugged-in input device. | 43 // Open & start reading a newly plugged-in input device. |
44 void AddInputDevice(int id, const base::FilePath& path); | 44 void AddInputDevice(int id, const base::FilePath& path); |
45 | 45 |
46 // Stop reading & close an unplugged input device. | 46 // Stop reading & close an unplugged input device. |
47 void RemoveInputDevice(const base::FilePath& path); | 47 void RemoveInputDevice(const base::FilePath& path); |
48 | 48 |
49 // Get a list of device ids that matches a device type. Return true if the | |
50 // list is not empty. |device_ids| can be NULL. | |
51 bool GetDeviceIdsByType(const EventDeviceType type, | |
52 std::vector<int>* device_ids); | |
53 | |
54 // Disables the internal touchpad. | 49 // Disables the internal touchpad. |
55 void DisableInternalTouchpad(); | 50 void DisableInternalTouchpad(); |
56 | 51 |
57 // Enables the internal touchpad. | 52 // Enables the internal touchpad. |
58 void EnableInternalTouchpad(); | 53 void EnableInternalTouchpad(); |
59 | 54 |
60 // Disables all keys on the internal keyboard except |excepted_keys|. | 55 // Disables all keys on the internal keyboard except |excepted_keys|. |
61 void DisableInternalKeyboardExceptKeys( | 56 void DisableInternalKeyboardExceptKeys( |
62 scoped_ptr<std::set<DomCode>> excepted_keys); | 57 scoped_ptr<std::set<DomCode>> excepted_keys); |
63 | 58 |
64 // Enables all keys on the internal keyboard. | 59 // Enables all keys on the internal keyboard. |
65 void EnableInternalKeyboard(); | 60 void EnableInternalKeyboard(); |
66 | 61 |
67 // Bits from InputController that have to be answered on IO. | 62 // Bits from InputController that have to be answered on IO. |
68 bool HasMouse(); | |
69 bool HasTouchpad(); | |
70 void SetTouchpadSensitivity(int value); | 63 void SetTouchpadSensitivity(int value); |
71 void SetTapToClick(bool enabled); | 64 void SetTapToClick(bool enabled); |
72 void SetThreeFingerClick(bool enabled); | 65 void SetThreeFingerClick(bool enabled); |
73 void SetTapDragging(bool enabled); | 66 void SetTapDragging(bool enabled); |
74 void SetNaturalScroll(bool enabled); | 67 void SetNaturalScroll(bool enabled); |
75 void SetMouseSensitivity(int value); | 68 void SetMouseSensitivity(int value); |
76 void SetTapToClickPaused(bool state); | 69 void SetTapToClickPaused(bool state); |
77 | 70 |
78 private: | 71 private: |
79 // Open device at path & starting processing events (on UI thread). | 72 // Open device at path & starting processing events (on UI thread). |
80 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); | 73 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); |
81 | 74 |
82 // Close device at path (on UI thread). | 75 // Close device at path (on UI thread). |
83 void DetachInputDevice(const base::FilePath& file_path); | 76 void DetachInputDevice(const base::FilePath& file_path); |
84 | 77 |
85 // Update observers on device changes. | 78 // Update observers on device changes. |
86 void NotifyDeviceChange(const EventConverterEvdev& converter); | 79 void NotifyDeviceChange(const EventConverterEvdev& converter); |
87 void NotifyKeyboardsUpdated(); | 80 void NotifyKeyboardsUpdated(); |
88 void NotifyTouchscreensUpdated(); | 81 void NotifyTouchscreensUpdated(); |
| 82 void NotifyMouseDevicesUpdated(); |
| 83 void NotifyTouchpadDevicesUpdated(); |
89 | 84 |
90 void SetIntPropertyForOneType(const EventDeviceType type, | 85 void SetIntPropertyForOneType(const EventDeviceType type, |
91 const std::string& name, | 86 const std::string& name, |
92 int value); | 87 int value); |
93 void SetBoolPropertyForOneType(const EventDeviceType type, | 88 void SetBoolPropertyForOneType(const EventDeviceType type, |
94 const std::string& name, | 89 const std::string& name, |
95 bool value); | 90 bool value); |
96 | 91 |
97 // Owned per-device event converters (by path). | 92 // Owned per-device event converters (by path). |
98 std::map<base::FilePath, EventConverterEvdev*> converters_; | 93 std::map<base::FilePath, EventConverterEvdev*> converters_; |
(...skipping 14 matching lines...) Expand all Loading... |
113 | 108 |
114 // Support weak pointers for attach & detach callbacks. | 109 // Support weak pointers for attach & detach callbacks. |
115 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; | 110 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; |
116 | 111 |
117 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); | 112 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); |
118 }; | 113 }; |
119 | 114 |
120 } // namespace ui | 115 } // namespace ui |
121 | 116 |
122 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ | 117 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ |
OLD | NEW |