Upstream version 11.39.266.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 struct MOJO_INPUT_EVENTS_EXPORT TypeConverter<EventType, ui::EventType> {
17   static EventType Convert(ui::EventType type);
18 };
19
20 template <>
21 struct MOJO_INPUT_EVENTS_EXPORT TypeConverter<ui::EventType, EventType> {
22   static ui::EventType Convert(EventType type);
23 };
24
25 template <>
26 struct MOJO_INPUT_EVENTS_EXPORT TypeConverter<EventPtr, ui::Event> {
27   static EventPtr Convert(const ui::Event& input);
28 };
29
30 template <>
31 struct MOJO_INPUT_EVENTS_EXPORT TypeConverter<EventPtr, ui::KeyEvent> {
32   static EventPtr Convert(const ui::KeyEvent& input);
33 };
34
35 template <>
36 struct MOJO_INPUT_EVENTS_EXPORT TypeConverter<scoped_ptr<ui::Event>, EventPtr> {
37   static scoped_ptr<ui::Event> Convert(const EventPtr& input);
38 };
39
40 }  // namespace mojo
41
42 #endif  // MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_