Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / mojo / services / public / cpp / input_events / input_events_type_converters.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 MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_
6 #define MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "mojo/services/public/cpp/input_events/mojo_input_events_export.h"
10 #include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
11 #include "ui/events/event.h"
12
13 namespace mojo {
14
15 template<>
16 class MOJO_INPUT_EVENTS_EXPORT TypeConverter<EventType, ui::EventType> {
17  public:
18   static EventType ConvertFrom(ui::EventType type);
19   static ui::EventType ConvertTo(EventType type);
20 };
21
22 template<>
23 class MOJO_INPUT_EVENTS_EXPORT TypeConverter<EventPtr, ui::Event> {
24  public:
25   static EventPtr ConvertFrom(const ui::Event& input);
26 };
27
28 template<>
29 class MOJO_INPUT_EVENTS_EXPORT TypeConverter<EventPtr, ui::KeyEvent> {
30  public:
31   static EventPtr ConvertFrom(const ui::KeyEvent& input);
32 };
33
34 template<>
35 class MOJO_INPUT_EVENTS_EXPORT TypeConverter<EventPtr,
36                                              scoped_ptr<ui::Event> > {
37  public:
38   static scoped_ptr<ui::Event> ConvertTo(const EventPtr& input);
39 };
40
41 }  // namespace mojo
42
43 #endif  // MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_