summaryrefslogtreecommitdiff
path: root/platform/android/src/style/conversion/types.hpp
blob: 375d1a33aa933ae22a2645e64348d38d14fffe82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
#pragma once

#include "types_string_values.hpp"
#include "../../conversion/conversion.hpp"
#include "../../conversion/constant.hpp"

#include <mbgl/style/types.hpp>
#include <mbgl/util/optional.hpp>
#include <jni/jni.hpp>

#include <string>

namespace mbgl {
namespace android {
namespace conversion {

template <>
struct Converter<jni::jobject*, mbgl::style::VisibilityType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::VisibilityType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::LineCapType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::LineCapType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::LineJoinType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::LineJoinType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::SymbolPlacementType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::SymbolPlacementType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::AlignmentType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::AlignmentType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::IconTextFitType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::IconTextFitType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::SymbolAnchorType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::SymbolAnchorType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::TextJustifyType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::TextJustifyType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::TextTransformType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::TextTransformType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::TranslateAnchorType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::TranslateAnchorType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::CirclePitchScaleType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::CirclePitchScaleType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};

template <>
struct Converter<jni::jobject*, mbgl::style::LightAnchorType> {
    Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::LightAnchorType& value) const {
        return convert<jni::jobject*, std::string>(env, toString(value));
    }
};


} // namespace conversion
} // namespace android
} // namespace mbgl