@iternio/react-native-auto-play 0.2.0-alpha.3 → 0.2.0-alpha.4
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/android/build.gradle +2 -2
- package/android/src/automotive/AndroidManifest.xml +2 -0
- package/android/src/automotive/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidTelemetryObserver.kt +5 -2
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInWithGoogleActivity.kt +63 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/SignInTemplate.kt +52 -0
- package/lib/hooks/useAndroidAutoTelemetry.d.ts +4 -13
- package/lib/hooks/useAndroidAutoTelemetry.js +3 -6
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -4
- package/lib/types/SignInMethod.d.ts +17 -2
- package/lib/types/SignInMethod.js +1 -1
- package/nitro.json +0 -3
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -3
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +4 -16
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount_.hpp +79 -0
- package/nitrogen/generated/android/c++/JGoogleSignIn.hpp +81 -0
- package/nitrogen/generated/android/c++/JGoogleSignInAccount.hpp +86 -0
- package/nitrogen/generated/android/c++/JHybridSignInTemplateSpec.cpp +10 -1
- package/nitrogen/generated/android/c++/JSignInMethods.hpp +3 -3
- package/nitrogen/generated/android/c++/JSignInTemplateConfig.hpp +10 -5
- package/nitrogen/generated/android/c++/JVariant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.cpp +34 -0
- package/nitrogen/generated/android/c++/{JVariant_QrSignIn_PinSignIn_InputSignIn.hpp → JVariant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.hpp} +40 -20
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/{Func_void_AppFocusState.kt → Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_.kt} +14 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignIn.kt +48 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignInAccount.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInMethods.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInTemplateConfig.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/{Variant_QrSignIn_PinSignIn_InputSignIn.kt → Variant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.kt} +23 -10
- package/nitrogen/generated/shared/c++/GoogleSignIn.hpp +98 -0
- package/nitrogen/generated/shared/c++/GoogleSignInAccount.hpp +112 -0
- package/nitrogen/generated/shared/c++/SignInMethods.hpp +1 -1
- package/nitrogen/generated/shared/c++/SignInTemplateConfig.hpp +8 -5
- package/package.json +1 -1
- package/src/hooks/useAndroidAutoTelemetry.ts +32 -48
- package/src/index.ts +0 -11
- package/src/types/SignInMethod.ts +19 -2
- package/android/src/auto/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotive.kt +0 -25
- package/android/src/automotive/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotive.kt +0 -190
- package/lib/hooks/useIsAutoPlayFocused.d.ts +0 -7
- package/lib/hooks/useIsAutoPlayFocused.js +0 -20
- package/lib/hybrid.d.ts +0 -2
- package/lib/hybrid.js +0 -2
- package/lib/specs/AndroidAutomotive.nitro.d.ts +0 -33
- package/lib/specs/AndroidAutomotive.nitro.js +0 -13
- package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.js +0 -1
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +0 -1
- package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +0 -23
- package/lib/templates/AutomotivePermissionRequestTemplate.js +0 -18
- package/nitrogen/generated/android/c++/JActiveCarUxRestrictions.hpp +0 -89
- package/nitrogen/generated/android/c++/JAppFocusState.hpp +0 -61
- package/nitrogen/generated/android/c++/JCarUxRestrictions.hpp +0 -82
- package/nitrogen/generated/android/c++/JFunc_void_ActiveCarUxRestrictions.hpp +0 -80
- package/nitrogen/generated/android/c++/JFunc_void_AppFocusState.hpp +0 -78
- package/nitrogen/generated/android/c++/JHybridAndroidAutomotiveSpec.cpp +0 -120
- package/nitrogen/generated/android/c++/JHybridAndroidAutomotiveSpec.hpp +0 -70
- package/nitrogen/generated/android/c++/JVariant_QrSignIn_PinSignIn_InputSignIn.cpp +0 -30
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ActiveCarUxRestrictions.kt +0 -47
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AppFocusState.kt +0 -41
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/CarUxRestrictions.kt +0 -31
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotiveSpec.kt +0 -88
- package/nitrogen/generated/shared/c++/ActiveCarUxRestrictions.hpp +0 -97
- package/nitrogen/generated/shared/c++/AppFocusState.hpp +0 -87
- package/nitrogen/generated/shared/c++/CarUxRestrictions.hpp +0 -81
- package/nitrogen/generated/shared/c++/HybridAndroidAutomotiveSpec.cpp +0 -25
- package/nitrogen/generated/shared/c++/HybridAndroidAutomotiveSpec.hpp +0 -71
- package/src/specs/AndroidAutomotive.nitro.ts +0 -37
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
package com.margelo.nitro.swe.iternio.reactnativeautoplay
|
|
2
|
-
|
|
3
|
-
import android.car.Car
|
|
4
|
-
import android.car.CarAppFocusManager
|
|
5
|
-
import android.car.CarAppFocusManager.OnAppFocusChangedListener
|
|
6
|
-
import android.car.CarAppFocusManager.OnAppFocusOwnershipCallback
|
|
7
|
-
import android.car.drivingstate.CarUxRestrictionsManager
|
|
8
|
-
import com.margelo.nitro.NitroModules
|
|
9
|
-
import java.util.concurrent.CopyOnWriteArrayList
|
|
10
|
-
|
|
11
|
-
class HybridAndroidAutomotive : HybridAndroidAutomotiveSpec() {
|
|
12
|
-
private lateinit var car: Car
|
|
13
|
-
|
|
14
|
-
private fun getCar(): Car {
|
|
15
|
-
if (!this::car.isInitialized) {
|
|
16
|
-
car = Car.createCar(NitroModules.applicationContext)
|
|
17
|
-
}
|
|
18
|
-
return car
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
private val onAppFocusOwnershipCallback = object : OnAppFocusOwnershipCallback {
|
|
22
|
-
override fun onAppFocusOwnershipGranted(appType: Int) {
|
|
23
|
-
isFocusOwned = true
|
|
24
|
-
notifyAppFocusListeners()
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
override fun onAppFocusOwnershipLost(appType: Int) {
|
|
28
|
-
isFocusOwned = false
|
|
29
|
-
notifyAppFocusListeners()
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
private val onAppFocusChangedListener = OnAppFocusChangedListener { appType, active ->
|
|
34
|
-
isFocusActive = active
|
|
35
|
-
|
|
36
|
-
val carAppFocusManager =
|
|
37
|
-
getCar().getCarManager(Car.APP_FOCUS_SERVICE) as CarAppFocusManager
|
|
38
|
-
// docs say we should not get an event when we receive our own app focus
|
|
39
|
-
// but we still do get it. so we do a check here again if we own it or not
|
|
40
|
-
isFocusOwned = carAppFocusManager.isOwningFocus(
|
|
41
|
-
onAppFocusOwnershipCallback, appType
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
notifyAppFocusListeners()
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
override fun registerCarUxRestrictionsListener(callback: (restrictions: ActiveCarUxRestrictions) -> Unit): () -> Unit {
|
|
48
|
-
if (uxRestrictionListeners.isEmpty()) {
|
|
49
|
-
val uxRestrictionManager =
|
|
50
|
-
getCar().getCarManager(Car.CAR_UX_RESTRICTION_SERVICE) as CarUxRestrictionsManager
|
|
51
|
-
|
|
52
|
-
uxRestrictionManager.registerListener {
|
|
53
|
-
notifyUxRestrictionListeners(it.toActiveCarUxRestrictions())
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
uxRestrictionListeners.add(callback)
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
uxRestrictionListeners.remove(callback)
|
|
61
|
-
|
|
62
|
-
if (uxRestrictionListeners.isEmpty()) {
|
|
63
|
-
val uxRestrictionManager =
|
|
64
|
-
getCar().getCarManager(Car.CAR_UX_RESTRICTION_SERVICE) as CarUxRestrictionsManager
|
|
65
|
-
|
|
66
|
-
uxRestrictionManager.unregisterListener()
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
override fun getCarUxRestrictions(): ActiveCarUxRestrictions {
|
|
72
|
-
val uxRestrictionManager =
|
|
73
|
-
getCar().getCarManager(Car.CAR_UX_RESTRICTION_SERVICE) as CarUxRestrictionsManager
|
|
74
|
-
|
|
75
|
-
return uxRestrictionManager.currentCarUxRestrictions.toActiveCarUxRestrictions()
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
override fun registerAppFocusListener(callback: (state: AppFocusState) -> Unit): () -> Unit {
|
|
79
|
-
if (appFocusListeners.isEmpty()) {
|
|
80
|
-
val carAppFocusManager =
|
|
81
|
-
getCar().getCarManager(Car.APP_FOCUS_SERVICE) as CarAppFocusManager
|
|
82
|
-
|
|
83
|
-
carAppFocusManager.addFocusListener(
|
|
84
|
-
onAppFocusChangedListener, CarAppFocusManager.APP_FOCUS_TYPE_NAVIGATION
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
appFocusListeners.add(callback)
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
appFocusListeners.remove(callback)
|
|
92
|
-
|
|
93
|
-
if (appFocusListeners.isEmpty()) {
|
|
94
|
-
val carAppFocusManager =
|
|
95
|
-
getCar().getCarManager(Car.APP_FOCUS_SERVICE) as CarAppFocusManager
|
|
96
|
-
|
|
97
|
-
carAppFocusManager.removeFocusListener(
|
|
98
|
-
onAppFocusChangedListener, CarAppFocusManager.APP_FOCUS_TYPE_NAVIGATION
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
override fun getAppFocusState(): AppFocusState {
|
|
105
|
-
val carAppFocusManager = getCar().getCarManager(Car.APP_FOCUS_SERVICE) as CarAppFocusManager
|
|
106
|
-
isFocusOwned = carAppFocusManager.isOwningFocus(
|
|
107
|
-
onAppFocusOwnershipCallback, CarAppFocusManager.APP_FOCUS_TYPE_NAVIGATION
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
return AppFocusState(isFocusOwned, isFocusActive)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
override fun requestAppFocus(): () -> Unit {
|
|
114
|
-
val carAppFocusManager = getCar().getCarManager(Car.APP_FOCUS_SERVICE) as CarAppFocusManager
|
|
115
|
-
carAppFocusManager.requestAppFocus(
|
|
116
|
-
CarAppFocusManager.APP_FOCUS_TYPE_NAVIGATION, onAppFocusOwnershipCallback
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
carAppFocusManager.abandonAppFocus(
|
|
121
|
-
onAppFocusOwnershipCallback, CarAppFocusManager.APP_FOCUS_TYPE_NAVIGATION
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
companion object {
|
|
127
|
-
private var isFocusOwned: Boolean? = null
|
|
128
|
-
private var isFocusActive: Boolean? = null
|
|
129
|
-
|
|
130
|
-
private val uxRestrictionListeners =
|
|
131
|
-
CopyOnWriteArrayList<(ActiveCarUxRestrictions) -> Unit>()
|
|
132
|
-
private val appFocusListeners = CopyOnWriteArrayList<(AppFocusState) -> Unit>()
|
|
133
|
-
|
|
134
|
-
private fun notifyAppFocusListeners() {
|
|
135
|
-
val state = AppFocusState(isFocusOwned, isFocusActive)
|
|
136
|
-
|
|
137
|
-
appFocusListeners.forEach {
|
|
138
|
-
it(state)
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
private fun notifyUxRestrictionListeners(restrictions: ActiveCarUxRestrictions) {
|
|
143
|
-
uxRestrictionListeners.forEach {
|
|
144
|
-
it(restrictions)
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
fun android.car.drivingstate.CarUxRestrictions.toActiveCarUxRestrictions(): ActiveCarUxRestrictions {
|
|
150
|
-
val restrictions = mutableListOf<CarUxRestrictions>()
|
|
151
|
-
|
|
152
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_NO_DIALPAD) != 0) {
|
|
153
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_NO_DIALPAD)
|
|
154
|
-
}
|
|
155
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_NO_FILTERING) != 0) {
|
|
156
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_NO_FILTERING)
|
|
157
|
-
}
|
|
158
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_LIMIT_STRING_LENGTH) != 0) {
|
|
159
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_LIMIT_STRING_LENGTH)
|
|
160
|
-
}
|
|
161
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_NO_KEYBOARD) != 0) {
|
|
162
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_NO_KEYBOARD)
|
|
163
|
-
}
|
|
164
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_NO_VIDEO) != 0) {
|
|
165
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_NO_VIDEO)
|
|
166
|
-
}
|
|
167
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_LIMIT_CONTENT) != 0) {
|
|
168
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_LIMIT_CONTENT)
|
|
169
|
-
}
|
|
170
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_NO_SETUP) != 0) {
|
|
171
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_NO_SETUP)
|
|
172
|
-
}
|
|
173
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_NO_TEXT_MESSAGE) != 0) {
|
|
174
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_NO_TEXT_MESSAGE)
|
|
175
|
-
}
|
|
176
|
-
if ((activeRestrictions and android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION) != 0) {
|
|
177
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION)
|
|
178
|
-
}
|
|
179
|
-
if (activeRestrictions == android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_FULLY_RESTRICTED) {
|
|
180
|
-
restrictions.add(CarUxRestrictions.UX_RESTRICTIONS_FULLY_RESTRICTED)
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return ActiveCarUxRestrictions(
|
|
184
|
-
maxContentDepth = maxContentDepth.toDouble(),
|
|
185
|
-
maxCumulativeContentItems = maxCumulativeContentItems.toDouble(),
|
|
186
|
-
maxRestrictedStringLength = maxRestrictedStringLength.toDouble(),
|
|
187
|
-
activeRestrictions = restrictions.toTypedArray()
|
|
188
|
-
)
|
|
189
|
-
}
|
|
190
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A hook to determine if the CarPlay/Android Auto screen is currently focused (visible).
|
|
3
|
-
*
|
|
4
|
-
* @param moduleName The name of the module to listen to.
|
|
5
|
-
* @returns `true` if the screen is focused, `false` otherwise.
|
|
6
|
-
*/
|
|
7
|
-
export declare function useIsAutoPlayFocused(moduleName: string): boolean;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { HybridAutoPlay } from '..';
|
|
3
|
-
/**
|
|
4
|
-
* A hook to determine if the CarPlay/Android Auto screen is currently focused (visible).
|
|
5
|
-
*
|
|
6
|
-
* @param moduleName The name of the module to listen to.
|
|
7
|
-
* @returns `true` if the screen is focused, `false` otherwise.
|
|
8
|
-
*/
|
|
9
|
-
export function useIsAutoPlayFocused(moduleName) {
|
|
10
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
const remove = HybridAutoPlay.addListenerRenderState(moduleName, (state) => {
|
|
13
|
-
setIsFocused(state === 'didAppear');
|
|
14
|
-
});
|
|
15
|
-
return () => {
|
|
16
|
-
remove();
|
|
17
|
-
};
|
|
18
|
-
}, [moduleName]);
|
|
19
|
-
return isFocused;
|
|
20
|
-
}
|
package/lib/hybrid.d.ts
DELETED
package/lib/hybrid.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
import type { CleanupCallback } from '../types/Event';
|
|
3
|
-
export declare enum CarUxRestrictions {
|
|
4
|
-
UX_RESTRICTIONS_FULLY_RESTRICTED = 511,
|
|
5
|
-
UX_RESTRICTIONS_LIMIT_CONTENT = 32,
|
|
6
|
-
UX_RESTRICTIONS_LIMIT_STRING_LENGTH = 4,
|
|
7
|
-
UX_RESTRICTIONS_NO_DIALPAD = 1,
|
|
8
|
-
UX_RESTRICTIONS_NO_FILTERING = 2,
|
|
9
|
-
UX_RESTRICTIONS_NO_KEYBOARD = 8,
|
|
10
|
-
UX_RESTRICTIONS_NO_SETUP = 64,
|
|
11
|
-
UX_RESTRICTIONS_NO_TEXT_MESSAGE = 128,
|
|
12
|
-
UX_RESTRICTIONS_NO_VIDEO = 16,
|
|
13
|
-
UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION = 256
|
|
14
|
-
}
|
|
15
|
-
export interface ActiveCarUxRestrictions {
|
|
16
|
-
maxContentDepth: number;
|
|
17
|
-
maxCumulativeContentItems: number;
|
|
18
|
-
maxRestrictedStringLength: number;
|
|
19
|
-
activeRestrictions: Array<CarUxRestrictions>;
|
|
20
|
-
}
|
|
21
|
-
export interface AppFocusState {
|
|
22
|
-
isFocusOwned?: boolean;
|
|
23
|
-
isFocusActive?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface AndroidAutomotive extends HybridObject<{
|
|
26
|
-
android: 'kotlin';
|
|
27
|
-
}> {
|
|
28
|
-
registerCarUxRestrictionsListener(callback: (restrictions: ActiveCarUxRestrictions) => void): CleanupCallback;
|
|
29
|
-
getCarUxRestrictions(): ActiveCarUxRestrictions;
|
|
30
|
-
registerAppFocusListener(callback: (state: AppFocusState) => void): CleanupCallback;
|
|
31
|
-
getAppFocusState(): AppFocusState;
|
|
32
|
-
requestAppFocus(): CleanupCallback;
|
|
33
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export var CarUxRestrictions;
|
|
2
|
-
(function (CarUxRestrictions) {
|
|
3
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_FULLY_RESTRICTED"] = 511] = "UX_RESTRICTIONS_FULLY_RESTRICTED";
|
|
4
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_LIMIT_CONTENT"] = 32] = "UX_RESTRICTIONS_LIMIT_CONTENT";
|
|
5
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_LIMIT_STRING_LENGTH"] = 4] = "UX_RESTRICTIONS_LIMIT_STRING_LENGTH";
|
|
6
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_NO_DIALPAD"] = 1] = "UX_RESTRICTIONS_NO_DIALPAD";
|
|
7
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_NO_FILTERING"] = 2] = "UX_RESTRICTIONS_NO_FILTERING";
|
|
8
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_NO_KEYBOARD"] = 8] = "UX_RESTRICTIONS_NO_KEYBOARD";
|
|
9
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_NO_SETUP"] = 64] = "UX_RESTRICTIONS_NO_SETUP";
|
|
10
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_NO_TEXT_MESSAGE"] = 128] = "UX_RESTRICTIONS_NO_TEXT_MESSAGE";
|
|
11
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_NO_VIDEO"] = 16] = "UX_RESTRICTIONS_NO_VIDEO";
|
|
12
|
-
CarUxRestrictions[CarUxRestrictions["UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION"] = 256] = "UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION";
|
|
13
|
-
})(CarUxRestrictions || (CarUxRestrictions = {}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
import type { NitroAutomotivePermissionRequestTemplateConfig } from '../templates/AutomotivePermissionRequestTemplate';
|
|
3
|
-
import type { NitroTemplateConfig } from './AutoPlay.nitro';
|
|
4
|
-
interface AutomotivePermissionRequestTemplateConfig extends NitroTemplateConfig, NitroAutomotivePermissionRequestTemplateConfig {
|
|
5
|
-
}
|
|
6
|
-
export interface AutomotivePermissionRequestTemplate extends HybridObject<{
|
|
7
|
-
android: 'kotlin';
|
|
8
|
-
}> {
|
|
9
|
-
createAutomotivePermissionRequestTemplate(config: AutomotivePermissionRequestTemplateConfig): void;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
import type { NitroAutomotivePermissionRequestTemplateConfig } from '../templates/AutomotivePermissionRequestTemplate';
|
|
3
|
-
import type { NitroTemplateConfig } from './AutoPlay.nitro';
|
|
4
|
-
interface AutomotivePermissionRequestTemplateConfig extends NitroTemplateConfig, NitroAutomotivePermissionRequestTemplateConfig {
|
|
5
|
-
}
|
|
6
|
-
export interface AutomotivePermissionRequestTemplate extends HybridObject<{
|
|
7
|
-
android: 'kotlin';
|
|
8
|
-
}> {
|
|
9
|
-
createAutomotivePermissionRequestTemplate(config: AutomotivePermissionRequestTemplateConfig): void;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { CustomActionButtonAndroid } from '../types/Button';
|
|
2
|
-
import type { AutoText } from '../types/Text';
|
|
3
|
-
import { type NitroAction } from '../utils/NitroAction';
|
|
4
|
-
import { type HeaderActions, Template, type TemplateConfig } from './Template';
|
|
5
|
-
export interface NitroAutomotivePermissionRequestTemplateConfig extends TemplateConfig {
|
|
6
|
-
headerActions?: Array<NitroAction>;
|
|
7
|
-
title: AutoText;
|
|
8
|
-
actions: Array<NitroAction>;
|
|
9
|
-
}
|
|
10
|
-
export type AutomotivePermissionRequestTemplateConfig = Omit<NitroAutomotivePermissionRequestTemplateConfig, 'headerActions' | 'buttons'> & {
|
|
11
|
-
/**
|
|
12
|
-
* action buttons, usually at the the top right on Android and a top bar on iOS
|
|
13
|
-
*/
|
|
14
|
-
headerActions?: HeaderActions<AutomotivePermissionRequestTemplate>;
|
|
15
|
-
actions: [CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>] | [
|
|
16
|
-
CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>,
|
|
17
|
-
CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>
|
|
18
|
-
];
|
|
19
|
-
};
|
|
20
|
-
export declare class AutomotivePermissionRequestTemplate extends Template<AutomotivePermissionRequestTemplateConfig, HeaderActions<AutomotivePermissionRequestTemplate>> {
|
|
21
|
-
private template;
|
|
22
|
-
constructor(config: AutomotivePermissionRequestTemplateConfig);
|
|
23
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
|
-
import { NitroActionUtil } from '../utils/NitroAction';
|
|
3
|
-
import { Template, } from './Template';
|
|
4
|
-
const HybridAutomotivePermissionRequestTemplate = NitroModules.createHybridObject('AutomotivePermissionRequestTemplate');
|
|
5
|
-
export class AutomotivePermissionRequestTemplate extends Template {
|
|
6
|
-
template = this;
|
|
7
|
-
constructor(config) {
|
|
8
|
-
super(config);
|
|
9
|
-
const { headerActions, actions, ...rest } = config;
|
|
10
|
-
const nitroConfig = {
|
|
11
|
-
...rest,
|
|
12
|
-
id: this.id,
|
|
13
|
-
headerActions: NitroActionUtil.convert(this.template, headerActions),
|
|
14
|
-
actions: NitroActionUtil.convert(this.template, actions),
|
|
15
|
-
};
|
|
16
|
-
HybridAutomotivePermissionRequestTemplate.createAutomotivePermissionRequestTemplate(nitroConfig);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JActiveCarUxRestrictions.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 "ActiveCarUxRestrictions.hpp"
|
|
12
|
-
|
|
13
|
-
#include "CarUxRestrictions.hpp"
|
|
14
|
-
#include "JCarUxRestrictions.hpp"
|
|
15
|
-
#include <vector>
|
|
16
|
-
|
|
17
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
18
|
-
|
|
19
|
-
using namespace facebook;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The C++ JNI bridge between the C++ struct "ActiveCarUxRestrictions" and the the Kotlin data class "ActiveCarUxRestrictions".
|
|
23
|
-
*/
|
|
24
|
-
struct JActiveCarUxRestrictions final: public jni::JavaClass<JActiveCarUxRestrictions> {
|
|
25
|
-
public:
|
|
26
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/ActiveCarUxRestrictions;";
|
|
27
|
-
|
|
28
|
-
public:
|
|
29
|
-
/**
|
|
30
|
-
* Convert this Java/Kotlin-based struct to the C++ struct ActiveCarUxRestrictions by copying all values to C++.
|
|
31
|
-
*/
|
|
32
|
-
[[maybe_unused]]
|
|
33
|
-
[[nodiscard]]
|
|
34
|
-
ActiveCarUxRestrictions toCpp() const {
|
|
35
|
-
static const auto clazz = javaClassStatic();
|
|
36
|
-
static const auto fieldMaxContentDepth = clazz->getField<double>("maxContentDepth");
|
|
37
|
-
double maxContentDepth = this->getFieldValue(fieldMaxContentDepth);
|
|
38
|
-
static const auto fieldMaxCumulativeContentItems = clazz->getField<double>("maxCumulativeContentItems");
|
|
39
|
-
double maxCumulativeContentItems = this->getFieldValue(fieldMaxCumulativeContentItems);
|
|
40
|
-
static const auto fieldMaxRestrictedStringLength = clazz->getField<double>("maxRestrictedStringLength");
|
|
41
|
-
double maxRestrictedStringLength = this->getFieldValue(fieldMaxRestrictedStringLength);
|
|
42
|
-
static const auto fieldActiveRestrictions = clazz->getField<jni::JArrayClass<JCarUxRestrictions>>("activeRestrictions");
|
|
43
|
-
jni::local_ref<jni::JArrayClass<JCarUxRestrictions>> activeRestrictions = this->getFieldValue(fieldActiveRestrictions);
|
|
44
|
-
return ActiveCarUxRestrictions(
|
|
45
|
-
maxContentDepth,
|
|
46
|
-
maxCumulativeContentItems,
|
|
47
|
-
maxRestrictedStringLength,
|
|
48
|
-
[&]() {
|
|
49
|
-
size_t __size = activeRestrictions->size();
|
|
50
|
-
std::vector<CarUxRestrictions> __vector;
|
|
51
|
-
__vector.reserve(__size);
|
|
52
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
53
|
-
auto __element = activeRestrictions->getElement(__i);
|
|
54
|
-
__vector.push_back(__element->toCpp());
|
|
55
|
-
}
|
|
56
|
-
return __vector;
|
|
57
|
-
}()
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
public:
|
|
62
|
-
/**
|
|
63
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
64
|
-
*/
|
|
65
|
-
[[maybe_unused]]
|
|
66
|
-
static jni::local_ref<JActiveCarUxRestrictions::javaobject> fromCpp(const ActiveCarUxRestrictions& value) {
|
|
67
|
-
using JSignature = JActiveCarUxRestrictions(double, double, double, jni::alias_ref<jni::JArrayClass<JCarUxRestrictions>>);
|
|
68
|
-
static const auto clazz = javaClassStatic();
|
|
69
|
-
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
70
|
-
return create(
|
|
71
|
-
clazz,
|
|
72
|
-
value.maxContentDepth,
|
|
73
|
-
value.maxCumulativeContentItems,
|
|
74
|
-
value.maxRestrictedStringLength,
|
|
75
|
-
[&]() {
|
|
76
|
-
size_t __size = value.activeRestrictions.size();
|
|
77
|
-
jni::local_ref<jni::JArrayClass<JCarUxRestrictions>> __array = jni::JArrayClass<JCarUxRestrictions>::newArray(__size);
|
|
78
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
79
|
-
const auto& __element = value.activeRestrictions[__i];
|
|
80
|
-
auto __elementJni = JCarUxRestrictions::fromCpp(__element);
|
|
81
|
-
__array->setElement(__i, *__elementJni);
|
|
82
|
-
}
|
|
83
|
-
return __array;
|
|
84
|
-
}()
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JAppFocusState.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 "AppFocusState.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 "AppFocusState" and the the Kotlin data class "AppFocusState".
|
|
21
|
-
*/
|
|
22
|
-
struct JAppFocusState final: public jni::JavaClass<JAppFocusState> {
|
|
23
|
-
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/AppFocusState;";
|
|
25
|
-
|
|
26
|
-
public:
|
|
27
|
-
/**
|
|
28
|
-
* Convert this Java/Kotlin-based struct to the C++ struct AppFocusState by copying all values to C++.
|
|
29
|
-
*/
|
|
30
|
-
[[maybe_unused]]
|
|
31
|
-
[[nodiscard]]
|
|
32
|
-
AppFocusState toCpp() const {
|
|
33
|
-
static const auto clazz = javaClassStatic();
|
|
34
|
-
static const auto fieldIsFocusOwned = clazz->getField<jni::JBoolean>("isFocusOwned");
|
|
35
|
-
jni::local_ref<jni::JBoolean> isFocusOwned = this->getFieldValue(fieldIsFocusOwned);
|
|
36
|
-
static const auto fieldIsFocusActive = clazz->getField<jni::JBoolean>("isFocusActive");
|
|
37
|
-
jni::local_ref<jni::JBoolean> isFocusActive = this->getFieldValue(fieldIsFocusActive);
|
|
38
|
-
return AppFocusState(
|
|
39
|
-
isFocusOwned != nullptr ? std::make_optional(static_cast<bool>(isFocusOwned->value())) : std::nullopt,
|
|
40
|
-
isFocusActive != nullptr ? std::make_optional(static_cast<bool>(isFocusActive->value())) : std::nullopt
|
|
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<JAppFocusState::javaobject> fromCpp(const AppFocusState& value) {
|
|
50
|
-
using JSignature = JAppFocusState(jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>);
|
|
51
|
-
static const auto clazz = javaClassStatic();
|
|
52
|
-
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
53
|
-
return create(
|
|
54
|
-
clazz,
|
|
55
|
-
value.isFocusOwned.has_value() ? jni::JBoolean::valueOf(value.isFocusOwned.value()) : nullptr,
|
|
56
|
-
value.isFocusActive.has_value() ? jni::JBoolean::valueOf(value.isFocusActive.value()) : nullptr
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JCarUxRestrictions.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 "CarUxRestrictions.hpp"
|
|
12
|
-
|
|
13
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
14
|
-
|
|
15
|
-
using namespace facebook;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "CarUxRestrictions" and the the Kotlin enum "CarUxRestrictions".
|
|
19
|
-
*/
|
|
20
|
-
struct JCarUxRestrictions final: public jni::JavaClass<JCarUxRestrictions> {
|
|
21
|
-
public:
|
|
22
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/CarUxRestrictions;";
|
|
23
|
-
|
|
24
|
-
public:
|
|
25
|
-
/**
|
|
26
|
-
* Convert this Java/Kotlin-based enum to the C++ enum CarUxRestrictions.
|
|
27
|
-
*/
|
|
28
|
-
[[maybe_unused]]
|
|
29
|
-
[[nodiscard]]
|
|
30
|
-
CarUxRestrictions 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<CarUxRestrictions>(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<JCarUxRestrictions> fromCpp(CarUxRestrictions value) {
|
|
43
|
-
static const auto clazz = javaClassStatic();
|
|
44
|
-
switch (value) {
|
|
45
|
-
case CarUxRestrictions::UX_RESTRICTIONS_FULLY_RESTRICTED:
|
|
46
|
-
static const auto fieldUX_RESTRICTIONS_FULLY_RESTRICTED = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_FULLY_RESTRICTED");
|
|
47
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_FULLY_RESTRICTED);
|
|
48
|
-
case CarUxRestrictions::UX_RESTRICTIONS_LIMIT_CONTENT:
|
|
49
|
-
static const auto fieldUX_RESTRICTIONS_LIMIT_CONTENT = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_LIMIT_CONTENT");
|
|
50
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_LIMIT_CONTENT);
|
|
51
|
-
case CarUxRestrictions::UX_RESTRICTIONS_LIMIT_STRING_LENGTH:
|
|
52
|
-
static const auto fieldUX_RESTRICTIONS_LIMIT_STRING_LENGTH = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_LIMIT_STRING_LENGTH");
|
|
53
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_LIMIT_STRING_LENGTH);
|
|
54
|
-
case CarUxRestrictions::UX_RESTRICTIONS_NO_DIALPAD:
|
|
55
|
-
static const auto fieldUX_RESTRICTIONS_NO_DIALPAD = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_DIALPAD");
|
|
56
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_DIALPAD);
|
|
57
|
-
case CarUxRestrictions::UX_RESTRICTIONS_NO_FILTERING:
|
|
58
|
-
static const auto fieldUX_RESTRICTIONS_NO_FILTERING = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_FILTERING");
|
|
59
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_FILTERING);
|
|
60
|
-
case CarUxRestrictions::UX_RESTRICTIONS_NO_KEYBOARD:
|
|
61
|
-
static const auto fieldUX_RESTRICTIONS_NO_KEYBOARD = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_KEYBOARD");
|
|
62
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_KEYBOARD);
|
|
63
|
-
case CarUxRestrictions::UX_RESTRICTIONS_NO_SETUP:
|
|
64
|
-
static const auto fieldUX_RESTRICTIONS_NO_SETUP = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_SETUP");
|
|
65
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_SETUP);
|
|
66
|
-
case CarUxRestrictions::UX_RESTRICTIONS_NO_TEXT_MESSAGE:
|
|
67
|
-
static const auto fieldUX_RESTRICTIONS_NO_TEXT_MESSAGE = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_TEXT_MESSAGE");
|
|
68
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_TEXT_MESSAGE);
|
|
69
|
-
case CarUxRestrictions::UX_RESTRICTIONS_NO_VIDEO:
|
|
70
|
-
static const auto fieldUX_RESTRICTIONS_NO_VIDEO = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_VIDEO");
|
|
71
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_VIDEO);
|
|
72
|
-
case CarUxRestrictions::UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION:
|
|
73
|
-
static const auto fieldUX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION");
|
|
74
|
-
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION);
|
|
75
|
-
default:
|
|
76
|
-
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
77
|
-
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JFunc_void_ActiveCarUxRestrictions.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 <functional>
|
|
12
|
-
|
|
13
|
-
#include "ActiveCarUxRestrictions.hpp"
|
|
14
|
-
#include <functional>
|
|
15
|
-
#include <NitroModules/JNICallable.hpp>
|
|
16
|
-
#include "JActiveCarUxRestrictions.hpp"
|
|
17
|
-
#include "CarUxRestrictions.hpp"
|
|
18
|
-
#include <vector>
|
|
19
|
-
#include "JCarUxRestrictions.hpp"
|
|
20
|
-
|
|
21
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
22
|
-
|
|
23
|
-
using namespace facebook;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Represents the Java/Kotlin callback `(restrictions: ActiveCarUxRestrictions) -> Unit`.
|
|
27
|
-
* This can be passed around between C++ and Java/Kotlin.
|
|
28
|
-
*/
|
|
29
|
-
struct JFunc_void_ActiveCarUxRestrictions: public jni::JavaClass<JFunc_void_ActiveCarUxRestrictions> {
|
|
30
|
-
public:
|
|
31
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions;";
|
|
32
|
-
|
|
33
|
-
public:
|
|
34
|
-
/**
|
|
35
|
-
* Invokes the function this `JFunc_void_ActiveCarUxRestrictions` instance holds through JNI.
|
|
36
|
-
*/
|
|
37
|
-
void invoke(const ActiveCarUxRestrictions& restrictions) const {
|
|
38
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JActiveCarUxRestrictions> /* restrictions */)>("invoke");
|
|
39
|
-
method(self(), JActiveCarUxRestrictions::fromCpp(restrictions));
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* An implementation of Func_void_ActiveCarUxRestrictions that is backed by a C++ implementation (using `std::function<...>`)
|
|
45
|
-
*/
|
|
46
|
-
class JFunc_void_ActiveCarUxRestrictions_cxx final: public jni::HybridClass<JFunc_void_ActiveCarUxRestrictions_cxx, JFunc_void_ActiveCarUxRestrictions> {
|
|
47
|
-
public:
|
|
48
|
-
static jni::local_ref<JFunc_void_ActiveCarUxRestrictions::javaobject> fromCpp(const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& func) {
|
|
49
|
-
return JFunc_void_ActiveCarUxRestrictions_cxx::newObjectCxxArgs(func);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public:
|
|
53
|
-
/**
|
|
54
|
-
* Invokes the C++ `std::function<...>` this `JFunc_void_ActiveCarUxRestrictions_cxx` instance holds.
|
|
55
|
-
*/
|
|
56
|
-
void invoke_cxx(jni::alias_ref<JActiveCarUxRestrictions> restrictions) {
|
|
57
|
-
_func(restrictions->toCpp());
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public:
|
|
61
|
-
[[nodiscard]]
|
|
62
|
-
inline const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& getFunction() const {
|
|
63
|
-
return _func;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public:
|
|
67
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions_cxx;";
|
|
68
|
-
static void registerNatives() {
|
|
69
|
-
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_ActiveCarUxRestrictions_cxx::invoke_cxx)});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private:
|
|
73
|
-
explicit JFunc_void_ActiveCarUxRestrictions_cxx(const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& func): _func(func) { }
|
|
74
|
-
|
|
75
|
-
private:
|
|
76
|
-
friend HybridBase;
|
|
77
|
-
std::function<void(const ActiveCarUxRestrictions& /* restrictions */)> _func;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|