harmony 鸿蒙arkweb_type.h

2025-06-12 浏览 (1)

arkweb_type.h

Overview

Defines the native common types of ArkWeb.

Library: libohweb.so

File to include: <web/arkweb_type.h>

System capability: SystemCapability.Web.Webview.Core

Since: 12

Related module: Web

Summary

Structs

NameDescription
struct  ArkWeb_JavaScriptBridgeDataDefines the JavaScript Bridge data.
struct  ArkWeb_JavaScriptObjectDefines a JavaScript object.
struct  ArkWeb_ProxyMethodDefines a proxy method.
struct  ArkWeb_ProxyMethodWithResultDefines a proxy method.
struct  ArkWeb_ProxyObjectDefines a proxy object.
struct  ArkWeb_ProxyObjectWithResultDefines a proxy object.
struct  ArkWeb_ControllerAPIDefines a controller API. Before calling the API, you are advised to use ARKWEB_MEMBER_MISSING to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM.
struct  ArkWeb_ComponentAPIDefines a component API.
struct  ArkWeb_WebMessagePortAPIDefines a native API struct of the post message. Before calling the API, you are advised to use ARKWEB_MEMBER_MISSING to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM.
struct  ArkWeb_WebMessageAPIDefines a native API struct of the post message data. Before calling the API, you are advised to use ARKWEB_MEMBER_MISSING to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM.
struct  ArkWeb_CookieManagerAPIDefines a native CookieManager API of ArkWeb. Before calling the API, you are advised to use ARKWEB_MEMBER_MISSING to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM.
struct  ArkWeb_JavaScriptValueAPIDefines the native ArkWeb JavaScriptValue API. Before calling the API, you are advised to use ARKWEB_MEMBER_MISSING to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM.

Macros

NameDescription
ARKWEB_MEMBER_EXISTS(s, f)    ((intptr_t) & ((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= *reinterpret_cast<size_t*>(s))Checks whether the member variable exists in the struct.
ARKWEB_MEMBER_MISSING(s, f)   (!ARKWEB_MEMBER_EXISTS(s, f) ||!((s)->f))Returns false if the member variable exists in the struct; returns true otherwise.

Types

NameDescription
typedef enum ArkWeb_WebMessageType ArkWeb_WebMessageTypeDefines an enum for the data types of post message.
typedef enum ArkWeb_JavaScriptValueType ArkWeb_JavaScriptValueTypeDefines an enum for the JavaScript data types.
typedef struct ArkWeb_WebMessage * ArkWeb_WebMessagePtrDefines a struct for the pointer to the struct of post message data.
typedef struct ArkWeb_JavaScriptValue * ArkWeb_JavaScriptValuePtrDefines a struct for the pointer to the JavaScript data struct.
typedef void(* ArkWeb_OnJavaScriptCallback) (const char *webTag, const ArkWeb_JavaScriptBridgeData *data, void *userData)Defines a callback used when the injected JavaScript is executed.
typedef void(* ArkWeb_OnJavaScriptProxyCallback) (const char *webTag, const ArkWeb_JavaScriptBridgeData *dataArray, size_t arraySize, void *userData)Defines a callback used when the proxy method is executed.
typedef ArkWeb_JavaScriptValuePtr(* ArkWeb_OnJavaScriptProxyCallbackWithResult) (const char *webTag, const ArkWeb_JavaScriptBridgeData *dataArray, size_t arraySize, void *userData)Defines a callback used when the proxy method is executed.
typedef void(* ArkWeb_OnComponentCallback) (const char *webTag, void *userData)Defines a callback used to return component event notification.
typedef struct ArkWeb_WebMessagePort * ArkWeb_WebMessagePortPtrDefines a struct for the pointer to the struct of post message port.
typedef void(* ArkWeb_OnMessageEventHandler) (const char *webTag, const ArkWeb_WebMessagePortPtr port, const ArkWeb_WebMessagePtr message, void *userData)Defines a callback used to process the post message data sent by the HTML page.

Enums

NameDescription
ArkWeb_WebMessageType { ARKWEB_NONE = 0, ARKWEB_STRING, ARKWEB_BUFFER }Enumerates the data types of post message.
ArkWeb_JavaScriptValueType { ARKWEB_JAVASCRIPT_NONE = 0, ARKWEB_JAVASCRIPT_STRING, ARKWEB_JAVASCRIPT_BOOL }Enumerates the JavaScript data types.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkWeb API Reference

harmony 鸿蒙ArkWeb_AnyNativeAPI

harmony 鸿蒙ArkWeb_ComponentAPI

harmony 鸿蒙ArkWeb_ControllerAPI

harmony 鸿蒙ArkWeb_CookieManagerAPI

harmony 鸿蒙ArkWeb_JavaScriptBridgeData

harmony 鸿蒙ArkWeb_JavaScriptObject

harmony 鸿蒙ArkWeb_JavaScriptValueAPI

harmony 鸿蒙ArkWeb_ProxyMethod

harmony 鸿蒙ArkWeb_ProxyMethodWithResult

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/XXbywH