Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / mojo / services / public / cpp / geometry / geometry_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_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_
6 #define MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_
7
8 #include "mojo/services/public/cpp/geometry/mojo_geometry_export.h"
9 #include "mojo/services/public/interfaces/geometry/geometry.mojom.h"
10 #include "ui/gfx/geometry/point.h"
11 #include "ui/gfx/geometry/point_f.h"
12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/size.h"
14 #include "ui/gfx/transform.h"
15
16 namespace mojo {
17
18 template<>
19 class MOJO_GEOMETRY_EXPORT TypeConverter<PointPtr, gfx::Point> {
20  public:
21   static PointPtr ConvertFrom(const gfx::Point& input);
22   static gfx::Point ConvertTo(const PointPtr& input);
23 };
24
25 template <>
26 class MOJO_GEOMETRY_EXPORT TypeConverter<PointFPtr, gfx::PointF> {
27  public:
28   static PointFPtr ConvertFrom(const gfx::PointF& input);
29   static gfx::PointF ConvertTo(const PointFPtr& input);
30 };
31
32 template <>
33 class MOJO_GEOMETRY_EXPORT TypeConverter<SizePtr, gfx::Size> {
34  public:
35   static SizePtr ConvertFrom(const gfx::Size& input);
36   static gfx::Size ConvertTo(const SizePtr& input);
37 };
38
39 template<>
40 class MOJO_GEOMETRY_EXPORT TypeConverter<RectPtr, gfx::Rect> {
41  public:
42   static RectPtr ConvertFrom(const gfx::Rect& input);
43   static gfx::Rect ConvertTo(const RectPtr& input);
44 };
45
46 template <>
47 class MOJO_GEOMETRY_EXPORT TypeConverter<TransformPtr, gfx::Transform> {
48  public:
49   static TransformPtr ConvertFrom(const gfx::Transform& input);
50   static gfx::Transform ConvertTo(const TransformPtr& input);
51 };
52
53 }  // namespace mojo
54
55 #endif  // MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_