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_DEVICES_DEVICE_HOTPLUG_EVENT_OBSERVER_H_ | 5 #ifndef UI_EVENTS_DEVICES_DEVICE_HOTPLUG_EVENT_OBSERVER_H_ |
6 #define UI_EVENTS_DEVICES_DEVICE_HOTPLUG_EVENT_OBSERVER_H_ | 6 #define UI_EVENTS_DEVICES_DEVICE_HOTPLUG_EVENT_OBSERVER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ui/events/devices/events_devices_export.h" | 10 #include "ui/events/devices/events_devices_export.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 struct InputDevice; | 14 struct InputDevice; |
15 struct KeyboardDevice; | |
16 struct TouchscreenDevice; | 15 struct TouchscreenDevice; |
17 | 16 |
18 // Listener for specific input device hotplug events. | 17 // Listener for specific input device hotplug events. |
19 class EVENTS_DEVICES_EXPORT DeviceHotplugEventObserver { | 18 class EVENTS_DEVICES_EXPORT DeviceHotplugEventObserver { |
20 public: | 19 public: |
21 virtual ~DeviceHotplugEventObserver() {} | 20 virtual ~DeviceHotplugEventObserver() {} |
22 | 21 |
23 // On a hotplug event this is called with the list of available touchscreen | 22 // On a hotplug event this is called with the list of available touchscreen |
24 // devices. The set of touchscreen devices may not have changed. | 23 // devices. The set of touchscreen devices may not have changed. |
25 virtual void OnTouchscreenDevicesUpdated( | 24 virtual void OnTouchscreenDevicesUpdated( |
26 const std::vector<TouchscreenDevice>& devices) = 0; | 25 const std::vector<TouchscreenDevice>& devices) = 0; |
27 | 26 |
28 // On a hotplug event this is called with the list of available keyboard | 27 // On a hotplug event this is called with the list of available keyboard |
29 // devices. The set of keyboard devices may not have changed. | 28 // devices. The set of keyboard devices may not have changed. |
30 virtual void OnKeyboardDevicesUpdated( | 29 virtual void OnKeyboardDevicesUpdated( |
31 const std::vector<KeyboardDevice>& devices) = 0; | 30 const std::vector<InputDevice>& devices) = 0; |
32 | 31 |
33 // On a hotplug event this is called with the list of available mice. The set | 32 // On a hotplug event this is called with the list of available mice. The set |
34 // of mice may not have changed. | 33 // of mice may not have changed. |
35 virtual void OnMouseDevicesUpdated( | 34 virtual void OnMouseDevicesUpdated( |
36 const std::vector<InputDevice>& devices) = 0; | 35 const std::vector<InputDevice>& devices) = 0; |
37 | 36 |
38 // On a hotplug event this is called with the list of available touchpads. The | 37 // On a hotplug event this is called with the list of available touchpads. The |
39 // set of touchpads may not have changed. | 38 // set of touchpads may not have changed. |
40 virtual void OnTouchpadDevicesUpdated( | 39 virtual void OnTouchpadDevicesUpdated( |
41 const std::vector<InputDevice>& devices) = 0; | 40 const std::vector<InputDevice>& devices) = 0; |
42 | 41 |
43 // On completion of the initial startup scan. This means all of the above | 42 // On completion of the initial startup scan. This means all of the above |
44 // OnDevicesUpdated() methods have been called with a complete list. | 43 // OnDevicesUpdated() methods have been called with a complete list. |
45 virtual void OnDeviceListsComplete() = 0; | 44 virtual void OnDeviceListsComplete() = 0; |
46 }; | 45 }; |
47 | 46 |
48 } // namespace ui | 47 } // namespace ui |
49 | 48 |
50 #endif // UI_EVENTS_DEVICES_DEVICE_HOTPLUG_EVENT_OBSERVER_H_ | 49 #endif // UI_EVENTS_DEVICES_DEVICE_HOTPLUG_EVENT_OBSERVER_H_ |
OLD | NEW |