ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / ui / events / ozone / evdev / device_event_dispatcher_evdev.h
bloba7dddce1d8ee494e129e477cd8183ddba88d9b9a
1 // Copyright 2015 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_DEVICE_EVENT_DISPATCHER_H_
6 #define UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_
8 #include <vector>
10 #include "base/time/time.h"
11 #include "ui/events/devices/input_device.h"
12 #include "ui/events/devices/keyboard_device.h"
13 #include "ui/events/devices/touchscreen_device.h"
14 #include "ui/events/event_constants.h"
15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
16 #include "ui/gfx/geometry/point_f.h"
17 #include "ui/gfx/geometry/vector2d.h"
18 #include "ui/gfx/geometry/vector2d_f.h"
20 namespace ui {
22 struct EVENTS_OZONE_EVDEV_EXPORT KeyEventParams {
23 KeyEventParams(int device_id,
24 unsigned int code,
25 bool down,
26 base::TimeDelta timestamp);
27 KeyEventParams(const KeyEventParams& other);
28 ~KeyEventParams();
30 int device_id;
31 unsigned int code;
32 bool down;
33 base::TimeDelta timestamp;
36 struct EVENTS_OZONE_EVDEV_EXPORT MouseMoveEventParams {
37 MouseMoveEventParams(int device_id,
38 const gfx::PointF& location,
39 base::TimeDelta timestamp);
40 MouseMoveEventParams(const MouseMoveEventParams& other);
41 ~MouseMoveEventParams();
43 int device_id;
44 gfx::PointF location;
45 base::TimeDelta timestamp;
48 struct EVENTS_OZONE_EVDEV_EXPORT MouseButtonEventParams {
49 MouseButtonEventParams(int device_id,
50 const gfx::PointF& location,
51 unsigned int button,
52 bool down,
53 bool allow_remap,
54 base::TimeDelta timestamp);
55 MouseButtonEventParams(const MouseButtonEventParams& other);
56 ~MouseButtonEventParams();
58 int device_id;
59 gfx::PointF location;
60 unsigned int button;
61 bool down;
62 bool allow_remap;
63 base::TimeDelta timestamp;
66 struct EVENTS_OZONE_EVDEV_EXPORT MouseWheelEventParams {
67 MouseWheelEventParams(int device_id,
68 const gfx::PointF& location,
69 const gfx::Vector2d& delta,
70 base::TimeDelta timestamp);
71 MouseWheelEventParams(const MouseWheelEventParams& other);
72 ~MouseWheelEventParams();
74 int device_id;
75 gfx::PointF location;
76 gfx::Vector2d delta;
77 base::TimeDelta timestamp;
80 struct EVENTS_OZONE_EVDEV_EXPORT ScrollEventParams {
81 ScrollEventParams(int device_id,
82 EventType type,
83 const gfx::PointF location,
84 const gfx::Vector2dF delta,
85 const gfx::Vector2dF ordinal_delta,
86 int finger_count,
87 const base::TimeDelta timestamp);
88 ScrollEventParams(const ScrollEventParams& other);
89 ~ScrollEventParams();
91 int device_id;
92 EventType type;
93 const gfx::PointF location;
94 const gfx::Vector2dF delta;
95 const gfx::Vector2dF ordinal_delta;
96 int finger_count;
97 const base::TimeDelta timestamp;
100 struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams {
101 TouchEventParams(int device_id,
102 int touch_id,
103 EventType type,
104 const gfx::PointF& location,
105 const gfx::Vector2dF& radii,
106 float pressure,
107 const base::TimeDelta& timestamp);
108 TouchEventParams(const TouchEventParams& other);
109 ~TouchEventParams();
111 int device_id;
112 int touch_id;
113 EventType type;
114 gfx::PointF location;
115 gfx::Vector2dF radii;
116 float pressure;
117 base::TimeDelta timestamp;
120 // Interface used by device objects for event dispatch.
121 class EVENTS_OZONE_EVDEV_EXPORT DeviceEventDispatcherEvdev {
122 public:
123 DeviceEventDispatcherEvdev() {}
124 virtual ~DeviceEventDispatcherEvdev() {}
126 // User input events.
127 virtual void DispatchKeyEvent(const KeyEventParams& params) = 0;
128 virtual void DispatchMouseMoveEvent(const MouseMoveEventParams& params) = 0;
129 virtual void DispatchMouseButtonEvent(
130 const MouseButtonEventParams& params) = 0;
131 virtual void DispatchMouseWheelEvent(const MouseWheelEventParams& params) = 0;
132 virtual void DispatchScrollEvent(const ScrollEventParams& params) = 0;
133 virtual void DispatchTouchEvent(const TouchEventParams& params) = 0;
135 // Device lifecycle events.
136 virtual void DispatchKeyboardDevicesUpdated(
137 const std::vector<KeyboardDevice>& devices) = 0;
138 virtual void DispatchTouchscreenDevicesUpdated(
139 const std::vector<TouchscreenDevice>& devices) = 0;
140 virtual void DispatchMouseDevicesUpdated(
141 const std::vector<InputDevice>& devices) = 0;
142 virtual void DispatchTouchpadDevicesUpdated(
143 const std::vector<InputDevice>& devices) = 0;
146 } // namespace ui
148 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_