Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ui / events / ozone / evdev / event_converter_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_EVENT_CONVERTER_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/events/events_export.h"
11
12 namespace ui {
13
14 class Event;
15 class EventModifiersEvdev;
16
17 // Base class for device-specific evdev event conversion.
18 class EVENTS_EXPORT EventConverterEvdev {
19  public:
20   EventConverterEvdev();
21   virtual ~EventConverterEvdev();
22
23   // Start converting events.
24   virtual void Start() = 0;
25
26   // Stop converting events.
27   virtual void Stop() = 0;
28
29  protected:
30   // Subclasses should use this method to post a task that will dispatch
31   // |event| from the UI message loop. This method takes ownership of
32   // |event|. |event| will be deleted at the end of the posted task.
33   virtual void DispatchEvent(scoped_ptr<ui::Event> event);
34
35  private:
36   DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
37 };
38
39 }  // namespace ui
40
41 #endif  // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_