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