Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / events / ozone / evdev / device_event_dispatcher_evdev.h
blobd70fcbb1a88c726c0d70025c0303a686f4431973
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 bool suppress_auto_repeat,
27 base::TimeDelta timestamp);
28 KeyEventParams(const KeyEventParams& other);
29 ~KeyEventParams();
31 int device_id;
32 unsigned int code;
33 bool down;
34 bool suppress_auto_repeat;
35 base::TimeDelta timestamp;
38 struct EVENTS_OZONE_EVDEV_EXPORT MouseMoveEventParams {
39 MouseMoveEventParams(int device_id,
40 const gfx::PointF& location,
41 base::TimeDelta timestamp);
42 MouseMoveEventParams(const MouseMoveEventParams& other);
43 ~MouseMoveEventParams();
45 int device_id;
46 gfx::PointF location;
47 base::TimeDelta timestamp;
50 struct EVENTS_OZONE_EVDEV_EXPORT MouseButtonEventParams {
51 MouseButtonEventParams(int device_id,
52 const gfx::PointF& location,
53 unsigned int button,
54 bool down,
55 bool allow_remap,
56 base::TimeDelta timestamp);
57 MouseButtonEventParams(const MouseButtonEventParams& other);
58 ~MouseButtonEventParams();
60 int device_id;
61 gfx::PointF location;
62 unsigned int button;
63 bool down;
64 bool allow_remap;
65 base::TimeDelta timestamp;
68 struct EVENTS_OZONE_EVDEV_EXPORT MouseWheelEventParams {
69 MouseWheelEventParams(int device_id,
70 const gfx::PointF& location,
71 const gfx::Vector2d& delta,
72 base::TimeDelta timestamp);
73 MouseWheelEventParams(const MouseWheelEventParams& other);
74 ~MouseWheelEventParams();
76 int device_id;
77 gfx::PointF location;
78 gfx::Vector2d delta;
79 base::TimeDelta timestamp;
82 struct EVENTS_OZONE_EVDEV_EXPORT ScrollEventParams {
83 ScrollEventParams(int device_id,
84 EventType type,
85 const gfx::PointF location,
86 const gfx::Vector2dF& delta,
87 const gfx::Vector2dF& ordinal_delta,
88 int finger_count,
89 const base::TimeDelta timestamp);
90 ScrollEventParams(const ScrollEventParams& other);
91 ~ScrollEventParams();
93 int device_id;
94 EventType type;
95 const gfx::PointF location;
96 const gfx::Vector2dF delta;
97 const gfx::Vector2dF ordinal_delta;
98 int finger_count;
99 const base::TimeDelta timestamp;
102 struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams {
103 TouchEventParams(int device_id,
104 int slot,
105 EventType type,
106 const gfx::PointF& location,
107 const gfx::Vector2dF& radii,
108 float pressure,
109 const base::TimeDelta& timestamp);
110 TouchEventParams(const TouchEventParams& other);
111 ~TouchEventParams();
113 int device_id;
114 int slot;
115 EventType type;
116 gfx::PointF location;
117 gfx::Vector2dF radii;
118 float pressure;
119 base::TimeDelta timestamp;
122 // Interface used by device objects for event dispatch.
123 class EVENTS_OZONE_EVDEV_EXPORT DeviceEventDispatcherEvdev {
124 public:
125 DeviceEventDispatcherEvdev() {}
126 virtual ~DeviceEventDispatcherEvdev() {}
128 // User input events.
129 virtual void DispatchKeyEvent(const KeyEventParams& params) = 0;
130 virtual void DispatchMouseMoveEvent(const MouseMoveEventParams& params) = 0;
131 virtual void DispatchMouseButtonEvent(
132 const MouseButtonEventParams& params) = 0;
133 virtual void DispatchMouseWheelEvent(const MouseWheelEventParams& params) = 0;
134 virtual void DispatchScrollEvent(const ScrollEventParams& params) = 0;
135 virtual void DispatchTouchEvent(const TouchEventParams& params) = 0;
137 // Device lifecycle events.
138 virtual void DispatchKeyboardDevicesUpdated(
139 const std::vector<KeyboardDevice>& devices) = 0;
140 virtual void DispatchTouchscreenDevicesUpdated(
141 const std::vector<TouchscreenDevice>& devices) = 0;
142 virtual void DispatchMouseDevicesUpdated(
143 const std::vector<InputDevice>& devices) = 0;
144 virtual void DispatchTouchpadDevicesUpdated(
145 const std::vector<InputDevice>& devices) = 0;
146 virtual void DispatchDeviceListsComplete() = 0;
149 } // namespace ui
151 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_