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