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
|
#pragma once
#include <mbgl/util/image.hpp>
#include <jni/jni.hpp>
/*
android::Collator and android::Locale are
the JNI wrappers of
java/text/Collator and java/util/Locale
mbgl::Collator is the portable interface
Both implementations are in collator.cpp
*/
namespace mbgl {
namespace android {
class Locale {
public:
static constexpr auto Name() { return "java/util/Locale"; };
/* Requires API level 21+ in order to support script/variant
static jni::Object<Locale> forLanguageTag(jni::JNIEnv&, jni::String);
static jni::String toLanguageTag(jni::JNIEnv&, jni::Object<Locale>);
*/
static jni::Object<Locale> getDefault(jni::JNIEnv&);
static jni::String getLanguage(jni::JNIEnv&, jni::Object<Locale>);
static jni::String getCountry(jni::JNIEnv&, jni::Object<Locale>);
static jni::Object<Locale> New(jni::JNIEnv&, jni::String);
static jni::Object<Locale> New(jni::JNIEnv&, jni::String, jni::String);
static jni::Class<Locale> javaClass;
static void registerNative(jni::JNIEnv&);
};
class Collator {
public:
static constexpr auto Name() { return "java/text/Collator"; };
static jni::Object<Collator> getInstance(jni::JNIEnv&, jni::Object<Locale>);
static void setStrength(jni::JNIEnv&, jni::Object<Collator>, jni::jint);
static jni::jint compare(jni::JNIEnv&, jni::Object<Collator>, jni::String, jni::String);
static jni::Class<Collator> javaClass;
static void registerNative(jni::JNIEnv&);
};
class Normalizer {
public:
class Form {
public:
static constexpr auto Name() { return "java/text/Normalizer$Form"; };
enum Value {
NFC,
NFD,
NFKC,
NFKD,
};
static jni::Object<Form> create(jni::JNIEnv&, Value);
static jni::Class<Form> javaClass;
static void registerNative(jni::JNIEnv&);
};
static constexpr auto Name() { return "java/text/Normalizer"; };
static jni::String normalize(jni::JNIEnv&, jni::String);
static jni::Class<Normalizer> javaClass;
static void registerNative(jni::JNIEnv&);
};
} // namespace android
} // namespace mbgl
|