openharmony 鸿蒙 capi-arkweb-interface-h

2026-08-25 浏览 (1)

arkweb_interface.h

Overview

Declares ArkWeb APIs for obtaining native APIs and the basic native API types.

File to include: <web/arkweb_interface.h>

Library: libohweb.so

System capability: SystemCapability.Web.Webview.Core

Since: 12

Related module: Web

Summary

Structs

Nametypedef KeywordDescription
ArkWeb_AnyNativeAPIArkWeb_AnyNativeAPIDefines the basic native API types.

Enums

Nametypedef KeywordDescription
ArkWeb_NativeAPIVariantKindArkWeb_NativeAPIVariantKindEnumerates the native API types.

Functions

NameDescription
ArkWeb_AnyNativeAPI* OH_ArkWeb_GetNativeAPI(ArkWeb_NativeAPIVariantKind type)Obtains the native API struct based on the transferred API type.
bool OH_ArkWeb_RegisterScrollCallback(const char* webTag, ArkWeb_OnScrollCallback callback, void* userData)Registers a callback for the scroll event.

Enum Description

ArkWeb_NativeAPIVariantKind

enum ArkWeb_NativeAPIVariantKind

Description

Enumerates the native API types.

Since: 12

Enumerated ValueDescription
ARKWEB_NATIVE_COMPONENTAPIs related to the Web component.
ARKWEB_NATIVE_CONTROLLERAPIs related to controller.
ARKWEB_NATIVE_WEB_MESSAGE_PORTAPIs related to webMessagePort.
ARKWEB_NATIVE_WEB_MESSAGEAPIs related to webMessage.
ARKWEB_NATIVE_COOKIE_MANAGERAPIs related to cookieManager.
ARKWEB_NATIVE_JAVASCRIPT_VALUEAPIs related to JavaScriptValue.
Since: 18

Function Description

OH_ArkWeb_GetNativeAPI()

ArkWeb_AnyNativeAPI* OH_ArkWeb_GetNativeAPI(ArkWeb_NativeAPIVariantKind type)

Description

Obtains the native API struct based on the transferred API type.

System capability: SystemCapability.Web.Webview.Core

Since: 12

Parameters

NameDescription
ArkWeb_NativeAPIVariantKind typeThe native API types supported by ArkWeb.

Returns

TypeDescription
ArkWeb_AnyNativeAPI*Native API struct pointer corresponding to the input API type. The first member of the struct is the size of the struct.

OH_ArkWeb_RegisterScrollCallback()

bool OH_ArkWeb_RegisterScrollCallback(const char* webTag, ArkWeb_OnScrollCallback callback, void* userData)

Description

Sets a callback for the scroll event.

System capability: SystemCapability.Web.Webview.Core

Since: 18

Parameters

NameDescription
const char* webTagName of the Web component.
ArkWeb_OnScrollCallback callbackCallback used when a page is scrolled.
void* userDataPointer to user-defined data.

Returns

TypeDescription
booltrue is returned if the operation is successful; otherwise, false is returned.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-webview-WebviewController

openharmony 鸿蒙 arkts-apis-webview-t

openharmony 鸿蒙 arkts-apis-webview

openharmony 鸿蒙 capi-arkweb-type-h

openharmony 鸿蒙 arkts-basic-components-web-FullScreenExitHandler

openharmony 鸿蒙 arkts-apis-webview-WebDownloadManager

openharmony 鸿蒙 arkts-basic-components-web-VerifyPinHandler

openharmony 鸿蒙 capi-web-arkweb-webmessage8h

openharmony 鸿蒙 arkts-apis-webview-NativeMediaPlayerHandler

openharmony 鸿蒙 capi-web-arkweb-proxymethodwithresult

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