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_DEVICE_MANAGER_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_DEVICE_MANAGER_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_DEVICE_MANAGER_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_DEVICE_MANAGER_EVDEV_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "ui/events/events_export.h" |
12 | 13 |
13 namespace ui { | 14 namespace ui { |
14 | 15 |
15 typedef base::Callback<void(const base::FilePath& file_path)> | 16 typedef base::Callback<void(const base::FilePath& file_path)> |
16 EvdevDeviceCallback; | 17 EvdevDeviceCallback; |
17 | 18 |
18 // Interface for scanning & monitoring input devices. | 19 // Interface for scanning & monitoring input devices. |
19 class DeviceManagerEvdev { | 20 class DeviceManagerEvdev { |
20 public: | 21 public: |
21 virtual ~DeviceManagerEvdev(); | 22 virtual ~DeviceManagerEvdev(); |
22 | 23 |
23 // Enumerate devices & start watching for changes. | 24 // Enumerate devices & start watching for changes. |
24 // Must be balanced by a call to Stop(). | 25 // Must be balanced by a call to Stop(). |
25 virtual void ScanAndStartMonitoring( | 26 virtual void ScanAndStartMonitoring( |
26 const EvdevDeviceCallback& device_added, | 27 const EvdevDeviceCallback& device_added, |
27 const EvdevDeviceCallback& device_removed) = 0; | 28 const EvdevDeviceCallback& device_removed) = 0; |
28 | 29 |
29 // Stop watching for device changes. | 30 // Stop watching for device changes. |
30 virtual void Stop() = 0; | 31 virtual void Stop() = 0; |
31 }; | 32 }; |
32 | 33 |
33 // Create simple DeviceManagerEvdev that scans /dev/input manually. | 34 // Create simple DeviceManagerEvdev that scans /dev/input manually. |
34 scoped_ptr<DeviceManagerEvdev> CreateDeviceManagerManual(); | 35 EVENTS_EXPORT scoped_ptr<DeviceManagerEvdev> CreateDeviceManagerManual(); |
35 | 36 |
36 } // namespace ui | 37 } // namespace ui |
37 | 38 |
38 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_MANAGER_EVDEV_H_ | 39 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_MANAGER_EVDEV_H_ |
OLD | NEW |