summaryrefslogtreecommitdiff
path: root/platform/android/src/style/conversion/types_string_values.hpp
blob: a19ca33a2f885f809257dbbd236fee0ccdfdf802 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
#pragma once

#include <mbgl/style/types.hpp>

#include <string>
#include <stdexcept>

namespace mbgl {
namespace android {
namespace conversion {

    // visibility
    inline std::string toString(mbgl::style::VisibilityType value) {
        switch (value) {
          case mbgl::style::VisibilityType::Visible:
            return "visible";
            break;
          case mbgl::style::VisibilityType::None:
            return "none";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // line-cap
    inline std::string toString(mbgl::style::LineCapType value) {
        switch (value) {
          case mbgl::style::LineCapType::Butt:
            return "butt";
            break;
          case mbgl::style::LineCapType::Round:
            return "round";
            break;
          case mbgl::style::LineCapType::Square:
            return "square";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // line-join
    inline std::string toString(mbgl::style::LineJoinType value) {
        switch (value) {
          case mbgl::style::LineJoinType::Bevel:
            return "bevel";
            break;
          case mbgl::style::LineJoinType::Round:
            return "round";
            break;
          case mbgl::style::LineJoinType::Miter:
            return "miter";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // symbol-placement
    inline std::string toString(mbgl::style::SymbolPlacementType value) {
        switch (value) {
          case mbgl::style::SymbolPlacementType::Point:
            return "point";
            break;
          case mbgl::style::SymbolPlacementType::Line:
            return "line";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // icon-rotation-alignment
    inline std::string toString(mbgl::style::AlignmentType value) {
        switch (value) {
          case mbgl::style::AlignmentType::Map:
            return "map";
            break;
          case mbgl::style::AlignmentType::Viewport:
            return "viewport";
            break;
          case mbgl::style::AlignmentType::Auto:
            return "auto";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // icon-text-fit
    inline std::string toString(mbgl::style::IconTextFitType value) {
        switch (value) {
          case mbgl::style::IconTextFitType::None:
            return "none";
            break;
          case mbgl::style::IconTextFitType::Width:
            return "width";
            break;
          case mbgl::style::IconTextFitType::Height:
            return "height";
            break;
          case mbgl::style::IconTextFitType::Both:
            return "both";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // icon-anchor
    inline std::string toString(mbgl::style::SymbolAnchorType value) {
        switch (value) {
          case mbgl::style::SymbolAnchorType::Center:
            return "center";
            break;
          case mbgl::style::SymbolAnchorType::Left:
            return "left";
            break;
          case mbgl::style::SymbolAnchorType::Right:
            return "right";
            break;
          case mbgl::style::SymbolAnchorType::Top:
            return "top";
            break;
          case mbgl::style::SymbolAnchorType::Bottom:
            return "bottom";
            break;
          case mbgl::style::SymbolAnchorType::TopLeft:
            return "top-left";
            break;
          case mbgl::style::SymbolAnchorType::TopRight:
            return "top-right";
            break;
          case mbgl::style::SymbolAnchorType::BottomLeft:
            return "bottom-left";
            break;
          case mbgl::style::SymbolAnchorType::BottomRight:
            return "bottom-right";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // text-justify
    inline std::string toString(mbgl::style::TextJustifyType value) {
        switch (value) {
          case mbgl::style::TextJustifyType::Left:
            return "left";
            break;
          case mbgl::style::TextJustifyType::Center:
            return "center";
            break;
          case mbgl::style::TextJustifyType::Right:
            return "right";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // text-transform
    inline std::string toString(mbgl::style::TextTransformType value) {
        switch (value) {
          case mbgl::style::TextTransformType::None:
            return "none";
            break;
          case mbgl::style::TextTransformType::Uppercase:
            return "uppercase";
            break;
          case mbgl::style::TextTransformType::Lowercase:
            return "lowercase";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // fill-translate-anchor
    inline std::string toString(mbgl::style::TranslateAnchorType value) {
        switch (value) {
          case mbgl::style::TranslateAnchorType::Map:
            return "map";
            break;
          case mbgl::style::TranslateAnchorType::Viewport:
            return "viewport";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // circle-pitch-scale
    inline std::string toString(mbgl::style::CirclePitchScaleType value) {
        switch (value) {
          case mbgl::style::CirclePitchScaleType::Map:
            return "map";
            break;
          case mbgl::style::CirclePitchScaleType::Viewport:
            return "viewport";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }

    // anchor
    inline std::string toString(mbgl::style::LightAnchorType value) {
        switch (value) {
          case mbgl::style::LightAnchorType::Map:
            return "map";
            break;
          case mbgl::style::LightAnchorType::Viewport:
            return "viewport";
            break;
          default:
            throw std::runtime_error("Not implemented");
        }
    }


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