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" | 11 #include "ui/events/ozone/evdev/event_device_info.h" |
12 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 12 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
13 #include "ui/ozone/public/input_controller.h" | 13 #include "ui/ozone/public/input_controller.h" |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 | 16 |
17 class EventFactoryEvdev; | 17 class InputDeviceFactoryEvdev; |
18 class KeyboardEvdev; | 18 class KeyboardEvdev; |
19 class MouseButtonMapEvdev; | 19 class MouseButtonMapEvdev; |
20 | 20 |
21 #if defined(USE_EVDEV_GESTURES) | 21 #if defined(USE_EVDEV_GESTURES) |
22 class GesturePropertyProvider; | 22 class GesturePropertyProvider; |
23 #endif | 23 #endif |
24 | 24 |
25 // Ozone InputController implementation for the Linux input subsystem ("evdev"). | 25 // Ozone InputController implementation for the Linux input subsystem ("evdev"). |
26 class EVENTS_OZONE_EVDEV_EXPORT InputControllerEvdev : public InputController { | 26 class EVENTS_OZONE_EVDEV_EXPORT InputControllerEvdev : public InputController { |
27 public: | 27 public: |
28 InputControllerEvdev(EventFactoryEvdev* event_factory, | 28 InputControllerEvdev(KeyboardEvdev* keyboard, |
29 KeyboardEvdev* keyboard, | |
30 MouseButtonMapEvdev* button_map | 29 MouseButtonMapEvdev* button_map |
31 #if defined(USE_EVDEV_GESTURES) | 30 #if defined(USE_EVDEV_GESTURES) |
32 , | 31 , |
33 GesturePropertyProvider* gesture_property_provider | 32 GesturePropertyProvider* gesture_property_provider |
34 #endif | 33 #endif |
35 ); | 34 ); |
36 ~InputControllerEvdev() override; | 35 ~InputControllerEvdev() override; |
37 | 36 |
| 37 // Initialize device factory. This would be in the constructor if it was |
| 38 // built early enough for that to be possible. |
| 39 void SetInputDeviceFactory(InputDeviceFactoryEvdev* input_device_factory); |
| 40 |
38 // InputController: | 41 // InputController: |
39 bool HasMouse() override; | 42 bool HasMouse() override; |
40 bool HasTouchpad() override; | 43 bool HasTouchpad() override; |
41 bool IsCapsLockEnabled() override; | 44 bool IsCapsLockEnabled() override; |
42 void SetCapsLockEnabled(bool enabled) override; | 45 void SetCapsLockEnabled(bool enabled) override; |
43 void SetNumLockEnabled(bool enabled) override; | 46 void SetNumLockEnabled(bool enabled) override; |
44 bool IsAutoRepeatEnabled() override; | 47 bool IsAutoRepeatEnabled() override; |
45 void SetAutoRepeatEnabled(bool enabled) override; | 48 void SetAutoRepeatEnabled(bool enabled) override; |
46 void SetAutoRepeatRate(const base::TimeDelta& delay, | 49 void SetAutoRepeatRate(const base::TimeDelta& delay, |
47 const base::TimeDelta& interval) override; | 50 const base::TimeDelta& interval) override; |
(...skipping 16 matching lines...) Expand all Loading... |
64 | 67 |
65 private: | 68 private: |
66 // Set a property value for all devices of one type. | 69 // Set a property value for all devices of one type. |
67 void SetIntPropertyForOneType(const EventDeviceType type, | 70 void SetIntPropertyForOneType(const EventDeviceType type, |
68 const std::string& name, | 71 const std::string& name, |
69 int value); | 72 int value); |
70 void SetBoolPropertyForOneType(const EventDeviceType type, | 73 void SetBoolPropertyForOneType(const EventDeviceType type, |
71 const std::string& name, | 74 const std::string& name, |
72 bool value); | 75 bool value); |
73 | 76 |
74 // Event factory object which manages device event converters. | 77 // Factory for devices. Needed to update device config. |
75 EventFactoryEvdev* event_factory_; | 78 InputDeviceFactoryEvdev* input_device_factory_; |
76 | 79 |
77 // Keyboard state. | 80 // Keyboard state. |
78 KeyboardEvdev* keyboard_; | 81 KeyboardEvdev* keyboard_; |
79 | 82 |
80 // Mouse button map. | 83 // Mouse button map. |
81 MouseButtonMapEvdev* button_map_; | 84 MouseButtonMapEvdev* button_map_; |
82 | 85 |
83 #if defined(USE_EVDEV_GESTURES) | 86 #if defined(USE_EVDEV_GESTURES) |
84 // Gesture library property provider. | 87 // Gesture library property provider. |
85 GesturePropertyProvider* gesture_property_provider_; | 88 GesturePropertyProvider* gesture_property_provider_; |
86 #endif | 89 #endif |
87 | 90 |
88 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev); | 91 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev); |
89 }; | 92 }; |
90 | 93 |
91 } // namespace ui | 94 } // namespace ui |
92 | 95 |
93 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ | 96 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ |
OLD | NEW |