summaryrefslogtreecommitdiff
path: root/platform/android/src/style/light.hpp.ejs
blob: 18f961b9e0d87c451d8880e952a31cd91d362ffe (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
<%
  const properties = locals.properties;
-%>
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.

#pragma once

#include <mbgl/util/noncopyable.hpp>

#include <jni/jni.hpp>
#include <mbgl/style/light.hpp>
#include "transition_options.hpp"
#include "position.hpp"
#include <mbgl/style/types.hpp>
#include <mbgl/style/property_value.hpp>

namespace mbgl {
namespace android {

using namespace style;

class Light : private mbgl::util::noncopyable {
public:

    static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/light/Light"; };

    static jni::Class<Light> javaClass;

    static void registerNative(jni::JNIEnv&);

    static jni::jobject* createJavaLightPeer(jni::JNIEnv&, mbgl::Map&, mbgl::style::Light&);

    Light(mbgl::Map&, mbgl::style::Light&);

<% for (const property of properties) { -%>
<% if (property.name=="position") {-%>
    void set<%- camelize(property.name) %>(jni::JNIEnv&, jni::Object<Position>);
    jni::Object<<%- camelize(property.name) %>> get<%- camelize(property.name) %>(jni::JNIEnv&);
<% } else { -%>
    void set<%- camelize(property.name) %>(jni::JNIEnv&, jni::<%- propertyJNIType(property) %>);
    jni::<%- propertyJNIType(property) %> get<%- camelize(property.name) %>(jni::JNIEnv&);
<% } -%>
<% if (property.transition) { -%>
    void set<%- camelize(property.name) %>Transition(jni::JNIEnv&, jlong duration, jlong delay);
    jni::Object<TransitionOptions> get<%- camelize(property.name) %>Transition(jni::JNIEnv&);
<% } -%>
<% } -%>
    jni::jobject* createJavaPeer(jni::JNIEnv&);

protected:

    // Raw reference to the light
    mbgl::style::Light& light;

    // Map is set when the light is retrieved
    mbgl::Map* map;
};
} // namespace android
} // namespace mbgl