Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / events / ozone / evdev / input_controller_evdev.h
blob9d5c134dbb1ca7d1b735b2b4a0c2d492067ef924
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
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/memory/weak_ptr.h"
12 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
13 #include "ui/events/ozone/evdev/input_device_settings_evdev.h"
14 #include "ui/ozone/public/input_controller.h"
16 namespace ui {
18 class InputDeviceFactoryEvdevProxy;
19 class KeyboardEvdev;
20 class MouseButtonMapEvdev;
22 // Ozone InputController implementation for the Linux input subsystem ("evdev").
23 class EVENTS_OZONE_EVDEV_EXPORT InputControllerEvdev : public InputController {
24 public:
25 InputControllerEvdev(KeyboardEvdev* keyboard,
26 MouseButtonMapEvdev* button_map);
27 ~InputControllerEvdev() override;
29 // Initialize device factory. This would be in the constructor if it was
30 // built early enough for that to be possible.
31 void SetInputDeviceFactory(
32 InputDeviceFactoryEvdevProxy* input_device_factory);
34 void set_has_mouse(bool has_mouse);
35 void set_has_touchpad(bool has_touchpad);
37 void SetInputDevicesEnabled(bool enabled);
39 // InputController:
40 bool HasMouse() override;
41 bool HasTouchpad() override;
42 bool IsCapsLockEnabled() override;
43 void SetCapsLockEnabled(bool enabled) override;
44 void SetNumLockEnabled(bool enabled) override;
45 bool IsAutoRepeatEnabled() override;
46 void SetAutoRepeatEnabled(bool enabled) override;
47 void SetAutoRepeatRate(const base::TimeDelta& delay,
48 const base::TimeDelta& interval) override;
49 void GetAutoRepeatRate(base::TimeDelta* delay,
50 base::TimeDelta* interval) override;
51 void SetTouchEventLoggingEnabled(bool enabled) override;
52 void SetTouchpadSensitivity(int value) override;
53 void SetTapToClick(bool enabled) override;
54 void SetThreeFingerClick(bool enabled) override;
55 void SetTapDragging(bool enabled) override;
56 void SetNaturalScroll(bool enabled) override;
57 void SetMouseSensitivity(int value) override;
58 void SetPrimaryButtonRight(bool right) override;
59 void SetTapToClickPaused(bool state) override;
60 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply) override;
61 void GetTouchEventLog(const base::FilePath& out_dir,
62 const GetTouchEventLogReply& reply) override;
63 void SetInternalTouchpadEnabled(bool enabled) override;
64 void SetInternalKeyboardFilter(bool enable_filter,
65 std::vector<DomCode> allowed_keys) override;
67 private:
68 // Post task to update settings.
69 void ScheduleUpdateDeviceSettings();
71 // Send settings update to input_device_factory_.
72 void UpdateDeviceSettings();
74 // Send caps lock update to input_device_factory_.
75 void UpdateCapsLockLed();
77 // Configuration that needs to be passed on to InputDeviceFactory.
78 InputDeviceSettingsEvdev input_device_settings_;
80 // Task to update config from input_device_settings_ is pending.
81 bool settings_update_pending_ = false;
83 // Factory for devices. Needed to update device config.
84 InputDeviceFactoryEvdevProxy* input_device_factory_ = nullptr;
86 // Keyboard state.
87 KeyboardEvdev* keyboard_;
89 // Mouse button map.
90 MouseButtonMapEvdev* button_map_;
92 // Device presence.
93 bool has_mouse_ = false;
94 bool has_touchpad_ = false;
96 // LED state.
97 bool caps_lock_led_state_ = false;
99 base::WeakPtrFactory<InputControllerEvdev> weak_ptr_factory_;
101 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev);
104 } // namespace ui
106 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_