Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / events / ozone / evdev / event_converter_evdev.h
blobebc36fcc5a277da0045aaf143a1ac3f74760dcc8
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.
5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
8 #include "base/basictypes.h"
9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
13 namespace ui {
15 class Event;
16 class EventModifiersEvdev;
18 typedef base::Callback<void(Event*)> EventDispatchCallback;
20 // Base class for device-specific evdev event conversion.
21 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev {
22 public:
23 EventConverterEvdev();
24 explicit EventConverterEvdev(const EventDispatchCallback& callback);
25 virtual ~EventConverterEvdev();
27 // Start converting events.
28 virtual void Start() = 0;
30 // Stop converting events.
31 virtual void Stop() = 0;
33 protected:
34 // Dispatches an event using the dispatch-callback set using
35 // |SetDispatchCalback()|.
36 virtual void DispatchEventToCallback(ui::Event* event);
38 private:
39 EventDispatchCallback dispatch_callback_;
41 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
44 } // namespace ui
46 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_