react-native-nitro-input 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/README.md +120 -5
- package/android/src/main/cpp/JMaskEngine.cpp +45 -0
- package/android/src/main/cpp/JMaskEngine.hpp +9 -0
- package/android/src/main/cpp/JReflowEngine.cpp +32 -0
- package/android/src/main/cpp/JReflowEngine.hpp +13 -0
- package/android/src/main/cpp/JRollingEngine.cpp +42 -2
- package/android/src/main/cpp/JRollingEngine.hpp +9 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +24 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +76 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +88 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/MaskEngine.kt +16 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +96 -6
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +388 -136
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +13 -2
- package/cpp/MaskEngine.cpp +294 -33
- package/cpp/MaskEngine.hpp +68 -0
- package/cpp/RollingEngine.cpp +92 -8
- package/cpp/RollingEngine.hpp +36 -2
- package/ios/HybridNitroInputView.swift +18 -0
- package/ios/HybridNitroNumberFormatPlatform.swift +87 -9
- package/ios/HybridNitroNumberView.swift +82 -1
- package/ios/HybridNitroTextView.swift +134 -0
- package/ios/NitroInputView.swift +125 -7
- package/ios/NitroNumberView.swift +368 -135
- package/ios/NitroTextView.swift +583 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/commonjs/src/NitroInput.js +15 -2
- package/lib/commonjs/src/NitroNumber.js +52 -3
- package/lib/commonjs/src/NitroText.js +138 -0
- package/lib/commonjs/src/NitroTime.js +65 -0
- package/lib/commonjs/src/formatProps.js +76 -16
- package/lib/commonjs/src/index.js +6 -1
- package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
- package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/module/src/NitroInput.js +15 -2
- package/lib/module/src/NitroNumber.js +53 -4
- package/lib/module/src/NitroText.js +98 -0
- package/lib/module/src/NitroTime.js +29 -0
- package/lib/module/src/formatProps.js +76 -17
- package/lib/module/src/index.js +2 -0
- package/lib/module/src/specs/NitroText.nitro.js +1 -0
- package/lib/typescript/src/NitroInput.d.ts +39 -1
- package/lib/typescript/src/NitroNumber.d.ts +79 -1
- package/lib/typescript/src/NitroText.d.ts +67 -0
- package/lib/typescript/src/NitroTime.d.ts +19 -0
- package/lib/typescript/src/formatProps.d.ts +30 -4
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +43 -0
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +67 -0
- package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +34 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +102 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +12 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +243 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +40 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
- package/nitrogen/generated/android/c++/JNitroInputCharacterMapping.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroInputMaskAffinity.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroInputTextCase.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +30 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +100 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputCharacterMapping.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputMaskAffinity.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputTextCase.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +146 -11
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +25 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +50 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +146 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +36 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +120 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +6 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +78 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +20 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +493 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
- package/nitrogen/generated/ios/swift/NitroInputCharacterMapping.swift +34 -0
- package/nitrogen/generated/ios/swift/NitroInputMaskAffinity.swift +48 -0
- package/nitrogen/generated/ios/swift/NitroInputTextCase.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +12 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +21 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +46 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/NitroInputCharacterMapping.hpp +87 -0
- package/nitrogen/generated/shared/c++/NitroInputMaskAffinity.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroInputTextCase.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +21 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +40 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +62 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/package.json +2 -2
- package/src/NitroInput.tsx +73 -0
- package/src/NitroNumber.tsx +183 -9
- package/src/NitroText.tsx +166 -0
- package/src/NitroTime.tsx +68 -0
- package/src/formatProps.ts +108 -18
- package/src/index.ts +8 -0
- package/src/specs/NitroInput.nitro.ts +46 -0
- package/src/specs/NitroNumber.nitro.ts +69 -0
- package/src/specs/NitroText.nitro.ts +65 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridNitroTextViewSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridNitroTextViewSpec.hpp"
|
|
9
|
+
|
|
10
|
+
// Forward declaration of `NitroNumberTextAlign` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
|
|
12
|
+
// Forward declaration of `NitroInputEasing` to properly resolve imports.
|
|
13
|
+
namespace margelo::nitro::nitroinput { enum class NitroInputEasing; }
|
|
14
|
+
// Forward declaration of `NitroInputEffect` to properly resolve imports.
|
|
15
|
+
namespace margelo::nitro::nitroinput { enum class NitroInputEffect; }
|
|
16
|
+
// Forward declaration of `NitroNumberShimmerDirection` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::nitroinput { enum class NitroNumberShimmerDirection; }
|
|
18
|
+
|
|
19
|
+
#include <string>
|
|
20
|
+
#include <optional>
|
|
21
|
+
#include "NitroNumberTextAlign.hpp"
|
|
22
|
+
#include "JNitroNumberTextAlign.hpp"
|
|
23
|
+
#include "NitroInputEasing.hpp"
|
|
24
|
+
#include "JNitroInputEasing.hpp"
|
|
25
|
+
#include "NitroInputEffect.hpp"
|
|
26
|
+
#include "JNitroInputEffect.hpp"
|
|
27
|
+
#include "NitroNumberShimmerDirection.hpp"
|
|
28
|
+
#include "JNitroNumberShimmerDirection.hpp"
|
|
29
|
+
|
|
30
|
+
namespace margelo::nitro::nitroinput {
|
|
31
|
+
|
|
32
|
+
std::shared_ptr<JHybridNitroTextViewSpec> JHybridNitroTextViewSpec::JavaPart::getJHybridNitroTextViewSpec() {
|
|
33
|
+
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
34
|
+
auto castHybridObject = std::dynamic_pointer_cast<JHybridNitroTextViewSpec>(hybridObject);
|
|
35
|
+
if (castHybridObject == nullptr) [[unlikely]] {
|
|
36
|
+
throw std::runtime_error("Failed to downcast JHybridObject to JHybridNitroTextViewSpec!");
|
|
37
|
+
}
|
|
38
|
+
return castHybridObject;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
jni::local_ref<JHybridNitroTextViewSpec::CxxPart::jhybriddata> JHybridNitroTextViewSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
42
|
+
return makeCxxInstance(jThis);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
std::shared_ptr<JHybridObject> JHybridNitroTextViewSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
46
|
+
auto castJavaPart = jni::dynamic_ref_cast<JHybridNitroTextViewSpec::JavaPart>(javaPart);
|
|
47
|
+
if (castJavaPart == nullptr) [[unlikely]] {
|
|
48
|
+
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridNitroTextViewSpec::JavaPart!");
|
|
49
|
+
}
|
|
50
|
+
return std::make_shared<JHybridNitroTextViewSpec>(castJavaPart);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
void JHybridNitroTextViewSpec::CxxPart::registerNatives() {
|
|
54
|
+
registerHybrid({
|
|
55
|
+
makeNativeMethod("initHybrid", JHybridNitroTextViewSpec::CxxPart::initHybrid),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Properties
|
|
60
|
+
std::string JHybridNitroTextViewSpec::getText() {
|
|
61
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getText");
|
|
62
|
+
auto __result = method(_javaPart);
|
|
63
|
+
return __result->toStdString();
|
|
64
|
+
}
|
|
65
|
+
void JHybridNitroTextViewSpec::setText(const std::string& text) {
|
|
66
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* text */)>("setText");
|
|
67
|
+
method(_javaPart, jni::make_jstring(text));
|
|
68
|
+
}
|
|
69
|
+
std::optional<double> JHybridNitroTextViewSpec::getFontSize() {
|
|
70
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getFontSize");
|
|
71
|
+
auto __result = method(_javaPart);
|
|
72
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
73
|
+
}
|
|
74
|
+
void JHybridNitroTextViewSpec::setFontSize(std::optional<double> fontSize) {
|
|
75
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* fontSize */)>("setFontSize");
|
|
76
|
+
method(_javaPart, fontSize.has_value() ? jni::JDouble::valueOf(fontSize.value()) : nullptr);
|
|
77
|
+
}
|
|
78
|
+
std::optional<double> JHybridNitroTextViewSpec::getFontWeight() {
|
|
79
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getFontWeight");
|
|
80
|
+
auto __result = method(_javaPart);
|
|
81
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
82
|
+
}
|
|
83
|
+
void JHybridNitroTextViewSpec::setFontWeight(std::optional<double> fontWeight) {
|
|
84
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* fontWeight */)>("setFontWeight");
|
|
85
|
+
method(_javaPart, fontWeight.has_value() ? jni::JDouble::valueOf(fontWeight.value()) : nullptr);
|
|
86
|
+
}
|
|
87
|
+
std::optional<std::string> JHybridNitroTextViewSpec::getFontFamily() {
|
|
88
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getFontFamily");
|
|
89
|
+
auto __result = method(_javaPart);
|
|
90
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
91
|
+
}
|
|
92
|
+
void JHybridNitroTextViewSpec::setFontFamily(const std::optional<std::string>& fontFamily) {
|
|
93
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* fontFamily */)>("setFontFamily");
|
|
94
|
+
method(_javaPart, fontFamily.has_value() ? jni::make_jstring(fontFamily.value()) : nullptr);
|
|
95
|
+
}
|
|
96
|
+
std::optional<double> JHybridNitroTextViewSpec::getColor() {
|
|
97
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getColor");
|
|
98
|
+
auto __result = method(_javaPart);
|
|
99
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
100
|
+
}
|
|
101
|
+
void JHybridNitroTextViewSpec::setColor(std::optional<double> color) {
|
|
102
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* color */)>("setColor");
|
|
103
|
+
method(_javaPart, color.has_value() ? jni::JDouble::valueOf(color.value()) : nullptr);
|
|
104
|
+
}
|
|
105
|
+
std::optional<double> JHybridNitroTextViewSpec::getLetterSpacing() {
|
|
106
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getLetterSpacing");
|
|
107
|
+
auto __result = method(_javaPart);
|
|
108
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
109
|
+
}
|
|
110
|
+
void JHybridNitroTextViewSpec::setLetterSpacing(std::optional<double> letterSpacing) {
|
|
111
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* letterSpacing */)>("setLetterSpacing");
|
|
112
|
+
method(_javaPart, letterSpacing.has_value() ? jni::JDouble::valueOf(letterSpacing.value()) : nullptr);
|
|
113
|
+
}
|
|
114
|
+
std::optional<NitroNumberTextAlign> JHybridNitroTextViewSpec::getTextAlign() {
|
|
115
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNitroNumberTextAlign>()>("getTextAlign");
|
|
116
|
+
auto __result = method(_javaPart);
|
|
117
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
118
|
+
}
|
|
119
|
+
void JHybridNitroTextViewSpec::setTextAlign(std::optional<NitroNumberTextAlign> textAlign) {
|
|
120
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JNitroNumberTextAlign> /* textAlign */)>("setTextAlign");
|
|
121
|
+
method(_javaPart, textAlign.has_value() ? JNitroNumberTextAlign::fromCpp(textAlign.value()) : nullptr);
|
|
122
|
+
}
|
|
123
|
+
std::optional<bool> JHybridNitroTextViewSpec::getRightToLeft() {
|
|
124
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getRightToLeft");
|
|
125
|
+
auto __result = method(_javaPart);
|
|
126
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
127
|
+
}
|
|
128
|
+
void JHybridNitroTextViewSpec::setRightToLeft(std::optional<bool> rightToLeft) {
|
|
129
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* rightToLeft */)>("setRightToLeft");
|
|
130
|
+
method(_javaPart, rightToLeft.has_value() ? jni::JBoolean::valueOf(rightToLeft.value()) : nullptr);
|
|
131
|
+
}
|
|
132
|
+
std::optional<double> JHybridNitroTextViewSpec::getDuration() {
|
|
133
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getDuration");
|
|
134
|
+
auto __result = method(_javaPart);
|
|
135
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
136
|
+
}
|
|
137
|
+
void JHybridNitroTextViewSpec::setDuration(std::optional<double> duration) {
|
|
138
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* duration */)>("setDuration");
|
|
139
|
+
method(_javaPart, duration.has_value() ? jni::JDouble::valueOf(duration.value()) : nullptr);
|
|
140
|
+
}
|
|
141
|
+
std::optional<NitroInputEasing> JHybridNitroTextViewSpec::getEasing() {
|
|
142
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNitroInputEasing>()>("getEasing");
|
|
143
|
+
auto __result = method(_javaPart);
|
|
144
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
145
|
+
}
|
|
146
|
+
void JHybridNitroTextViewSpec::setEasing(std::optional<NitroInputEasing> easing) {
|
|
147
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JNitroInputEasing> /* easing */)>("setEasing");
|
|
148
|
+
method(_javaPart, easing.has_value() ? JNitroInputEasing::fromCpp(easing.value()) : nullptr);
|
|
149
|
+
}
|
|
150
|
+
std::optional<double> JHybridNitroTextViewSpec::getBounce() {
|
|
151
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getBounce");
|
|
152
|
+
auto __result = method(_javaPart);
|
|
153
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
154
|
+
}
|
|
155
|
+
void JHybridNitroTextViewSpec::setBounce(std::optional<double> bounce) {
|
|
156
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* bounce */)>("setBounce");
|
|
157
|
+
method(_javaPart, bounce.has_value() ? jni::JDouble::valueOf(bounce.value()) : nullptr);
|
|
158
|
+
}
|
|
159
|
+
std::optional<NitroInputEffect> JHybridNitroTextViewSpec::getEffect() {
|
|
160
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNitroInputEffect>()>("getEffect");
|
|
161
|
+
auto __result = method(_javaPart);
|
|
162
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
163
|
+
}
|
|
164
|
+
void JHybridNitroTextViewSpec::setEffect(std::optional<NitroInputEffect> effect) {
|
|
165
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JNitroInputEffect> /* effect */)>("setEffect");
|
|
166
|
+
method(_javaPart, effect.has_value() ? JNitroInputEffect::fromCpp(effect.value()) : nullptr);
|
|
167
|
+
}
|
|
168
|
+
std::optional<bool> JHybridNitroTextViewSpec::getRespectReduceMotion() {
|
|
169
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getRespectReduceMotion");
|
|
170
|
+
auto __result = method(_javaPart);
|
|
171
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
172
|
+
}
|
|
173
|
+
void JHybridNitroTextViewSpec::setRespectReduceMotion(std::optional<bool> respectReduceMotion) {
|
|
174
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* respectReduceMotion */)>("setRespectReduceMotion");
|
|
175
|
+
method(_javaPart, respectReduceMotion.has_value() ? jni::JBoolean::valueOf(respectReduceMotion.value()) : nullptr);
|
|
176
|
+
}
|
|
177
|
+
std::optional<bool> JHybridNitroTextViewSpec::getLoading() {
|
|
178
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getLoading");
|
|
179
|
+
auto __result = method(_javaPart);
|
|
180
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
181
|
+
}
|
|
182
|
+
void JHybridNitroTextViewSpec::setLoading(std::optional<bool> loading) {
|
|
183
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* loading */)>("setLoading");
|
|
184
|
+
method(_javaPart, loading.has_value() ? jni::JBoolean::valueOf(loading.value()) : nullptr);
|
|
185
|
+
}
|
|
186
|
+
std::optional<double> JHybridNitroTextViewSpec::getShimmerColor() {
|
|
187
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerColor");
|
|
188
|
+
auto __result = method(_javaPart);
|
|
189
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
190
|
+
}
|
|
191
|
+
void JHybridNitroTextViewSpec::setShimmerColor(std::optional<double> shimmerColor) {
|
|
192
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerColor */)>("setShimmerColor");
|
|
193
|
+
method(_javaPart, shimmerColor.has_value() ? jni::JDouble::valueOf(shimmerColor.value()) : nullptr);
|
|
194
|
+
}
|
|
195
|
+
std::optional<double> JHybridNitroTextViewSpec::getShimmerDuration() {
|
|
196
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerDuration");
|
|
197
|
+
auto __result = method(_javaPart);
|
|
198
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
199
|
+
}
|
|
200
|
+
void JHybridNitroTextViewSpec::setShimmerDuration(std::optional<double> shimmerDuration) {
|
|
201
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerDuration */)>("setShimmerDuration");
|
|
202
|
+
method(_javaPart, shimmerDuration.has_value() ? jni::JDouble::valueOf(shimmerDuration.value()) : nullptr);
|
|
203
|
+
}
|
|
204
|
+
std::optional<double> JHybridNitroTextViewSpec::getShimmerAngle() {
|
|
205
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerAngle");
|
|
206
|
+
auto __result = method(_javaPart);
|
|
207
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
208
|
+
}
|
|
209
|
+
void JHybridNitroTextViewSpec::setShimmerAngle(std::optional<double> shimmerAngle) {
|
|
210
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerAngle */)>("setShimmerAngle");
|
|
211
|
+
method(_javaPart, shimmerAngle.has_value() ? jni::JDouble::valueOf(shimmerAngle.value()) : nullptr);
|
|
212
|
+
}
|
|
213
|
+
std::optional<double> JHybridNitroTextViewSpec::getShimmerWidth() {
|
|
214
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerWidth");
|
|
215
|
+
auto __result = method(_javaPart);
|
|
216
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
217
|
+
}
|
|
218
|
+
void JHybridNitroTextViewSpec::setShimmerWidth(std::optional<double> shimmerWidth) {
|
|
219
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerWidth */)>("setShimmerWidth");
|
|
220
|
+
method(_javaPart, shimmerWidth.has_value() ? jni::JDouble::valueOf(shimmerWidth.value()) : nullptr);
|
|
221
|
+
}
|
|
222
|
+
std::optional<double> JHybridNitroTextViewSpec::getShimmerBaseColor() {
|
|
223
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerBaseColor");
|
|
224
|
+
auto __result = method(_javaPart);
|
|
225
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
226
|
+
}
|
|
227
|
+
void JHybridNitroTextViewSpec::setShimmerBaseColor(std::optional<double> shimmerBaseColor) {
|
|
228
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerBaseColor */)>("setShimmerBaseColor");
|
|
229
|
+
method(_javaPart, shimmerBaseColor.has_value() ? jni::JDouble::valueOf(shimmerBaseColor.value()) : nullptr);
|
|
230
|
+
}
|
|
231
|
+
std::optional<NitroNumberShimmerDirection> JHybridNitroTextViewSpec::getShimmerDirection() {
|
|
232
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNitroNumberShimmerDirection>()>("getShimmerDirection");
|
|
233
|
+
auto __result = method(_javaPart);
|
|
234
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
235
|
+
}
|
|
236
|
+
void JHybridNitroTextViewSpec::setShimmerDirection(std::optional<NitroNumberShimmerDirection> shimmerDirection) {
|
|
237
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JNitroNumberShimmerDirection> /* shimmerDirection */)>("setShimmerDirection");
|
|
238
|
+
method(_javaPart, shimmerDirection.has_value() ? JNitroNumberShimmerDirection::fromCpp(shimmerDirection.value()) : nullptr);
|
|
239
|
+
}
|
|
240
|
+
std::optional<double> JHybridNitroTextViewSpec::getShimmerDelay() {
|
|
241
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getShimmerDelay");
|
|
242
|
+
auto __result = method(_javaPart);
|
|
243
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
244
|
+
}
|
|
245
|
+
void JHybridNitroTextViewSpec::setShimmerDelay(std::optional<double> shimmerDelay) {
|
|
246
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* shimmerDelay */)>("setShimmerDelay");
|
|
247
|
+
method(_javaPart, shimmerDelay.has_value() ? jni::JDouble::valueOf(shimmerDelay.value()) : nullptr);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Methods
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextViewSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridNitroTextViewSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitroinput {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridNitroTextViewSpec: public virtual HybridNitroTextViewSpec, public virtual JHybridObject {
|
|
22
|
+
public:
|
|
23
|
+
struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/HybridNitroTextViewSpec;";
|
|
25
|
+
std::shared_ptr<JHybridNitroTextViewSpec> getJHybridNitroTextViewSpec();
|
|
26
|
+
};
|
|
27
|
+
struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/HybridNitroTextViewSpec$CxxPart;";
|
|
29
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
30
|
+
static void registerNatives();
|
|
31
|
+
using HybridBase::HybridBase;
|
|
32
|
+
protected:
|
|
33
|
+
std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
explicit JHybridNitroTextViewSpec(const jni::local_ref<JHybridNitroTextViewSpec::JavaPart>& javaPart):
|
|
38
|
+
HybridObject(HybridNitroTextViewSpec::TAG),
|
|
39
|
+
JHybridObject(javaPart),
|
|
40
|
+
_javaPart(jni::make_global(javaPart)) {}
|
|
41
|
+
~JHybridNitroTextViewSpec() override {
|
|
42
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
43
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridNitroTextViewSpec::JavaPart>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
std::string getText() override;
|
|
54
|
+
void setText(const std::string& text) override;
|
|
55
|
+
std::optional<double> getFontSize() override;
|
|
56
|
+
void setFontSize(std::optional<double> fontSize) override;
|
|
57
|
+
std::optional<double> getFontWeight() override;
|
|
58
|
+
void setFontWeight(std::optional<double> fontWeight) override;
|
|
59
|
+
std::optional<std::string> getFontFamily() override;
|
|
60
|
+
void setFontFamily(const std::optional<std::string>& fontFamily) override;
|
|
61
|
+
std::optional<double> getColor() override;
|
|
62
|
+
void setColor(std::optional<double> color) override;
|
|
63
|
+
std::optional<double> getLetterSpacing() override;
|
|
64
|
+
void setLetterSpacing(std::optional<double> letterSpacing) override;
|
|
65
|
+
std::optional<NitroNumberTextAlign> getTextAlign() override;
|
|
66
|
+
void setTextAlign(std::optional<NitroNumberTextAlign> textAlign) override;
|
|
67
|
+
std::optional<bool> getRightToLeft() override;
|
|
68
|
+
void setRightToLeft(std::optional<bool> rightToLeft) override;
|
|
69
|
+
std::optional<double> getDuration() override;
|
|
70
|
+
void setDuration(std::optional<double> duration) override;
|
|
71
|
+
std::optional<NitroInputEasing> getEasing() override;
|
|
72
|
+
void setEasing(std::optional<NitroInputEasing> easing) override;
|
|
73
|
+
std::optional<double> getBounce() override;
|
|
74
|
+
void setBounce(std::optional<double> bounce) override;
|
|
75
|
+
std::optional<NitroInputEffect> getEffect() override;
|
|
76
|
+
void setEffect(std::optional<NitroInputEffect> effect) override;
|
|
77
|
+
std::optional<bool> getRespectReduceMotion() override;
|
|
78
|
+
void setRespectReduceMotion(std::optional<bool> respectReduceMotion) override;
|
|
79
|
+
std::optional<bool> getLoading() override;
|
|
80
|
+
void setLoading(std::optional<bool> loading) override;
|
|
81
|
+
std::optional<double> getShimmerColor() override;
|
|
82
|
+
void setShimmerColor(std::optional<double> shimmerColor) override;
|
|
83
|
+
std::optional<double> getShimmerDuration() override;
|
|
84
|
+
void setShimmerDuration(std::optional<double> shimmerDuration) override;
|
|
85
|
+
std::optional<double> getShimmerAngle() override;
|
|
86
|
+
void setShimmerAngle(std::optional<double> shimmerAngle) override;
|
|
87
|
+
std::optional<double> getShimmerWidth() override;
|
|
88
|
+
void setShimmerWidth(std::optional<double> shimmerWidth) override;
|
|
89
|
+
std::optional<double> getShimmerBaseColor() override;
|
|
90
|
+
void setShimmerBaseColor(std::optional<double> shimmerBaseColor) override;
|
|
91
|
+
std::optional<NitroNumberShimmerDirection> getShimmerDirection() override;
|
|
92
|
+
void setShimmerDirection(std::optional<NitroNumberShimmerDirection> shimmerDirection) override;
|
|
93
|
+
std::optional<double> getShimmerDelay() override;
|
|
94
|
+
void setShimmerDelay(std::optional<double> shimmerDelay) override;
|
|
95
|
+
|
|
96
|
+
public:
|
|
97
|
+
// Methods
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
private:
|
|
101
|
+
jni::global_ref<JHybridNitroTextViewSpec::JavaPart> _javaPart;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroInputCharacterMapping.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "NitroInputCharacterMapping.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::nitroinput {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "NitroInputCharacterMapping" and the Kotlin data class "NitroInputCharacterMapping".
|
|
21
|
+
*/
|
|
22
|
+
struct JNitroInputCharacterMapping final: public jni::JavaClass<JNitroInputCharacterMapping> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NitroInputCharacterMapping;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroInputCharacterMapping by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
NitroInputCharacterMapping toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldFrom = clazz->getField<jni::JString>("from");
|
|
35
|
+
jni::local_ref<jni::JString> from = this->getFieldValue(fieldFrom);
|
|
36
|
+
static const auto fieldTo = clazz->getField<jni::JString>("to");
|
|
37
|
+
jni::local_ref<jni::JString> to = this->getFieldValue(fieldTo);
|
|
38
|
+
return NitroInputCharacterMapping(
|
|
39
|
+
from->toStdString(),
|
|
40
|
+
to->toStdString()
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
47
|
+
*/
|
|
48
|
+
[[maybe_unused]]
|
|
49
|
+
static jni::local_ref<JNitroInputCharacterMapping::javaobject> fromCpp(const NitroInputCharacterMapping& value) {
|
|
50
|
+
using JSignature = JNitroInputCharacterMapping(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
51
|
+
static const auto clazz = javaClassStatic();
|
|
52
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
53
|
+
return create(
|
|
54
|
+
clazz,
|
|
55
|
+
jni::make_jstring(value.from),
|
|
56
|
+
jni::make_jstring(value.to)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroInputMaskAffinity.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "NitroInputMaskAffinity.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NitroInputMaskAffinity" and the Kotlin enum "NitroInputMaskAffinity".
|
|
19
|
+
*/
|
|
20
|
+
struct JNitroInputMaskAffinity final: public jni::JavaClass<JNitroInputMaskAffinity> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NitroInputMaskAffinity;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NitroInputMaskAffinity.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NitroInputMaskAffinity toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<NitroInputMaskAffinity>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JNitroInputMaskAffinity> fromCpp(NitroInputMaskAffinity value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NitroInputMaskAffinity::WHOLESTRING:
|
|
46
|
+
static const auto fieldWHOLESTRING = clazz->getStaticField<JNitroInputMaskAffinity>("WHOLESTRING");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldWHOLESTRING);
|
|
48
|
+
case NitroInputMaskAffinity::PREFIX:
|
|
49
|
+
static const auto fieldPREFIX = clazz->getStaticField<JNitroInputMaskAffinity>("PREFIX");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldPREFIX);
|
|
51
|
+
case NitroInputMaskAffinity::CAPACITY:
|
|
52
|
+
static const auto fieldCAPACITY = clazz->getStaticField<JNitroInputMaskAffinity>("CAPACITY");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldCAPACITY);
|
|
54
|
+
case NitroInputMaskAffinity::EXTRACTEDVALUECAPACITY:
|
|
55
|
+
static const auto fieldEXTRACTEDVALUECAPACITY = clazz->getStaticField<JNitroInputMaskAffinity>("EXTRACTEDVALUECAPACITY");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldEXTRACTEDVALUECAPACITY);
|
|
57
|
+
default:
|
|
58
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
59
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroInputTextCase.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "NitroInputTextCase.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NitroInputTextCase" and the Kotlin enum "NitroInputTextCase".
|
|
19
|
+
*/
|
|
20
|
+
struct JNitroInputTextCase final: public jni::JavaClass<JNitroInputTextCase> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NitroInputTextCase;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NitroInputTextCase.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NitroInputTextCase toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<NitroInputTextCase>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JNitroInputTextCase> fromCpp(NitroInputTextCase value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NitroInputTextCase::NONE:
|
|
46
|
+
static const auto fieldNONE = clazz->getStaticField<JNitroInputTextCase>("NONE");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldNONE);
|
|
48
|
+
case NitroInputTextCase::UPPER:
|
|
49
|
+
static const auto fieldUPPER = clazz->getStaticField<JNitroInputTextCase>("UPPER");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldUPPER);
|
|
51
|
+
case NitroInputTextCase::LOWER:
|
|
52
|
+
static const auto fieldLOWER = clazz->getStaticField<JNitroInputTextCase>("LOWER");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldLOWER);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroNumberShimmerDirection.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "NitroNumberShimmerDirection.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NitroNumberShimmerDirection" and the Kotlin enum "NitroNumberShimmerDirection".
|
|
19
|
+
*/
|
|
20
|
+
struct JNitroNumberShimmerDirection final: public jni::JavaClass<JNitroNumberShimmerDirection> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NitroNumberShimmerDirection;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NitroNumberShimmerDirection.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NitroNumberShimmerDirection toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<NitroNumberShimmerDirection>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JNitroNumberShimmerDirection> fromCpp(NitroNumberShimmerDirection value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NitroNumberShimmerDirection::AUTO:
|
|
46
|
+
static const auto fieldAUTO = clazz->getStaticField<JNitroNumberShimmerDirection>("AUTO");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldAUTO);
|
|
48
|
+
case NitroNumberShimmerDirection::LTR:
|
|
49
|
+
static const auto fieldLTR = clazz->getStaticField<JNitroNumberShimmerDirection>("LTR");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldLTR);
|
|
51
|
+
case NitroNumberShimmerDirection::RTL:
|
|
52
|
+
static const auto fieldRTL = clazz->getStaticField<JNitroNumberShimmerDirection>("RTL");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldRTL);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitroinput
|