@react-native-ohos/react-native-webview 13.10.5-rc.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/LICENSE +21 -0
- package/README.md +13 -0
- package/harmony/rn_webview/BuildProfile.ets +41 -0
- package/harmony/rn_webview/LICENSE +21 -0
- package/harmony/rn_webview/NOTICE +33 -0
- package/harmony/rn_webview/OAT.xml +45 -0
- package/harmony/rn_webview/README.OpenSource +11 -0
- package/harmony/rn_webview/build-profile.json5 +28 -0
- package/harmony/rn_webview/consumer-rules.txt +0 -0
- package/harmony/rn_webview/hvigorfile.ts +1 -0
- package/harmony/rn_webview/index.ets +34 -0
- package/harmony/rn_webview/obfuscation-rules.txt +18 -0
- package/harmony/rn_webview/oh-package.json5 +13 -0
- package/harmony/rn_webview/src/main/cpp/CMakeLists.txt +9 -0
- package/harmony/rn_webview/src/main/cpp/WebViewPackage.h +37 -0
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/BaseReactNativeWebviewPackage.h +95 -0
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/components/RNCWebViewJSIBinder.h +126 -0
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.cpp +20 -0
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.h +16 -0
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.cpp +19 -0
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.h +16 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ComponentDescriptors.h +22 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.cpp +240 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.h +285 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.cpp +151 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.h +337 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.cpp +19 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.h +34 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.cpp +16 -0
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.h +20 -0
- package/harmony/rn_webview/src/main/ets/CutomReference.ts +50 -0
- package/harmony/rn_webview/src/main/ets/Logger.ts +64 -0
- package/harmony/rn_webview/src/main/ets/Magic.ets +205 -0
- package/harmony/rn_webview/src/main/ets/RNCWebView.ets +607 -0
- package/harmony/rn_webview/src/main/ets/RNCWebViewPackage.ets +66 -0
- package/harmony/rn_webview/src/main/ets/ShouldRequestUrl.ts +68 -0
- package/harmony/rn_webview/src/main/ets/WebViewBaseOperate.ets +463 -0
- package/harmony/rn_webview/src/main/ets/WebViewTurboModule.ets +78 -0
- package/harmony/rn_webview/src/main/ets/generated/components/RNCWebView.ts +509 -0
- package/harmony/rn_webview/src/main/ets/generated/components/ts.ts +5 -0
- package/harmony/rn_webview/src/main/ets/generated/index.ets +5 -0
- package/harmony/rn_webview/src/main/ets/generated/ts.ts +6 -0
- package/harmony/rn_webview/src/main/ets/generated/turboModules/RNCWebView.ts +18 -0
- package/harmony/rn_webview/src/main/ets/generated/turboModules/RNCWebViewModule.ts +16 -0
- package/harmony/rn_webview/src/main/ets/generated/turboModules/ts.ts +6 -0
- package/harmony/rn_webview/src/main/module.json5 +11 -0
- package/harmony/rn_webview/src/main/resources/base/element/string.json +40 -0
- package/harmony/rn_webview/src/main/resources/en_US/element/string.json +40 -0
- package/harmony/rn_webview/src/main/resources/zh_CN/element/string.json +40 -0
- package/harmony/rn_webview/src/test/List.test.ets +5 -0
- package/harmony/rn_webview/src/test/LocalUnit.test.ets +33 -0
- package/harmony/rn_webview/ts.ets +29 -0
- package/harmony/rn_webview.har +0 -0
- package/package.json +107 -0
- package/src/NativeRNCWebView.ts +16 -0
- package/src/NativeRNCWebViewModule.ts +17 -0
- package/src/RNCWebViewNativeComponent.ts +286 -0
- package/src/WebView.harmony.tsx +330 -0
- package/src/WebView.tsx +4 -0
- package/src/codegenUtils.ts +9 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/react_native_webview/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
|
|
16
|
+
namespace facebook {
|
|
17
|
+
namespace react {
|
|
18
|
+
|
|
19
|
+
using RNCWebViewComponentDescriptor = ConcreteComponentDescriptor<RNCWebViewShadowNode>;
|
|
20
|
+
|
|
21
|
+
} // namespace react
|
|
22
|
+
} // namespace facebook
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/react_native_webview/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
namespace facebook {
|
|
14
|
+
namespace react {
|
|
15
|
+
void RNCWebViewEventEmitter::onContentSizeChange(OnContentSizeChange $event) const
|
|
16
|
+
{
|
|
17
|
+
dispatchEvent("contentSizeChange", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
18
|
+
auto $payload = jsi::Object(runtime);
|
|
19
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
20
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
21
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
22
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
23
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
24
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
25
|
+
return $payload;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
void RNCWebViewEventEmitter::onRenderProcessGone(OnRenderProcessGone $event) const
|
|
29
|
+
{
|
|
30
|
+
dispatchEvent("renderProcessGone", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
31
|
+
auto $payload = jsi::Object(runtime);
|
|
32
|
+
$payload.setProperty(runtime, "didCrash", $event.didCrash);
|
|
33
|
+
return $payload;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
void RNCWebViewEventEmitter::onContentProcessDidTerminate(OnContentProcessDidTerminate $event) const
|
|
38
|
+
{
|
|
39
|
+
dispatchEvent("contentProcessDidTerminate", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
40
|
+
auto $payload = jsi::Object(runtime);
|
|
41
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
42
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
43
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
44
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
45
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
46
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
47
|
+
return $payload;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
void RNCWebViewEventEmitter::onCustomMenuSelection(OnCustomMenuSelection $event) const
|
|
52
|
+
{
|
|
53
|
+
dispatchEvent("customMenuSelection", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
54
|
+
auto $payload = jsi::Object(runtime);
|
|
55
|
+
$payload.setProperty(runtime, "label", $event.label);
|
|
56
|
+
$payload.setProperty(runtime, "key", $event.key);
|
|
57
|
+
$payload.setProperty(runtime, "selectedText", $event.selectedText);
|
|
58
|
+
return $payload;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
void RNCWebViewEventEmitter::onFileDownload(OnFileDownload $event) const
|
|
63
|
+
{
|
|
64
|
+
dispatchEvent("fileDownload", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
65
|
+
auto $payload = jsi::Object(runtime);
|
|
66
|
+
$payload.setProperty(runtime, "downloadUrl", $event.downloadUrl);
|
|
67
|
+
return $payload;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
void RNCWebViewEventEmitter::onLoadingError(OnLoadingError $event) const
|
|
72
|
+
{
|
|
73
|
+
dispatchEvent("loadingError", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
74
|
+
auto $payload = jsi::Object(runtime);
|
|
75
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
76
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
77
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
78
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
79
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
80
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
81
|
+
$payload.setProperty(runtime, "domain", $event.domain);
|
|
82
|
+
$payload.setProperty(runtime, "code", $event.code);
|
|
83
|
+
$payload.setProperty(runtime, "description", $event.description);
|
|
84
|
+
return $payload;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
void RNCWebViewEventEmitter::onLoadingFinish(OnLoadingFinish $event) const
|
|
89
|
+
{
|
|
90
|
+
dispatchEvent("loadingFinish", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
91
|
+
auto $payload = jsi::Object(runtime);
|
|
92
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
93
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
94
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
95
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
96
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
97
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
98
|
+
$payload.setProperty(runtime, "navigationType", toString($event.navigationType));
|
|
99
|
+
$payload.setProperty(runtime, "mainDocumentURL", $event.mainDocumentURL);
|
|
100
|
+
return $payload;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
void RNCWebViewEventEmitter::onLoadingProgress(OnLoadingProgress $event) const
|
|
105
|
+
{
|
|
106
|
+
dispatchEvent("loadingProgress", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
107
|
+
auto $payload = jsi::Object(runtime);
|
|
108
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
109
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
110
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
111
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
112
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
113
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
114
|
+
$payload.setProperty(runtime, "progress", $event.progress);
|
|
115
|
+
return $payload;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
void RNCWebViewEventEmitter::onLoadingStart(OnLoadingStart $event) const
|
|
120
|
+
{
|
|
121
|
+
dispatchEvent("loadingStart", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
122
|
+
auto $payload = jsi::Object(runtime);
|
|
123
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
124
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
125
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
126
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
127
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
128
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
129
|
+
$payload.setProperty(runtime, "navigationType", toString($event.navigationType));
|
|
130
|
+
$payload.setProperty(runtime, "mainDocumentURL", $event.mainDocumentURL);
|
|
131
|
+
return $payload;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
void RNCWebViewEventEmitter::onHttpError(OnHttpError $event) const
|
|
136
|
+
{
|
|
137
|
+
dispatchEvent("httpError", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
138
|
+
auto $payload = jsi::Object(runtime);
|
|
139
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
140
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
141
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
142
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
143
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
144
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
145
|
+
$payload.setProperty(runtime, "description", $event.description);
|
|
146
|
+
$payload.setProperty(runtime, "statusCode", $event.statusCode);
|
|
147
|
+
return $payload;
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
void RNCWebViewEventEmitter::onMessage(OnMessage $event) const
|
|
152
|
+
{
|
|
153
|
+
dispatchEvent("message", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
154
|
+
auto $payload = jsi::Object(runtime);
|
|
155
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
156
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
157
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
158
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
159
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
160
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
161
|
+
$payload.setProperty(runtime, "data", $event.data);
|
|
162
|
+
return $payload;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
void RNCWebViewEventEmitter::onOpenWindow(OnOpenWindow $event) const
|
|
167
|
+
{
|
|
168
|
+
dispatchEvent("openWindow", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
169
|
+
auto $payload = jsi::Object(runtime);
|
|
170
|
+
$payload.setProperty(runtime, "targetUrl", $event.targetUrl);
|
|
171
|
+
return $payload;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
void RNCWebViewEventEmitter::onScroll(OnScroll $event) const
|
|
176
|
+
{
|
|
177
|
+
dispatchEvent("scroll", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
178
|
+
auto $payload = jsi::Object(runtime);
|
|
179
|
+
{
|
|
180
|
+
auto contentInset = jsi::Object(runtime);
|
|
181
|
+
contentInset.setProperty(runtime, "bottom", $event.contentInset.bottom);
|
|
182
|
+
contentInset.setProperty(runtime, "left", $event.contentInset.left);
|
|
183
|
+
contentInset.setProperty(runtime, "right", $event.contentInset.right);
|
|
184
|
+
contentInset.setProperty(runtime, "top", $event.contentInset.top);
|
|
185
|
+
$payload.setProperty(runtime, "contentInset", contentInset);
|
|
186
|
+
}
|
|
187
|
+
{
|
|
188
|
+
auto contentOffset = jsi::Object(runtime);
|
|
189
|
+
contentOffset.setProperty(runtime, "y", $event.contentOffset.y);
|
|
190
|
+
contentOffset.setProperty(runtime, "x", $event.contentOffset.x);
|
|
191
|
+
$payload.setProperty(runtime, "contentOffset", contentOffset);
|
|
192
|
+
}
|
|
193
|
+
{
|
|
194
|
+
auto contentSize = jsi::Object(runtime);
|
|
195
|
+
contentSize.setProperty(runtime, "height", $event.contentSize.height);
|
|
196
|
+
contentSize.setProperty(runtime, "width", $event.contentSize.width);
|
|
197
|
+
$payload.setProperty(runtime, "contentSize", contentSize);
|
|
198
|
+
}
|
|
199
|
+
{
|
|
200
|
+
auto layoutMeasurement = jsi::Object(runtime);
|
|
201
|
+
layoutMeasurement.setProperty(runtime, "height", $event.layoutMeasurement.height);
|
|
202
|
+
layoutMeasurement.setProperty(runtime, "width", $event.layoutMeasurement.width);
|
|
203
|
+
$payload.setProperty(runtime, "layoutMeasurement", layoutMeasurement);
|
|
204
|
+
}
|
|
205
|
+
{
|
|
206
|
+
auto targetContentOffset = jsi::Object(runtime);
|
|
207
|
+
targetContentOffset.setProperty(runtime, "y", $event.targetContentOffset.y);
|
|
208
|
+
targetContentOffset.setProperty(runtime, "x", $event.targetContentOffset.x);
|
|
209
|
+
$payload.setProperty(runtime, "targetContentOffset", targetContentOffset);
|
|
210
|
+
}
|
|
211
|
+
{
|
|
212
|
+
auto velocity = jsi::Object(runtime);
|
|
213
|
+
velocity.setProperty(runtime, "y", $event.velocity.y);
|
|
214
|
+
velocity.setProperty(runtime, "x", $event.velocity.x);
|
|
215
|
+
$payload.setProperty(runtime, "velocity", velocity);
|
|
216
|
+
}
|
|
217
|
+
$payload.setProperty(runtime, "zoomScale", $event.zoomScale);
|
|
218
|
+
$payload.setProperty(runtime, "responderIgnoreScroll", $event.responderIgnoreScroll);
|
|
219
|
+
return $payload;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
void RNCWebViewEventEmitter::onShouldStartLoadWithRequest(OnShouldStartLoadWithRequest $event) const
|
|
224
|
+
{
|
|
225
|
+
dispatchEvent("shouldStartLoadWithRequest", [$event = std::move($event)](jsi::Runtime &runtime) {
|
|
226
|
+
auto $payload = jsi::Object(runtime);
|
|
227
|
+
$payload.setProperty(runtime, "url", $event.url);
|
|
228
|
+
$payload.setProperty(runtime, "loading", $event.loading);
|
|
229
|
+
$payload.setProperty(runtime, "title", $event.title);
|
|
230
|
+
$payload.setProperty(runtime, "canGoBack", $event.canGoBack);
|
|
231
|
+
$payload.setProperty(runtime, "canGoForward", $event.canGoForward);
|
|
232
|
+
$payload.setProperty(runtime, "lockIdentifier", $event.lockIdentifier);
|
|
233
|
+
$payload.setProperty(runtime, "navigationType", toString($event.navigationType));
|
|
234
|
+
$payload.setProperty(runtime, "mainDocumentURL", $event.mainDocumentURL);
|
|
235
|
+
$payload.setProperty(runtime, "isTopFrame", $event.isTopFrame);
|
|
236
|
+
return $payload;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
} // namespace react
|
|
240
|
+
} // namespace facebook
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
namespace facebook {
|
|
15
|
+
namespace react {
|
|
16
|
+
class RNCWebViewEventEmitter : public ViewEventEmitter {
|
|
17
|
+
public:
|
|
18
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
19
|
+
|
|
20
|
+
struct OnContentSizeChange {
|
|
21
|
+
std::string url;
|
|
22
|
+
bool loading;
|
|
23
|
+
std::string title;
|
|
24
|
+
bool canGoBack;
|
|
25
|
+
bool canGoForward;
|
|
26
|
+
double lockIdentifier;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
struct OnRenderProcessGone {
|
|
30
|
+
bool didCrash;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
struct OnContentProcessDidTerminate {
|
|
34
|
+
std::string url;
|
|
35
|
+
bool loading;
|
|
36
|
+
std::string title;
|
|
37
|
+
bool canGoBack;
|
|
38
|
+
bool canGoForward;
|
|
39
|
+
double lockIdentifier;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
struct OnCustomMenuSelection {
|
|
43
|
+
std::string label;
|
|
44
|
+
std::string key;
|
|
45
|
+
std::string selectedText;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
struct OnFileDownload {
|
|
49
|
+
std::string downloadUrl;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
struct OnLoadingError {
|
|
53
|
+
std::string url;
|
|
54
|
+
bool loading;
|
|
55
|
+
std::string title;
|
|
56
|
+
bool canGoBack;
|
|
57
|
+
bool canGoForward;
|
|
58
|
+
double lockIdentifier;
|
|
59
|
+
std::string domain;
|
|
60
|
+
int code;
|
|
61
|
+
std::string description;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
enum class OnLoadingFinishNavigationType {
|
|
65
|
+
Click,
|
|
66
|
+
Formsubmit,
|
|
67
|
+
Backforward,
|
|
68
|
+
Reload,
|
|
69
|
+
Formresubmit,
|
|
70
|
+
Other
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
static char const *toString(const OnLoadingFinishNavigationType value)
|
|
74
|
+
{
|
|
75
|
+
switch (value) {
|
|
76
|
+
case OnLoadingFinishNavigationType::Click:
|
|
77
|
+
return "click";
|
|
78
|
+
case OnLoadingFinishNavigationType::Formsubmit:
|
|
79
|
+
return "formsubmit";
|
|
80
|
+
case OnLoadingFinishNavigationType::Backforward:
|
|
81
|
+
return "backforward";
|
|
82
|
+
case OnLoadingFinishNavigationType::Reload:
|
|
83
|
+
return "reload";
|
|
84
|
+
case OnLoadingFinishNavigationType::Formresubmit:
|
|
85
|
+
return "formresubmit";
|
|
86
|
+
case OnLoadingFinishNavigationType::Other:
|
|
87
|
+
return "other";
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
struct OnLoadingFinish {
|
|
92
|
+
std::string url;
|
|
93
|
+
bool loading;
|
|
94
|
+
std::string title;
|
|
95
|
+
bool canGoBack;
|
|
96
|
+
bool canGoForward;
|
|
97
|
+
double lockIdentifier;
|
|
98
|
+
OnLoadingFinishNavigationType navigationType;
|
|
99
|
+
std::string mainDocumentURL;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
struct OnLoadingProgress {
|
|
103
|
+
std::string url;
|
|
104
|
+
bool loading;
|
|
105
|
+
std::string title;
|
|
106
|
+
bool canGoBack;
|
|
107
|
+
bool canGoForward;
|
|
108
|
+
double lockIdentifier;
|
|
109
|
+
double progress;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
enum class OnLoadingStartNavigationType {
|
|
113
|
+
Click,
|
|
114
|
+
Formsubmit,
|
|
115
|
+
Backforward,
|
|
116
|
+
Reload,
|
|
117
|
+
Formresubmit,
|
|
118
|
+
Other
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
static char const *toString(const OnLoadingStartNavigationType value)
|
|
122
|
+
{
|
|
123
|
+
switch (value) {
|
|
124
|
+
case OnLoadingStartNavigationType::Click:
|
|
125
|
+
return "click";
|
|
126
|
+
case OnLoadingStartNavigationType::Formsubmit:
|
|
127
|
+
return "formsubmit";
|
|
128
|
+
case OnLoadingStartNavigationType::Backforward:
|
|
129
|
+
return "backforward";
|
|
130
|
+
case OnLoadingStartNavigationType::Reload:
|
|
131
|
+
return "reload";
|
|
132
|
+
case OnLoadingStartNavigationType::Formresubmit:
|
|
133
|
+
return "formresubmit";
|
|
134
|
+
case OnLoadingStartNavigationType::Other:
|
|
135
|
+
return "other";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
struct OnLoadingStart {
|
|
140
|
+
std::string url;
|
|
141
|
+
bool loading;
|
|
142
|
+
std::string title;
|
|
143
|
+
bool canGoBack;
|
|
144
|
+
bool canGoForward;
|
|
145
|
+
double lockIdentifier;
|
|
146
|
+
OnLoadingStartNavigationType navigationType;
|
|
147
|
+
std::string mainDocumentURL;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
struct OnHttpError {
|
|
151
|
+
std::string url;
|
|
152
|
+
bool loading;
|
|
153
|
+
std::string title;
|
|
154
|
+
bool canGoBack;
|
|
155
|
+
bool canGoForward;
|
|
156
|
+
double lockIdentifier;
|
|
157
|
+
std::string description;
|
|
158
|
+
int statusCode;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
struct OnMessage {
|
|
162
|
+
std::string url;
|
|
163
|
+
bool loading;
|
|
164
|
+
std::string title;
|
|
165
|
+
bool canGoBack;
|
|
166
|
+
bool canGoForward;
|
|
167
|
+
double lockIdentifier;
|
|
168
|
+
std::string data;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
struct OnOpenWindow {
|
|
172
|
+
std::string targetUrl;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
struct OnScrollContentInset {
|
|
176
|
+
double bottom;
|
|
177
|
+
double left;
|
|
178
|
+
double right;
|
|
179
|
+
double top;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
struct OnScrollContentOffset {
|
|
183
|
+
double y;
|
|
184
|
+
double x;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
struct OnScrollContentSize {
|
|
188
|
+
double height;
|
|
189
|
+
double width;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
struct OnScrollLayoutMeasurement {
|
|
193
|
+
double height;
|
|
194
|
+
double width;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
struct OnScrollTargetContentOffset {
|
|
198
|
+
double y;
|
|
199
|
+
double x;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
struct OnScrollVelocity {
|
|
203
|
+
double y;
|
|
204
|
+
double x;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
struct OnScroll {
|
|
208
|
+
OnScrollContentInset contentInset;
|
|
209
|
+
OnScrollContentOffset contentOffset;
|
|
210
|
+
OnScrollContentSize contentSize;
|
|
211
|
+
OnScrollLayoutMeasurement layoutMeasurement;
|
|
212
|
+
OnScrollTargetContentOffset targetContentOffset;
|
|
213
|
+
OnScrollVelocity velocity;
|
|
214
|
+
double zoomScale;
|
|
215
|
+
bool responderIgnoreScroll;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
enum class OnShouldStartLoadWithRequestNavigationType {
|
|
219
|
+
Click,
|
|
220
|
+
Formsubmit,
|
|
221
|
+
Backforward,
|
|
222
|
+
Reload,
|
|
223
|
+
Formresubmit,
|
|
224
|
+
Other
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
static char const *toString(const OnShouldStartLoadWithRequestNavigationType value)
|
|
228
|
+
{
|
|
229
|
+
switch (value) {
|
|
230
|
+
case OnShouldStartLoadWithRequestNavigationType::Click:
|
|
231
|
+
return "click";
|
|
232
|
+
case OnShouldStartLoadWithRequestNavigationType::Formsubmit:
|
|
233
|
+
return "formsubmit";
|
|
234
|
+
case OnShouldStartLoadWithRequestNavigationType::Backforward:
|
|
235
|
+
return "backforward";
|
|
236
|
+
case OnShouldStartLoadWithRequestNavigationType::Reload:
|
|
237
|
+
return "reload";
|
|
238
|
+
case OnShouldStartLoadWithRequestNavigationType::Formresubmit:
|
|
239
|
+
return "formresubmit";
|
|
240
|
+
case OnShouldStartLoadWithRequestNavigationType::Other:
|
|
241
|
+
return "other";
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
struct OnShouldStartLoadWithRequest {
|
|
246
|
+
std::string url;
|
|
247
|
+
bool loading;
|
|
248
|
+
std::string title;
|
|
249
|
+
bool canGoBack;
|
|
250
|
+
bool canGoForward;
|
|
251
|
+
double lockIdentifier;
|
|
252
|
+
OnShouldStartLoadWithRequestNavigationType navigationType;
|
|
253
|
+
std::string mainDocumentURL;
|
|
254
|
+
bool isTopFrame;
|
|
255
|
+
};
|
|
256
|
+
void onContentSizeChange(OnContentSizeChange value) const;
|
|
257
|
+
|
|
258
|
+
void onRenderProcessGone(OnRenderProcessGone value) const;
|
|
259
|
+
|
|
260
|
+
void onContentProcessDidTerminate(OnContentProcessDidTerminate value) const;
|
|
261
|
+
|
|
262
|
+
void onCustomMenuSelection(OnCustomMenuSelection value) const;
|
|
263
|
+
|
|
264
|
+
void onFileDownload(OnFileDownload value) const;
|
|
265
|
+
|
|
266
|
+
void onLoadingError(OnLoadingError value) const;
|
|
267
|
+
|
|
268
|
+
void onLoadingFinish(OnLoadingFinish value) const;
|
|
269
|
+
|
|
270
|
+
void onLoadingProgress(OnLoadingProgress value) const;
|
|
271
|
+
|
|
272
|
+
void onLoadingStart(OnLoadingStart value) const;
|
|
273
|
+
|
|
274
|
+
void onHttpError(OnHttpError value) const;
|
|
275
|
+
|
|
276
|
+
void onMessage(OnMessage value) const;
|
|
277
|
+
|
|
278
|
+
void onOpenWindow(OnOpenWindow value) const;
|
|
279
|
+
|
|
280
|
+
void onScroll(OnScroll value) const;
|
|
281
|
+
|
|
282
|
+
void onShouldStartLoadWithRequest(OnShouldStartLoadWithRequest value) const;
|
|
283
|
+
};
|
|
284
|
+
} // namespace react
|
|
285
|
+
} // namespace facebook
|