chromium/third_party/blink/renderer/modules/handwriting/handwriting_type_converters.h

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_HANDWRITING_HANDWRITING_TYPE_CONVERTERS_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_HANDWRITING_HANDWRITING_TYPE_CONVERTERS_H_

#include "mojo/public/cpp/bindings/type_converter.h"
#include "third_party/blink/public/mojom/handwriting/handwriting.mojom-blink-forward.h"
#include "third_party/blink/renderer/modules/modules_export.h"

namespace blink {
class HandwritingDrawingSegment;
class HandwritingHints;
class HandwritingPoint;
class HandwritingPrediction;
class HandwritingSegment;
class HandwritingStroke;
class HandwritingRecognizerQueryResult;
class HandwritingModelConstraint;
}  // namespace blink

namespace mojo {

// Converters from IDL to Mojo.

template <>
struct MODULES_EXPORT
    TypeConverter<handwriting::mojom::blink::HandwritingPointPtr,
                  blink::HandwritingPoint*> {};

template <>
struct MODULES_EXPORT
    TypeConverter<handwriting::mojom::blink::HandwritingStrokePtr,
                  blink::HandwritingStroke*> {};

template <>
struct MODULES_EXPORT
    TypeConverter<handwriting::mojom::blink::HandwritingHintsPtr,
                  blink::HandwritingHints*> {};

// Converters from Mojo to IDL.

template <>
struct MODULES_EXPORT
    TypeConverter<blink::HandwritingPoint*,
                  handwriting::mojom::blink::HandwritingPointPtr> {};

template <>
struct MODULES_EXPORT
    TypeConverter<blink::HandwritingStroke*,
                  handwriting::mojom::blink::HandwritingStrokePtr> {};

template <>
struct MODULES_EXPORT
    TypeConverter<blink::HandwritingDrawingSegment*,
                  handwriting::mojom::blink::HandwritingDrawingSegmentPtr> {};

template <>
struct MODULES_EXPORT
    TypeConverter<blink::HandwritingSegment*,
                  handwriting::mojom::blink::HandwritingSegmentPtr> {};

template <>
struct MODULES_EXPORT
    TypeConverter<blink::HandwritingPrediction*,
                  handwriting::mojom::blink::HandwritingPredictionPtr> {};

template <>
struct MODULES_EXPORT
    TypeConverter<handwriting::mojom::blink::HandwritingModelConstraintPtr,
                  blink::HandwritingModelConstraint*> {};

template <>
struct MODULES_EXPORT TypeConverter<
    blink::HandwritingRecognizerQueryResult*,
    handwriting::mojom::blink::QueryHandwritingRecognizerResultPtr> {};

}  // namespace mojo

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_HANDWRITING_HANDWRITING_TYPE_CONVERTERS_H_