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_CONTROLLER_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "ui/events/ozone/evdev/event_device_info.h" | |
12 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
13 #include "ui/ozone/public/input_controller.h" | 12 #include "ui/ozone/public/input_controller.h" |
14 | 13 |
15 namespace ui { | 14 namespace ui { |
16 | 15 |
17 class InputDeviceFactoryEvdev; | 16 class InputDeviceFactoryEvdev; |
18 class KeyboardEvdev; | 17 class KeyboardEvdev; |
19 class MouseButtonMapEvdev; | 18 class MouseButtonMapEvdev; |
20 | 19 |
21 #if defined(USE_EVDEV_GESTURES) | |
22 class GesturePropertyProvider; | |
23 #endif | |
24 | |
25 // Ozone InputController implementation for the Linux input subsystem ("evdev"). | 20 // Ozone InputController implementation for the Linux input subsystem ("evdev"). |
26 class EVENTS_OZONE_EVDEV_EXPORT InputControllerEvdev : public InputController { | 21 class EVENTS_OZONE_EVDEV_EXPORT InputControllerEvdev : public InputController { |
27 public: | 22 public: |
28 InputControllerEvdev(KeyboardEvdev* keyboard, | 23 InputControllerEvdev(KeyboardEvdev* keyboard, |
29 MouseButtonMapEvdev* button_map | 24 MouseButtonMapEvdev* button_map); |
30 #if defined(USE_EVDEV_GESTURES) | |
31 , | |
32 GesturePropertyProvider* gesture_property_provider | |
33 #endif | |
34 ); | |
35 ~InputControllerEvdev() override; | 25 ~InputControllerEvdev() override; |
36 | 26 |
37 // Initialize device factory. This would be in the constructor if it was | 27 // Initialize device factory. This would be in the constructor if it was |
38 // built early enough for that to be possible. | 28 // built early enough for that to be possible. |
39 void SetInputDeviceFactory(InputDeviceFactoryEvdev* input_device_factory); | 29 void SetInputDeviceFactory(InputDeviceFactoryEvdev* input_device_factory); |
40 | 30 |
41 // InputController: | 31 // InputController: |
42 bool HasMouse() override; | 32 bool HasMouse() override; |
43 bool HasTouchpad() override; | 33 bool HasTouchpad() override; |
44 bool IsCapsLockEnabled() override; | 34 bool IsCapsLockEnabled() override; |
(...skipping 13 matching lines...) Expand all Loading... |
58 void SetMouseSensitivity(int value) override; | 48 void SetMouseSensitivity(int value) override; |
59 void SetPrimaryButtonRight(bool right) override; | 49 void SetPrimaryButtonRight(bool right) override; |
60 void SetTapToClickPaused(bool state) override; | 50 void SetTapToClickPaused(bool state) override; |
61 void DisableInternalTouchpad() override; | 51 void DisableInternalTouchpad() override; |
62 void EnableInternalTouchpad() override; | 52 void EnableInternalTouchpad() override; |
63 void DisableInternalKeyboardExceptKeys( | 53 void DisableInternalKeyboardExceptKeys( |
64 scoped_ptr<std::set<DomCode>> excepted_keys) override; | 54 scoped_ptr<std::set<DomCode>> excepted_keys) override; |
65 void EnableInternalKeyboard() override; | 55 void EnableInternalKeyboard() override; |
66 | 56 |
67 private: | 57 private: |
68 // Set a property value for all devices of one type. | |
69 void SetIntPropertyForOneType(const EventDeviceType type, | |
70 const std::string& name, | |
71 int value); | |
72 void SetBoolPropertyForOneType(const EventDeviceType type, | |
73 const std::string& name, | |
74 bool value); | |
75 | |
76 // Factory for devices. Needed to update device config. | 58 // Factory for devices. Needed to update device config. |
77 InputDeviceFactoryEvdev* input_device_factory_; | 59 InputDeviceFactoryEvdev* input_device_factory_; |
78 | 60 |
79 // Keyboard state. | 61 // Keyboard state. |
80 KeyboardEvdev* keyboard_; | 62 KeyboardEvdev* keyboard_; |
81 | 63 |
82 // Mouse button map. | 64 // Mouse button map. |
83 MouseButtonMapEvdev* button_map_; | 65 MouseButtonMapEvdev* button_map_; |
84 | 66 |
85 #if defined(USE_EVDEV_GESTURES) | |
86 // Gesture library property provider. | |
87 GesturePropertyProvider* gesture_property_provider_; | |
88 #endif | |
89 | |
90 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev); | 67 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev); |
91 }; | 68 }; |
92 | 69 |
93 } // namespace ui | 70 } // namespace ui |
94 | 71 |
95 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ | 72 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ |
OLD | NEW |