@iternio/react-native-auto-play 0.5.14-beta.1 → 0.6.1
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/README.md +270 -36
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoSession.kt +5 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplate.kt +9 -2
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/NativeBackdrop.kt +40 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +52 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/GridTemplate.kt +47 -13
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +69 -15
- package/ios/Types.swift +3 -0
- package/ios/extensions/UIImage+Toggle.swift +5 -2
- package/ios/hybrid/HybridAutoPlay.swift +28 -16
- package/ios/hybrid/HybridMapTemplate.swift +22 -5
- package/ios/scenes/AutoPlayInterfaceController.swift +261 -72
- package/ios/templates/AutoPlayMapPanelDelegate.swift +190 -0
- package/ios/templates/AutoPlayTemplate.swift +24 -2
- package/ios/templates/GridTemplate.swift +57 -57
- package/ios/templates/InformationTemplate.swift +84 -9
- package/ios/templates/ListTemplate.swift +66 -11
- package/ios/templates/MapTemplate.swift +83 -68
- package/ios/templates/MessageTemplate.swift +72 -6
- package/ios/templates/Parser.swift +564 -69
- package/ios/templates/SearchTemplate.swift +1 -1
- package/ios/templates/TemplateStore.swift +5 -15
- package/ios/utils/SymbolFont.swift +13 -28
- package/jest.js +2 -0
- package/lib/Constants.d.ts +4 -0
- package/lib/Constants.js +6 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.web.d.ts +73 -0
- package/lib/index.web.js +72 -1
- package/lib/specs/MapTemplate.nitro.d.ts +3 -1
- package/lib/templates/GridTemplate.d.ts +23 -3
- package/lib/templates/GridTemplate.js +8 -0
- package/lib/templates/InformationTemplate.d.ts +38 -12
- package/lib/templates/ListTemplate.d.ts +16 -47
- package/lib/templates/MapTemplate.d.ts +26 -2
- package/lib/templates/MapTemplate.js +16 -2
- package/lib/templates/MessageTemplate.d.ts +52 -11
- package/lib/templates/MessageTemplate.js +1 -1
- package/lib/types/Image.d.ts +6 -1
- package/lib/utils/NitroColor.d.ts +1 -0
- package/lib/utils/NitroColor.js +8 -0
- package/lib/utils/NitroImage.js +1 -1
- package/lib/utils/NitroManeuver.js +1 -3
- package/lib/utils/NitroOptionsPanel.d.ts +103 -0
- package/lib/utils/NitroOptionsPanel.js +63 -0
- package/lib/utils/NitroSection.d.ts +89 -2
- package/lib/utils/NitroSection.js +49 -2
- package/lib-cjs/AutoPlayHeadlessJsTask.js +16 -0
- package/lib-cjs/Constants.js +9 -0
- package/lib-cjs/components/MapTemplateContext.js +10 -0
- package/lib-cjs/components/SafeAreaInsetsContext.js +21 -0
- package/lib-cjs/components/SafeAreaView.js +22 -0
- package/lib-cjs/components/WindowInformationWrapper.js +20 -0
- package/lib-cjs/hooks/useAndroidAutoTelemetry.js +115 -0
- package/lib-cjs/hooks/useFocusedEffect.js +35 -0
- package/lib-cjs/hooks/useMapTemplate.js +13 -0
- package/lib-cjs/hooks/useSafeAreaInsets.js +9 -0
- package/lib-cjs/hooks/useVoiceInput.js +42 -0
- package/lib-cjs/hybrid/HybridAndroidAutoTelemetry.js +4 -0
- package/lib-cjs/hybrid/HybridAndroidWindowInformation.js +4 -0
- package/lib-cjs/hybrid/HybridAutoPlay.js +5 -0
- package/lib-cjs/hybrid/HybridVoice.js +61 -0
- package/lib-cjs/index.js +76 -0
- package/lib-cjs/index.web.js +98 -0
- package/lib-cjs/scenes/AutoPlayCluster.js +140 -0
- package/lib-cjs/scenes/CarPlayDashboardScene.js +100 -0
- package/lib-cjs/specs/AndroidAutoTelemetry.nitro.js +2 -0
- package/lib-cjs/specs/AndroidAutomotive.nitro.js +16 -0
- package/lib-cjs/specs/AndroidWindowInformation.nitro.js +2 -0
- package/lib-cjs/specs/AutoPlay.nitro.js +2 -0
- package/lib-cjs/specs/CarPlayDashboard.nitro.js +2 -0
- package/lib-cjs/specs/Cluster.nitro.js +2 -0
- package/lib-cjs/specs/GridTemplate.nitro.js +2 -0
- package/lib-cjs/specs/InformationTemplate.nitro.js +2 -0
- package/lib-cjs/specs/ListTemplate.nitro.js +2 -0
- package/lib-cjs/specs/MapTemplate.nitro.js +2 -0
- package/lib-cjs/specs/MessageTemplate.nitro.js +2 -0
- package/lib-cjs/specs/SearchTemplate.nitro.js +2 -0
- package/lib-cjs/specs/SignInTemplate.nitro.js +2 -0
- package/lib-cjs/specs/Voice.nitro.js +2 -0
- package/lib-cjs/templates/GridTemplate.js +41 -0
- package/lib-cjs/templates/InformationTemplate.js +49 -0
- package/lib-cjs/templates/ListTemplate.js +33 -0
- package/lib-cjs/templates/MapTemplate.js +168 -0
- package/lib-cjs/templates/MessageTemplate.js +50 -0
- package/lib-cjs/templates/SearchTemplate.js +32 -0
- package/lib-cjs/templates/SignInTemplate.js +55 -0
- package/lib-cjs/templates/Template.js +40 -0
- package/lib-cjs/types/Button.js +12 -0
- package/lib-cjs/types/Event.js +2 -0
- package/lib-cjs/types/Image.js +2 -0
- package/lib-cjs/types/Maneuver.js +77 -0
- package/lib-cjs/types/RootComponent.js +2 -0
- package/lib-cjs/types/SignInMethod.js +22 -0
- package/lib-cjs/types/Telemetry.js +24 -0
- package/lib-cjs/types/Text.js +8 -0
- package/lib-cjs/types/Trip.js +2 -0
- package/lib-cjs/types/Voice.js +2 -0
- package/lib-cjs/utils/ErrorUtil.js +34 -0
- package/lib-cjs/utils/NitroAction.js +129 -0
- package/lib-cjs/utils/NitroAlert.js +19 -0
- package/lib-cjs/utils/NitroAttributedString.js +14 -0
- package/lib-cjs/utils/NitroColor.js +32 -0
- package/lib-cjs/utils/NitroGrid.js +12 -0
- package/lib-cjs/utils/NitroImage.js +97 -0
- package/lib-cjs/utils/NitroManeuver.js +79 -0
- package/lib-cjs/utils/NitroMapButton.js +33 -0
- package/lib-cjs/utils/NitroOptionsPanel.js +66 -0
- package/lib-cjs/utils/NitroSection.js +112 -0
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -0
- package/nitrogen/generated/android/c++/JChargingConnector.hpp +79 -0
- package/nitrogen/generated/android/c++/JGridImageSize.hpp +64 -0
- package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +7 -1
- package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +4 -0
- package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.cpp +12 -0
- package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +12 -0
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +78 -3
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.hpp +2 -1
- package/nitrogen/generated/android/c++/JHybridSearchTemplateSpec.cpp +12 -0
- package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +6 -0
- package/nitrogen/generated/android/c++/JListImageType.hpp +67 -0
- package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +6 -0
- package/nitrogen/generated/android/c++/JNitroChargerLocation.hpp +115 -0
- package/nitrogen/generated/android/c++/JNitroChargerOutlet.hpp +82 -0
- package/nitrogen/generated/android/c++/JNitroColor.hpp +8 -4
- package/nitrogen/generated/android/c++/JNitroOptionsPanelChargerSection.hpp +112 -0
- package/nitrogen/generated/android/c++/JNitroOptionsPanelConfig.hpp +157 -0
- package/nitrogen/generated/android/c++/JNitroOptionsPanelGridSection.hpp +102 -0
- package/nitrogen/generated/android/c++/JNitroOptionsPanelSection.cpp +30 -0
- package/nitrogen/generated/android/c++/JNitroOptionsPanelSection.hpp +129 -0
- package/nitrogen/generated/android/c++/JNitroRow.hpp +33 -3
- package/nitrogen/generated/android/c++/JNitroSection.hpp +6 -0
- package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +6 -0
- package/nitrogen/generated/android/c++/JWaypointCoordinate.hpp +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ChargingConnector.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridImageSize.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridTemplateConfig.kt +9 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplateSpec.kt +5 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ListImageType.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroChargerLocation.kt +90 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroChargerOutlet.kt +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroColor.kt +9 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelChargerSection.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelConfig.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelGridSection.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelSection.kt +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRow.kt +36 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/WaypointCoordinate.kt +61 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +174 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +27 -0
- package/nitrogen/generated/ios/c++/HybridGridTemplateSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridInformationTemplateSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridListTemplateSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridMapTemplateSpecSwift.hpp +47 -1
- package/nitrogen/generated/ios/c++/HybridSearchTemplateSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/swift/ChargingConnector.swift +68 -0
- package/nitrogen/generated/ios/swift/GridImageSize.swift +48 -0
- package/nitrogen/generated/ios/swift/GridTemplateConfig.swift +12 -1
- package/nitrogen/generated/ios/swift/HybridMapTemplateSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridMapTemplateSpec_cxx.swift +31 -4
- package/nitrogen/generated/ios/swift/ListImageType.swift +52 -0
- package/nitrogen/generated/ios/swift/NitroChargerLocation.swift +161 -0
- package/nitrogen/generated/ios/swift/NitroChargerOutlet.swift +65 -0
- package/nitrogen/generated/ios/swift/NitroColor.swift +20 -2
- package/nitrogen/generated/ios/swift/NitroOptionsPanelChargerSection.swift +64 -0
- package/nitrogen/generated/ios/swift/NitroOptionsPanelConfig.swift +94 -0
- package/nitrogen/generated/ios/swift/NitroOptionsPanelGridSection.swift +53 -0
- package/nitrogen/generated/ios/swift/NitroOptionsPanelSection.swift +32 -0
- package/nitrogen/generated/ios/swift/NitroRow.swift +81 -1
- package/nitrogen/generated/ios/swift/WaypointCoordinate.swift +52 -0
- package/nitrogen/generated/shared/c++/ChargingConnector.hpp +104 -0
- package/nitrogen/generated/shared/c++/GridImageSize.hpp +84 -0
- package/nitrogen/generated/shared/c++/GridTemplateConfig.hpp +8 -1
- package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.hpp +5 -1
- package/nitrogen/generated/shared/c++/ListImageType.hpp +88 -0
- package/nitrogen/generated/shared/c++/NitroChargerLocation.hpp +131 -0
- package/nitrogen/generated/shared/c++/NitroChargerOutlet.hpp +98 -0
- package/nitrogen/generated/shared/c++/NitroColor.hpp +7 -3
- package/nitrogen/generated/shared/c++/NitroOptionsPanelChargerSection.hpp +98 -0
- package/nitrogen/generated/shared/c++/NitroOptionsPanelConfig.hpp +107 -0
- package/nitrogen/generated/shared/c++/NitroOptionsPanelGridSection.hpp +91 -0
- package/nitrogen/generated/shared/c++/NitroRow.hpp +39 -2
- package/nitrogen/generated/shared/c++/WaypointCoordinate.hpp +91 -0
- package/package.json +7 -3
- package/src/Constants.ts +9 -0
- package/src/index.ts +1 -0
- package/src/index.web.ts +166 -0
- package/src/specs/MapTemplate.nitro.ts +3 -1
- package/src/templates/GridTemplate.ts +38 -3
- package/src/templates/InformationTemplate.ts +60 -29
- package/src/templates/ListTemplate.ts +27 -55
- package/src/templates/MapTemplate.ts +60 -2
- package/src/templates/MessageTemplate.ts +71 -24
- package/src/types/Image.ts +6 -1
- package/src/utils/NitroColor.ts +10 -1
- package/src/utils/NitroImage.ts +1 -5
- package/src/utils/NitroManeuver.ts +1 -4
- package/src/utils/NitroOptionsPanel.ts +218 -0
- package/src/utils/NitroSection.ts +160 -5
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroOptionsPanelConfig.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 "NitroOptionsPanelConfig.hpp"
|
|
12
|
+
|
|
13
|
+
#include "AssetImage.hpp"
|
|
14
|
+
#include "AutoText.hpp"
|
|
15
|
+
#include "ChargingConnector.hpp"
|
|
16
|
+
#include "Distance.hpp"
|
|
17
|
+
#include "DistanceUnits.hpp"
|
|
18
|
+
#include "DurationWithTimeZone.hpp"
|
|
19
|
+
#include "GlyphImage.hpp"
|
|
20
|
+
#include "JAssetImage.hpp"
|
|
21
|
+
#include "JAutoText.hpp"
|
|
22
|
+
#include "JChargingConnector.hpp"
|
|
23
|
+
#include "JDistance.hpp"
|
|
24
|
+
#include "JDistanceUnits.hpp"
|
|
25
|
+
#include "JDurationWithTimeZone.hpp"
|
|
26
|
+
#include "JFunc_void.hpp"
|
|
27
|
+
#include "JFunc_void_std__optional_bool_.hpp"
|
|
28
|
+
#include "JGlyphImage.hpp"
|
|
29
|
+
#include "JListImageType.hpp"
|
|
30
|
+
#include "JNitroAction.hpp"
|
|
31
|
+
#include "JNitroActionType.hpp"
|
|
32
|
+
#include "JNitroAlignment.hpp"
|
|
33
|
+
#include "JNitroButtonStyle.hpp"
|
|
34
|
+
#include "JNitroChargerLocation.hpp"
|
|
35
|
+
#include "JNitroChargerOutlet.hpp"
|
|
36
|
+
#include "JNitroColor.hpp"
|
|
37
|
+
#include "JNitroGridButton.hpp"
|
|
38
|
+
#include "JNitroImage.hpp"
|
|
39
|
+
#include "JNitroOptionsPanelChargerSection.hpp"
|
|
40
|
+
#include "JNitroOptionsPanelGridSection.hpp"
|
|
41
|
+
#include "JNitroOptionsPanelSection.hpp"
|
|
42
|
+
#include "JNitroRow.hpp"
|
|
43
|
+
#include "JNitroSection.hpp"
|
|
44
|
+
#include "JNitroSectionType.hpp"
|
|
45
|
+
#include "JRemoteImage.hpp"
|
|
46
|
+
#include "JVariant_GlyphImage_AssetImage_RemoteImage.hpp"
|
|
47
|
+
#include "JWaypointCoordinate.hpp"
|
|
48
|
+
#include "ListImageType.hpp"
|
|
49
|
+
#include "NitroAction.hpp"
|
|
50
|
+
#include "NitroActionType.hpp"
|
|
51
|
+
#include "NitroAlignment.hpp"
|
|
52
|
+
#include "NitroButtonStyle.hpp"
|
|
53
|
+
#include "NitroChargerLocation.hpp"
|
|
54
|
+
#include "NitroChargerOutlet.hpp"
|
|
55
|
+
#include "NitroColor.hpp"
|
|
56
|
+
#include "NitroGridButton.hpp"
|
|
57
|
+
#include "NitroOptionsPanelChargerSection.hpp"
|
|
58
|
+
#include "NitroOptionsPanelGridSection.hpp"
|
|
59
|
+
#include "NitroRow.hpp"
|
|
60
|
+
#include "NitroSection.hpp"
|
|
61
|
+
#include "NitroSectionType.hpp"
|
|
62
|
+
#include "RemoteImage.hpp"
|
|
63
|
+
#include "WaypointCoordinate.hpp"
|
|
64
|
+
#include <NitroModules/JNICallable.hpp>
|
|
65
|
+
#include <functional>
|
|
66
|
+
#include <optional>
|
|
67
|
+
#include <string>
|
|
68
|
+
#include <variant>
|
|
69
|
+
#include <vector>
|
|
70
|
+
|
|
71
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
72
|
+
|
|
73
|
+
using namespace facebook;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The C++ JNI bridge between the C++ struct "NitroOptionsPanelConfig" and the the Kotlin data class "NitroOptionsPanelConfig".
|
|
77
|
+
*/
|
|
78
|
+
struct JNitroOptionsPanelConfig final: public jni::JavaClass<JNitroOptionsPanelConfig> {
|
|
79
|
+
public:
|
|
80
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelConfig;";
|
|
81
|
+
|
|
82
|
+
public:
|
|
83
|
+
/**
|
|
84
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroOptionsPanelConfig by copying all values to C++.
|
|
85
|
+
*/
|
|
86
|
+
[[maybe_unused]]
|
|
87
|
+
[[nodiscard]]
|
|
88
|
+
NitroOptionsPanelConfig toCpp() const {
|
|
89
|
+
static const auto clazz = javaClassStatic();
|
|
90
|
+
static const auto fieldTitle = clazz->getField<JAutoText>("title");
|
|
91
|
+
jni::local_ref<JAutoText> title = this->getFieldValue(fieldTitle);
|
|
92
|
+
static const auto fieldSections = clazz->getField<jni::JArrayClass<JNitroOptionsPanelSection>>("sections");
|
|
93
|
+
jni::local_ref<jni::JArrayClass<JNitroOptionsPanelSection>> sections = this->getFieldValue(fieldSections);
|
|
94
|
+
static const auto fieldActions = clazz->getField<jni::JArrayClass<JNitroAction>>("actions");
|
|
95
|
+
jni::local_ref<jni::JArrayClass<JNitroAction>> actions = this->getFieldValue(fieldActions);
|
|
96
|
+
return NitroOptionsPanelConfig(
|
|
97
|
+
title != nullptr ? std::make_optional(title->toCpp()) : std::nullopt,
|
|
98
|
+
[&](auto&& __input) {
|
|
99
|
+
size_t __size = __input->size();
|
|
100
|
+
std::vector<std::variant<NitroSection, NitroOptionsPanelGridSection, NitroOptionsPanelChargerSection>> __vector;
|
|
101
|
+
__vector.reserve(__size);
|
|
102
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
103
|
+
auto __element = __input->getElement(__i);
|
|
104
|
+
__vector.push_back(__element->toCpp());
|
|
105
|
+
}
|
|
106
|
+
return __vector;
|
|
107
|
+
}(sections),
|
|
108
|
+
actions != nullptr ? std::make_optional([&](auto&& __input) {
|
|
109
|
+
size_t __size = __input->size();
|
|
110
|
+
std::vector<NitroAction> __vector;
|
|
111
|
+
__vector.reserve(__size);
|
|
112
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
113
|
+
auto __element = __input->getElement(__i);
|
|
114
|
+
__vector.push_back(__element->toCpp());
|
|
115
|
+
}
|
|
116
|
+
return __vector;
|
|
117
|
+
}(actions)) : std::nullopt
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public:
|
|
122
|
+
/**
|
|
123
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
124
|
+
*/
|
|
125
|
+
[[maybe_unused]]
|
|
126
|
+
static jni::local_ref<JNitroOptionsPanelConfig::javaobject> fromCpp(const NitroOptionsPanelConfig& value) {
|
|
127
|
+
using JSignature = JNitroOptionsPanelConfig(jni::alias_ref<JAutoText>, jni::alias_ref<jni::JArrayClass<JNitroOptionsPanelSection>>, jni::alias_ref<jni::JArrayClass<JNitroAction>>);
|
|
128
|
+
static const auto clazz = javaClassStatic();
|
|
129
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
130
|
+
return create(
|
|
131
|
+
clazz,
|
|
132
|
+
value.title.has_value() ? JAutoText::fromCpp(value.title.value()) : nullptr,
|
|
133
|
+
[&](auto&& __input) {
|
|
134
|
+
size_t __size = __input.size();
|
|
135
|
+
jni::local_ref<jni::JArrayClass<JNitroOptionsPanelSection>> __array = jni::JArrayClass<JNitroOptionsPanelSection>::newArray(__size);
|
|
136
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
137
|
+
const auto& __element = __input[__i];
|
|
138
|
+
auto __elementJni = JNitroOptionsPanelSection::fromCpp(__element);
|
|
139
|
+
__array->setElement(__i, *__elementJni);
|
|
140
|
+
}
|
|
141
|
+
return __array;
|
|
142
|
+
}(value.sections),
|
|
143
|
+
value.actions.has_value() ? [&](auto&& __input) {
|
|
144
|
+
size_t __size = __input.size();
|
|
145
|
+
jni::local_ref<jni::JArrayClass<JNitroAction>> __array = jni::JArrayClass<JNitroAction>::newArray(__size);
|
|
146
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
147
|
+
const auto& __element = __input[__i];
|
|
148
|
+
auto __elementJni = JNitroAction::fromCpp(__element);
|
|
149
|
+
__array->setElement(__i, *__elementJni);
|
|
150
|
+
}
|
|
151
|
+
return __array;
|
|
152
|
+
}(value.actions.value()) : nullptr
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroOptionsPanelGridSection.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 "NitroOptionsPanelGridSection.hpp"
|
|
12
|
+
|
|
13
|
+
#include "AssetImage.hpp"
|
|
14
|
+
#include "AutoText.hpp"
|
|
15
|
+
#include "Distance.hpp"
|
|
16
|
+
#include "DistanceUnits.hpp"
|
|
17
|
+
#include "GlyphImage.hpp"
|
|
18
|
+
#include "JAssetImage.hpp"
|
|
19
|
+
#include "JAutoText.hpp"
|
|
20
|
+
#include "JDistance.hpp"
|
|
21
|
+
#include "JDistanceUnits.hpp"
|
|
22
|
+
#include "JFunc_void.hpp"
|
|
23
|
+
#include "JGlyphImage.hpp"
|
|
24
|
+
#include "JNitroColor.hpp"
|
|
25
|
+
#include "JNitroGridButton.hpp"
|
|
26
|
+
#include "JNitroImage.hpp"
|
|
27
|
+
#include "JRemoteImage.hpp"
|
|
28
|
+
#include "NitroColor.hpp"
|
|
29
|
+
#include "NitroGridButton.hpp"
|
|
30
|
+
#include "RemoteImage.hpp"
|
|
31
|
+
#include <NitroModules/JNICallable.hpp>
|
|
32
|
+
#include <functional>
|
|
33
|
+
#include <optional>
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <variant>
|
|
36
|
+
#include <vector>
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
39
|
+
|
|
40
|
+
using namespace facebook;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The C++ JNI bridge between the C++ struct "NitroOptionsPanelGridSection" and the the Kotlin data class "NitroOptionsPanelGridSection".
|
|
44
|
+
*/
|
|
45
|
+
struct JNitroOptionsPanelGridSection final: public jni::JavaClass<JNitroOptionsPanelGridSection> {
|
|
46
|
+
public:
|
|
47
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelGridSection;";
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroOptionsPanelGridSection by copying all values to C++.
|
|
52
|
+
*/
|
|
53
|
+
[[maybe_unused]]
|
|
54
|
+
[[nodiscard]]
|
|
55
|
+
NitroOptionsPanelGridSection toCpp() const {
|
|
56
|
+
static const auto clazz = javaClassStatic();
|
|
57
|
+
static const auto fieldTitle = clazz->getField<jni::JString>("title");
|
|
58
|
+
jni::local_ref<jni::JString> title = this->getFieldValue(fieldTitle);
|
|
59
|
+
static const auto fieldButtons = clazz->getField<jni::JArrayClass<JNitroGridButton>>("buttons");
|
|
60
|
+
jni::local_ref<jni::JArrayClass<JNitroGridButton>> buttons = this->getFieldValue(fieldButtons);
|
|
61
|
+
return NitroOptionsPanelGridSection(
|
|
62
|
+
title != nullptr ? std::make_optional(title->toStdString()) : std::nullopt,
|
|
63
|
+
[&](auto&& __input) {
|
|
64
|
+
size_t __size = __input->size();
|
|
65
|
+
std::vector<NitroGridButton> __vector;
|
|
66
|
+
__vector.reserve(__size);
|
|
67
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
68
|
+
auto __element = __input->getElement(__i);
|
|
69
|
+
__vector.push_back(__element->toCpp());
|
|
70
|
+
}
|
|
71
|
+
return __vector;
|
|
72
|
+
}(buttons)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public:
|
|
77
|
+
/**
|
|
78
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
79
|
+
*/
|
|
80
|
+
[[maybe_unused]]
|
|
81
|
+
static jni::local_ref<JNitroOptionsPanelGridSection::javaobject> fromCpp(const NitroOptionsPanelGridSection& value) {
|
|
82
|
+
using JSignature = JNitroOptionsPanelGridSection(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<JNitroGridButton>>);
|
|
83
|
+
static const auto clazz = javaClassStatic();
|
|
84
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
85
|
+
return create(
|
|
86
|
+
clazz,
|
|
87
|
+
value.title.has_value() ? jni::make_jstring(value.title.value()) : nullptr,
|
|
88
|
+
[&](auto&& __input) {
|
|
89
|
+
size_t __size = __input.size();
|
|
90
|
+
jni::local_ref<jni::JArrayClass<JNitroGridButton>> __array = jni::JArrayClass<JNitroGridButton>::newArray(__size);
|
|
91
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
92
|
+
const auto& __element = __input[__i];
|
|
93
|
+
auto __elementJni = JNitroGridButton::fromCpp(__element);
|
|
94
|
+
__array->setElement(__i, *__elementJni);
|
|
95
|
+
}
|
|
96
|
+
return __array;
|
|
97
|
+
}(value.buttons)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroOptionsPanelSection.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 "JNitroOptionsPanelSection.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
11
|
+
/**
|
|
12
|
+
* Converts JNitroOptionsPanelSection to std::variant<NitroSection, NitroOptionsPanelGridSection, NitroOptionsPanelChargerSection>
|
|
13
|
+
*/
|
|
14
|
+
std::variant<NitroSection, NitroOptionsPanelGridSection, NitroOptionsPanelChargerSection> JNitroOptionsPanelSection::toCpp() const {
|
|
15
|
+
if (isInstanceOf(JNitroOptionsPanelSection_impl::First::javaClassStatic())) {
|
|
16
|
+
// It's a `NitroSection`
|
|
17
|
+
auto jniValue = static_cast<const JNitroOptionsPanelSection_impl::First*>(this)->getValue();
|
|
18
|
+
return jniValue->toCpp();
|
|
19
|
+
} else if (isInstanceOf(JNitroOptionsPanelSection_impl::Second::javaClassStatic())) {
|
|
20
|
+
// It's a `NitroOptionsPanelGridSection`
|
|
21
|
+
auto jniValue = static_cast<const JNitroOptionsPanelSection_impl::Second*>(this)->getValue();
|
|
22
|
+
return jniValue->toCpp();
|
|
23
|
+
} else if (isInstanceOf(JNitroOptionsPanelSection_impl::Third::javaClassStatic())) {
|
|
24
|
+
// It's a `NitroOptionsPanelChargerSection`
|
|
25
|
+
auto jniValue = static_cast<const JNitroOptionsPanelSection_impl::Third*>(this)->getValue();
|
|
26
|
+
return jniValue->toCpp();
|
|
27
|
+
}
|
|
28
|
+
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
29
|
+
}
|
|
30
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroOptionsPanelSection.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 <variant>
|
|
12
|
+
|
|
13
|
+
#include "NitroSection.hpp"
|
|
14
|
+
#include "NitroOptionsPanelGridSection.hpp"
|
|
15
|
+
#include "NitroOptionsPanelChargerSection.hpp"
|
|
16
|
+
#include <variant>
|
|
17
|
+
#include "JNitroSection.hpp"
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <optional>
|
|
20
|
+
#include "NitroRow.hpp"
|
|
21
|
+
#include <vector>
|
|
22
|
+
#include "JNitroRow.hpp"
|
|
23
|
+
#include "AutoText.hpp"
|
|
24
|
+
#include "JAutoText.hpp"
|
|
25
|
+
#include "Distance.hpp"
|
|
26
|
+
#include "JDistance.hpp"
|
|
27
|
+
#include "DistanceUnits.hpp"
|
|
28
|
+
#include "JDistanceUnits.hpp"
|
|
29
|
+
#include "GlyphImage.hpp"
|
|
30
|
+
#include "AssetImage.hpp"
|
|
31
|
+
#include "RemoteImage.hpp"
|
|
32
|
+
#include "JVariant_GlyphImage_AssetImage_RemoteImage.hpp"
|
|
33
|
+
#include "JGlyphImage.hpp"
|
|
34
|
+
#include "NitroColor.hpp"
|
|
35
|
+
#include "JNitroColor.hpp"
|
|
36
|
+
#include "JAssetImage.hpp"
|
|
37
|
+
#include "JRemoteImage.hpp"
|
|
38
|
+
#include "ListImageType.hpp"
|
|
39
|
+
#include "JListImageType.hpp"
|
|
40
|
+
#include <functional>
|
|
41
|
+
#include "JFunc_void_std__optional_bool_.hpp"
|
|
42
|
+
#include <NitroModules/JNICallable.hpp>
|
|
43
|
+
#include "WaypointCoordinate.hpp"
|
|
44
|
+
#include "JWaypointCoordinate.hpp"
|
|
45
|
+
#include "DurationWithTimeZone.hpp"
|
|
46
|
+
#include "JDurationWithTimeZone.hpp"
|
|
47
|
+
#include "NitroSectionType.hpp"
|
|
48
|
+
#include "JNitroSectionType.hpp"
|
|
49
|
+
#include "JNitroOptionsPanelGridSection.hpp"
|
|
50
|
+
#include "NitroGridButton.hpp"
|
|
51
|
+
#include "JNitroGridButton.hpp"
|
|
52
|
+
#include "JNitroImage.hpp"
|
|
53
|
+
#include "JFunc_void.hpp"
|
|
54
|
+
#include "JNitroOptionsPanelChargerSection.hpp"
|
|
55
|
+
#include "NitroChargerOutlet.hpp"
|
|
56
|
+
#include "JNitroChargerOutlet.hpp"
|
|
57
|
+
#include "ChargingConnector.hpp"
|
|
58
|
+
#include "JChargingConnector.hpp"
|
|
59
|
+
#include "NitroChargerLocation.hpp"
|
|
60
|
+
#include "JNitroChargerLocation.hpp"
|
|
61
|
+
|
|
62
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
63
|
+
|
|
64
|
+
using namespace facebook;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The C++ JNI bridge between the C++ std::variant and the Java class "NitroOptionsPanelSection".
|
|
68
|
+
*/
|
|
69
|
+
class JNitroOptionsPanelSection: public jni::JavaClass<JNitroOptionsPanelSection> {
|
|
70
|
+
public:
|
|
71
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelSection;";
|
|
72
|
+
|
|
73
|
+
static jni::local_ref<JNitroOptionsPanelSection> create_0(jni::alias_ref<JNitroSection> value) {
|
|
74
|
+
static const auto method = javaClassStatic()->getStaticMethod<JNitroOptionsPanelSection(jni::alias_ref<JNitroSection>)>("create");
|
|
75
|
+
return method(javaClassStatic(), value);
|
|
76
|
+
}
|
|
77
|
+
static jni::local_ref<JNitroOptionsPanelSection> create_1(jni::alias_ref<JNitroOptionsPanelGridSection> value) {
|
|
78
|
+
static const auto method = javaClassStatic()->getStaticMethod<JNitroOptionsPanelSection(jni::alias_ref<JNitroOptionsPanelGridSection>)>("create");
|
|
79
|
+
return method(javaClassStatic(), value);
|
|
80
|
+
}
|
|
81
|
+
static jni::local_ref<JNitroOptionsPanelSection> create_2(jni::alias_ref<JNitroOptionsPanelChargerSection> value) {
|
|
82
|
+
static const auto method = javaClassStatic()->getStaticMethod<JNitroOptionsPanelSection(jni::alias_ref<JNitroOptionsPanelChargerSection>)>("create");
|
|
83
|
+
return method(javaClassStatic(), value);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static jni::local_ref<JNitroOptionsPanelSection> fromCpp(const std::variant<NitroSection, NitroOptionsPanelGridSection, NitroOptionsPanelChargerSection>& variant) {
|
|
87
|
+
switch (variant.index()) {
|
|
88
|
+
case 0: return create_0(JNitroSection::fromCpp(std::get<0>(variant)));
|
|
89
|
+
case 1: return create_1(JNitroOptionsPanelGridSection::fromCpp(std::get<1>(variant)));
|
|
90
|
+
case 2: return create_2(JNitroOptionsPanelChargerSection::fromCpp(std::get<2>(variant)));
|
|
91
|
+
default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[[nodiscard]] std::variant<NitroSection, NitroOptionsPanelGridSection, NitroOptionsPanelChargerSection> toCpp() const;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
namespace JNitroOptionsPanelSection_impl {
|
|
99
|
+
class First final: public jni::JavaClass<First, JNitroOptionsPanelSection> {
|
|
100
|
+
public:
|
|
101
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelSection$First;";
|
|
102
|
+
|
|
103
|
+
[[nodiscard]] jni::local_ref<JNitroSection> getValue() const {
|
|
104
|
+
static const auto field = javaClassStatic()->getField<JNitroSection>("value");
|
|
105
|
+
return getFieldValue(field);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
class Second final: public jni::JavaClass<Second, JNitroOptionsPanelSection> {
|
|
110
|
+
public:
|
|
111
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelSection$Second;";
|
|
112
|
+
|
|
113
|
+
[[nodiscard]] jni::local_ref<JNitroOptionsPanelGridSection> getValue() const {
|
|
114
|
+
static const auto field = javaClassStatic()->getField<JNitroOptionsPanelGridSection>("value");
|
|
115
|
+
return getFieldValue(field);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
class Third final: public jni::JavaClass<Third, JNitroOptionsPanelSection> {
|
|
120
|
+
public:
|
|
121
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelSection$Third;";
|
|
122
|
+
|
|
123
|
+
[[nodiscard]] jni::local_ref<JNitroOptionsPanelChargerSection> getValue() const {
|
|
124
|
+
static const auto field = javaClassStatic()->getField<JNitroOptionsPanelChargerSection>("value");
|
|
125
|
+
return getFieldValue(field);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
} // namespace JNitroOptionsPanelSection_impl
|
|
129
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -14,18 +14,24 @@
|
|
|
14
14
|
#include "AutoText.hpp"
|
|
15
15
|
#include "Distance.hpp"
|
|
16
16
|
#include "DistanceUnits.hpp"
|
|
17
|
+
#include "DurationWithTimeZone.hpp"
|
|
17
18
|
#include "GlyphImage.hpp"
|
|
18
19
|
#include "JAssetImage.hpp"
|
|
19
20
|
#include "JAutoText.hpp"
|
|
20
21
|
#include "JDistance.hpp"
|
|
21
22
|
#include "JDistanceUnits.hpp"
|
|
23
|
+
#include "JDurationWithTimeZone.hpp"
|
|
22
24
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
23
25
|
#include "JGlyphImage.hpp"
|
|
26
|
+
#include "JListImageType.hpp"
|
|
24
27
|
#include "JNitroColor.hpp"
|
|
25
28
|
#include "JRemoteImage.hpp"
|
|
26
29
|
#include "JVariant_GlyphImage_AssetImage_RemoteImage.hpp"
|
|
30
|
+
#include "JWaypointCoordinate.hpp"
|
|
31
|
+
#include "ListImageType.hpp"
|
|
27
32
|
#include "NitroColor.hpp"
|
|
28
33
|
#include "RemoteImage.hpp"
|
|
34
|
+
#include "WaypointCoordinate.hpp"
|
|
29
35
|
#include <NitroModules/JNICallable.hpp>
|
|
30
36
|
#include <functional>
|
|
31
37
|
#include <optional>
|
|
@@ -61,18 +67,31 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
61
67
|
jboolean enabled = this->getFieldValue(fieldEnabled);
|
|
62
68
|
static const auto fieldImage = clazz->getField<JVariant_GlyphImage_AssetImage_RemoteImage>("image");
|
|
63
69
|
jni::local_ref<JVariant_GlyphImage_AssetImage_RemoteImage> image = this->getFieldValue(fieldImage);
|
|
70
|
+
static const auto fieldImageType = clazz->getField<JListImageType>("imageType");
|
|
71
|
+
jni::local_ref<JListImageType> imageType = this->getFieldValue(fieldImageType);
|
|
64
72
|
static const auto fieldChecked = clazz->getField<jni::JBoolean>("checked");
|
|
65
73
|
jni::local_ref<jni::JBoolean> checked = this->getFieldValue(fieldChecked);
|
|
66
74
|
static const auto fieldOnPress = clazz->getField<JFunc_void_std__optional_bool_::javaobject>("onPress");
|
|
67
75
|
jni::local_ref<JFunc_void_std__optional_bool_::javaobject> onPress = this->getFieldValue(fieldOnPress);
|
|
68
76
|
static const auto fieldSelected = clazz->getField<jni::JBoolean>("selected");
|
|
69
77
|
jni::local_ref<jni::JBoolean> selected = this->getFieldValue(fieldSelected);
|
|
78
|
+
static const auto fieldCoordinate = clazz->getField<JWaypointCoordinate>("coordinate");
|
|
79
|
+
jni::local_ref<JWaypointCoordinate> coordinate = this->getFieldValue(fieldCoordinate);
|
|
80
|
+
static const auto fieldDistance = clazz->getField<JDistance>("distance");
|
|
81
|
+
jni::local_ref<JDistance> distance = this->getFieldValue(fieldDistance);
|
|
82
|
+
static const auto fieldDuration = clazz->getField<JDurationWithTimeZone>("duration");
|
|
83
|
+
jni::local_ref<JDurationWithTimeZone> duration = this->getFieldValue(fieldDuration);
|
|
84
|
+
static const auto fieldTravelEstimatesVisible = clazz->getField<jni::JBoolean>("travelEstimatesVisible");
|
|
85
|
+
jni::local_ref<jni::JBoolean> travelEstimatesVisible = this->getFieldValue(fieldTravelEstimatesVisible);
|
|
86
|
+
static const auto fieldAddress = clazz->getField<jni::JString>("address");
|
|
87
|
+
jni::local_ref<jni::JString> address = this->getFieldValue(fieldAddress);
|
|
70
88
|
return NitroRow(
|
|
71
89
|
title->toCpp(),
|
|
72
90
|
detailedText != nullptr ? std::make_optional(detailedText->toCpp()) : std::nullopt,
|
|
73
91
|
browsable != nullptr ? std::make_optional(static_cast<bool>(browsable->value())) : std::nullopt,
|
|
74
92
|
static_cast<bool>(enabled),
|
|
75
93
|
image != nullptr ? std::make_optional(image->toCpp()) : std::nullopt,
|
|
94
|
+
imageType != nullptr ? std::make_optional(imageType->toCpp()) : std::nullopt,
|
|
76
95
|
checked != nullptr ? std::make_optional(static_cast<bool>(checked->value())) : std::nullopt,
|
|
77
96
|
onPress != nullptr ? std::make_optional([&]() -> std::function<void(std::optional<bool> /* checked */)> {
|
|
78
97
|
if (onPress->isInstanceOf(JFunc_void_std__optional_bool__cxx::javaClassStatic())) [[likely]] {
|
|
@@ -83,7 +102,12 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
83
102
|
return JNICallable<JFunc_void_std__optional_bool_, void(std::optional<bool>)>(std::move(onPressRef));
|
|
84
103
|
}
|
|
85
104
|
}()) : std::nullopt,
|
|
86
|
-
selected != nullptr ? std::make_optional(static_cast<bool>(selected->value())) : std::nullopt
|
|
105
|
+
selected != nullptr ? std::make_optional(static_cast<bool>(selected->value())) : std::nullopt,
|
|
106
|
+
coordinate != nullptr ? std::make_optional(coordinate->toCpp()) : std::nullopt,
|
|
107
|
+
distance != nullptr ? std::make_optional(distance->toCpp()) : std::nullopt,
|
|
108
|
+
duration != nullptr ? std::make_optional(duration->toCpp()) : std::nullopt,
|
|
109
|
+
travelEstimatesVisible != nullptr ? std::make_optional(static_cast<bool>(travelEstimatesVisible->value())) : std::nullopt,
|
|
110
|
+
address != nullptr ? std::make_optional(address->toStdString()) : std::nullopt
|
|
87
111
|
);
|
|
88
112
|
}
|
|
89
113
|
|
|
@@ -93,7 +117,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
93
117
|
*/
|
|
94
118
|
[[maybe_unused]]
|
|
95
119
|
static jni::local_ref<JNitroRow::javaobject> fromCpp(const NitroRow& value) {
|
|
96
|
-
using JSignature = JNitroRow(jni::alias_ref<JAutoText>, jni::alias_ref<JAutoText>, jni::alias_ref<jni::JBoolean>, jboolean, jni::alias_ref<JVariant_GlyphImage_AssetImage_RemoteImage>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<jni::JBoolean>);
|
|
120
|
+
using JSignature = JNitroRow(jni::alias_ref<JAutoText>, jni::alias_ref<JAutoText>, jni::alias_ref<jni::JBoolean>, jboolean, jni::alias_ref<JVariant_GlyphImage_AssetImage_RemoteImage>, jni::alias_ref<JListImageType>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JWaypointCoordinate>, jni::alias_ref<JDistance>, jni::alias_ref<JDurationWithTimeZone>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>);
|
|
97
121
|
static const auto clazz = javaClassStatic();
|
|
98
122
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
99
123
|
return create(
|
|
@@ -103,9 +127,15 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
103
127
|
value.browsable.has_value() ? jni::JBoolean::valueOf(value.browsable.value()) : nullptr,
|
|
104
128
|
value.enabled,
|
|
105
129
|
value.image.has_value() ? JVariant_GlyphImage_AssetImage_RemoteImage::fromCpp(value.image.value()) : nullptr,
|
|
130
|
+
value.imageType.has_value() ? JListImageType::fromCpp(value.imageType.value()) : nullptr,
|
|
106
131
|
value.checked.has_value() ? jni::JBoolean::valueOf(value.checked.value()) : nullptr,
|
|
107
132
|
value.onPress.has_value() ? JFunc_void_std__optional_bool__cxx::fromCpp(value.onPress.value()) : nullptr,
|
|
108
|
-
value.selected.has_value() ? jni::JBoolean::valueOf(value.selected.value()) : nullptr
|
|
133
|
+
value.selected.has_value() ? jni::JBoolean::valueOf(value.selected.value()) : nullptr,
|
|
134
|
+
value.coordinate.has_value() ? JWaypointCoordinate::fromCpp(value.coordinate.value()) : nullptr,
|
|
135
|
+
value.distance.has_value() ? JDistance::fromCpp(value.distance.value()) : nullptr,
|
|
136
|
+
value.duration.has_value() ? JDurationWithTimeZone::fromCpp(value.duration.value()) : nullptr,
|
|
137
|
+
value.travelEstimatesVisible.has_value() ? jni::JBoolean::valueOf(value.travelEstimatesVisible.value()) : nullptr,
|
|
138
|
+
value.address.has_value() ? jni::make_jstring(value.address.value()) : nullptr
|
|
109
139
|
);
|
|
110
140
|
}
|
|
111
141
|
};
|
|
@@ -14,22 +14,28 @@
|
|
|
14
14
|
#include "AutoText.hpp"
|
|
15
15
|
#include "Distance.hpp"
|
|
16
16
|
#include "DistanceUnits.hpp"
|
|
17
|
+
#include "DurationWithTimeZone.hpp"
|
|
17
18
|
#include "GlyphImage.hpp"
|
|
18
19
|
#include "JAssetImage.hpp"
|
|
19
20
|
#include "JAutoText.hpp"
|
|
20
21
|
#include "JDistance.hpp"
|
|
21
22
|
#include "JDistanceUnits.hpp"
|
|
23
|
+
#include "JDurationWithTimeZone.hpp"
|
|
22
24
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
23
25
|
#include "JGlyphImage.hpp"
|
|
26
|
+
#include "JListImageType.hpp"
|
|
24
27
|
#include "JNitroColor.hpp"
|
|
25
28
|
#include "JNitroRow.hpp"
|
|
26
29
|
#include "JNitroSectionType.hpp"
|
|
27
30
|
#include "JRemoteImage.hpp"
|
|
28
31
|
#include "JVariant_GlyphImage_AssetImage_RemoteImage.hpp"
|
|
32
|
+
#include "JWaypointCoordinate.hpp"
|
|
33
|
+
#include "ListImageType.hpp"
|
|
29
34
|
#include "NitroColor.hpp"
|
|
30
35
|
#include "NitroRow.hpp"
|
|
31
36
|
#include "NitroSectionType.hpp"
|
|
32
37
|
#include "RemoteImage.hpp"
|
|
38
|
+
#include "WaypointCoordinate.hpp"
|
|
33
39
|
#include <NitroModules/JNICallable.hpp>
|
|
34
40
|
#include <functional>
|
|
35
41
|
#include <optional>
|
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
#include "AutoText.hpp"
|
|
15
15
|
#include "Distance.hpp"
|
|
16
16
|
#include "DistanceUnits.hpp"
|
|
17
|
+
#include "DurationWithTimeZone.hpp"
|
|
17
18
|
#include "GlyphImage.hpp"
|
|
18
19
|
#include "JAssetImage.hpp"
|
|
19
20
|
#include "JAutoText.hpp"
|
|
20
21
|
#include "JDistance.hpp"
|
|
21
22
|
#include "JDistanceUnits.hpp"
|
|
23
|
+
#include "JDurationWithTimeZone.hpp"
|
|
22
24
|
#include "JFunc_void.hpp"
|
|
23
25
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
24
26
|
#include "JFunc_void_std__string.hpp"
|
|
25
27
|
#include "JGlyphImage.hpp"
|
|
28
|
+
#include "JListImageType.hpp"
|
|
26
29
|
#include "JNitroAction.hpp"
|
|
27
30
|
#include "JNitroActionType.hpp"
|
|
28
31
|
#include "JNitroAlignment.hpp"
|
|
@@ -33,6 +36,8 @@
|
|
|
33
36
|
#include "JNitroSectionType.hpp"
|
|
34
37
|
#include "JRemoteImage.hpp"
|
|
35
38
|
#include "JVariant_GlyphImage_AssetImage_RemoteImage.hpp"
|
|
39
|
+
#include "JWaypointCoordinate.hpp"
|
|
40
|
+
#include "ListImageType.hpp"
|
|
36
41
|
#include "NitroAction.hpp"
|
|
37
42
|
#include "NitroActionType.hpp"
|
|
38
43
|
#include "NitroAlignment.hpp"
|
|
@@ -42,6 +47,7 @@
|
|
|
42
47
|
#include "NitroSection.hpp"
|
|
43
48
|
#include "NitroSectionType.hpp"
|
|
44
49
|
#include "RemoteImage.hpp"
|
|
50
|
+
#include "WaypointCoordinate.hpp"
|
|
45
51
|
#include <NitroModules/JNICallable.hpp>
|
|
46
52
|
#include <functional>
|
|
47
53
|
#include <optional>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JWaypointCoordinate.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 "WaypointCoordinate.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "WaypointCoordinate" and the the Kotlin data class "WaypointCoordinate".
|
|
21
|
+
*/
|
|
22
|
+
struct JWaypointCoordinate final: public jni::JavaClass<JWaypointCoordinate> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/WaypointCoordinate;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct WaypointCoordinate by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
WaypointCoordinate toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldLatitude = clazz->getField<double>("latitude");
|
|
35
|
+
double latitude = this->getFieldValue(fieldLatitude);
|
|
36
|
+
static const auto fieldLongitude = clazz->getField<double>("longitude");
|
|
37
|
+
double longitude = this->getFieldValue(fieldLongitude);
|
|
38
|
+
static const auto fieldAltitude = clazz->getField<jni::JDouble>("altitude");
|
|
39
|
+
jni::local_ref<jni::JDouble> altitude = this->getFieldValue(fieldAltitude);
|
|
40
|
+
return WaypointCoordinate(
|
|
41
|
+
latitude,
|
|
42
|
+
longitude,
|
|
43
|
+
altitude != nullptr ? std::make_optional(altitude->value()) : std::nullopt
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
/**
|
|
49
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
50
|
+
*/
|
|
51
|
+
[[maybe_unused]]
|
|
52
|
+
static jni::local_ref<JWaypointCoordinate::javaobject> fromCpp(const WaypointCoordinate& value) {
|
|
53
|
+
using JSignature = JWaypointCoordinate(double, double, jni::alias_ref<jni::JDouble>);
|
|
54
|
+
static const auto clazz = javaClassStatic();
|
|
55
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
56
|
+
return create(
|
|
57
|
+
clazz,
|
|
58
|
+
value.latitude,
|
|
59
|
+
value.longitude,
|
|
60
|
+
value.altitude.has_value() ? jni::JDouble::valueOf(value.altitude.value()) : nullptr
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|