diff --git a/web/webview/interfaces/native/arkweb_error_code.h b/web/webview/interfaces/native/arkweb_error_code.h index 64db3082c4fa8496a392e37585e4b04dec261516..e225750abed5635e73f759226a49ee1ba5fd6704 100644 --- a/web/webview/interfaces/native/arkweb_error_code.h +++ b/web/webview/interfaces/native/arkweb_error_code.h @@ -53,6 +53,7 @@ ARKWEB_INVALID_URL = 17100103, /** @error Invalid cookie value. */ ARKWEB_INVALID_COOKIE_VALUE = 17100104, + } ArkWeb_ErrorCode; #endif // ARKWEB_ERROR_CODE_H diff --git a/web/webview/interfaces/native/native_interface_arkweb.h b/web/webview/interfaces/native/native_interface_arkweb.h index 96b779bf4f572be5f9f493a9100db59acd4cf858..77175d1d684a90355d6d98bd211f3c9a4bad0d06 100644 --- a/web/webview/interfaces/native/native_interface_arkweb.h +++ b/web/webview/interfaces/native/native_interface_arkweb.h @@ -153,8 +153,34 @@ void OH_NativeArkWeb_SetDestroyCallback(const char* webTag, NativeArkWeb_OnDestr */ NativeArkWeb_OnDestroyCallback OH_NativeArkWeb_GetDestroyCallback(const char* webTag); +/** + * @brief Loads the data or URL. + * This function should be called on main thread. + * + * @param webTag The name of the web component. + * @param data A string encoded according to "Base64" or "URL", should not be NULL. + * @param mimeType Media type. For example: "text/html", should not be NULL. + * @param encoding Encoding type. For example: "UTF-8", should not be NULL. + * @param baseUrl A specified URL path ("http"/"https"/"data" protocol), + * which is assigned to window.origin by the Web component. + * @param historyUrl History URL. When it is not empty, it can be managed by + * history records to realize the back and forth function. + * @return LoadData result code. + * {@link ARKWEB_SUCCESS} load data success. + * {@link ARKWEB_INVALID_PARAM} Mandatory parameters are left unspecified or + * Incorrect parameter types or Parameter verification failed. + * @syscap SystemCapability.Web.Webview.Core + * @since 16 + */ +ArkWeb_ErrorCode OH_NativeArkWeb_LoadData(const char* webTag, + const char* data, + const char* mimeType, + const char* encoding, + const char* baseUrl, + const char* historyUrl); + #ifdef __cplusplus }; #endif #endif // NATIVE_INTERFACE_ARKWEB_H -/** @} */ \ No newline at end of file +/** @} */