fc4e8ca9创建于 2025年12月17日历史提交

ArkWeb_ComponentAPI

typedef struct {...} ArkWeb_ComponentAPI

Overview

Defines a native component API.

Since: 12

Related module: Web

Header file: arkweb_type.h

Summary

Member Variables

Name Description
size_t size Size of the struct.

Member Functions

Name Description
void (*onControllerAttached)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData) Triggered when a controller is attached to the Web component.
void (*onPageBegin)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData) Triggered when the web page starts to be loaded. This callback is called only for the main frame content, and not for the iframe or frameset content.
void (*onPageEnd)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData) Triggered when the web page loading is finished. This callback is called only for the main frame content, and not for the iframe or frameset content.
void (*onDestroy)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData) Triggered when this Web component is destroyed.

Member Function Description

onControllerAttached()

void (*onControllerAttached)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)

Description

Triggered when a controller is attached to the Web component.

Parameters

Name Description
const char* webTag Name of the Web component.
ArkWeb_OnComponentCallback callback Callback of onControllerAttached.
void* userData User-defined data.

onPageBegin()

void (*onPageBegin)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)

Description

Triggered when the web page starts to be loaded. This callback is called only for the main frame content, and not for the iframe or frameset content.

Parameters

Name Description
const char* webTag Name of the Web component.
ArkWeb_OnComponentCallback callback Callback of onPageBegin.
void* userData User-defined data.

onPageEnd()

void (*onPageEnd)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)

Description

Triggered when the web page loading is finished. This callback is called only for the main frame content, and not for the iframe or frameset content.

Parameters

Name Description
const char* webTag Name of the Web component.
ArkWeb_OnComponentCallback callback Callback of onPageEnd.
void* userData User-defined data.

onDestroy()

void (*onDestroy)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)

Description

Triggered when this Web component is destroyed.

Parameters

Name Description
const char* webTag Name of the Web component.
ArkWeb_OnComponentCallback callback Callback of onDestroy.
void* userData User-defined data.