summaryrefslogtreecommitdiff
path: root/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.h.ejs
blob: c078ac7d028cf9a75169c5a6d7a5264a569bfc33 (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
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.

<%
const types = locals.types;
const layoutProperties = locals.layoutProperties;
const paintProperties = locals.paintProperties;
-%>
#import <Foundation/Foundation.h>

<% if (types) { -%>
<% for (const type of types) { -%>
#import "MGL<%- camelize(type) %>StyleLayer.h"
<% } -%>
<% } -%>

NS_ASSUME_NONNULL_BEGIN

/**
 Methods for round-tripping values for Mapbox style layer enumeration values.
*/
@interface NSValue (MGLStyleEnumAttributeAdditions)

#pragma mark Working with Style Layer Enumeration Attribute Values

<% if (layoutProperties.length) { -%>
<% for (const property of layoutProperties) { -%>
<% if (property.type == "enum") { -%>
/**
 Creates a new value object containing the given `MGL<%- camelize(property.name) %>` enumeration.

 @param type The value for the new object.
 @return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGL<%- camelize(property.name) %>:(MGL<%- camelize(property.name) %>)<%- objCName(property) %>;

/**
 The `MGL<%- camelize(property.name) %>` enumeration representation of the value.
*/
@property (readonly) MGL<%- camelize(property.name) %> MGL<%- camelize(property.name) %>Value;

<% } -%>
<% } -%>
<% } -%>
<% if (paintProperties.length) { -%>
<% for (const property of paintProperties) { -%>
<% if (property.type == "enum") { -%>
/**
 Creates a new value object containing the given `MGL<%- camelize(property.name) %>` structure.

 @param type The value for the new object.
 @return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGL<%- camelize(property.name) %>:(MGL<%- camelize(property.name) %>)<%- objCName(property) %>;

/**
 The `MGL<%- camelize(property.name) %>` enumeration representation of the value.
*/
@property (readonly) MGL<%- camelize(property.name) %> MGL<%- camelize(property.name) %>Value;

<% } -%>
<% } -%>
<% } -%>
@end

NS_ASSUME_NONNULL_END