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 15 matching lines...) Expand all Loading... |
63 | 66 |
64 private: | 67 private: |
65 // Set a property value for all devices of one type. | 68 // Set a property value for all devices of one type. |
66 void SetIntPropertyForOneType(const EventDeviceType type, | 69 void SetIntPropertyForOneType(const EventDeviceType type, |
67 const std::string& name, | 70 const std::string& name, |
68 int value); | 71 int value); |
69 void SetBoolPropertyForOneType(const EventDeviceType type, | 72 void SetBoolPropertyForOneType(const EventDeviceType type, |
70 const std::string& name, | 73 const std::string& name, |
71 bool value); | 74 bool value); |
72 | 75 |
73 // Event factory object which manages device event converters. | 76 // Factory for devices. Needed to update device config. |
74 EventFactoryEvdev* event_factory_; | 77 InputDeviceFactoryEvdev* input_device_factory_; |
75 | 78 |
76 // Keyboard state. | 79 // Keyboard state. |
77 KeyboardEvdev* keyboard_; | 80 KeyboardEvdev* keyboard_; |
78 | 81 |
79 // Mouse button map. | 82 // Mouse button map. |
80 MouseButtonMapEvdev* button_map_; | 83 MouseButtonMapEvdev* button_map_; |
81 | 84 |
82 #if defined(USE_EVDEV_GESTURES) | 85 #if defined(USE_EVDEV_GESTURES) |
83 // Gesture library property provider. | 86 // Gesture library property provider. |
84 GesturePropertyProvider* gesture_property_provider_; | 87 GesturePropertyProvider* gesture_property_provider_; |
85 #endif | 88 #endif |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev); | 90 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev); |
88 }; | 91 }; |
89 | 92 |
90 } // namespace ui | 93 } // namespace ui |
91 | 94 |
92 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ | 95 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ |
OLD | NEW |