• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ArkWeb_ComponentAPI
2
3## Overview
4
5Defines a native component API.
6
7**Since**: 12
8
9**Related module**: [Web](capi-web.md)
10
11**Header file**: [arkweb_type.h](capi-arkweb-type-h.md)
12
13## Summary
14
15### Member Variables
16
17| Name| Description|
18| -- | -- |
19| size_t size | Size of the struct.|
20
21
22### Member Functions
23
24| Name                                                        | Description                                                        |
25| ------------------------------------------------------------ | ------------------------------------------------------------ |
26| [void (\*onControllerAttached)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)](#oncontrollerattached) | Triggered when a controller is attached to the **Web** component.                 |
27| [void (\*onPageBegin)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)](#onpagebegin) | 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.|
28| [void (\*onPageEnd)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)](#onpageend) | Triggered when the web page loading is complete. This callback is triggered only for the main frame content.               |
29| [void (\*onDestroy)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)](#ondestroy) | Triggered when this **Web** component is destroyed.                               |
30
31## Member Function Description
32
33### onControllerAttached()
34
35```
36void (*onControllerAttached)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)
37```
38
39**Description**
40
41Triggered when a controller is attached to the **Web** component.
42
43**Parameters**
44
45| Name| Description|
46| -- | -- |
47| const char* webTag | Name of the **Web** component.|
48| ArkWeb_OnComponentCallback callback | Callback of **onControllerAttached**.|
49|  void* userData | User-defined data.|
50
51### onPageBegin()
52
53```
54void (*onPageBegin)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)
55```
56
57**Description**
58
59Triggered 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.
60
61**Parameters**
62
63| Name| Description|
64| -- | -- |
65| const char* webTag | Name of the **Web** component.|
66| ArkWeb_OnComponentCallback callback | Callback of **onPageBegin**.|
67|  void* userData | User-defined data.|
68
69### onPageEnd()
70
71```
72void (*onPageEnd)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)
73```
74
75**Description**
76
77Triggered when the web page loading is complete. This callback is triggered only for the main frame content.
78
79**Parameters**
80
81| Name| Description|
82| -- | -- |
83| const char* webTag | Name of the **Web** component.|
84| ArkWeb_OnComponentCallback callback | Callback of **onPageEnd**.|
85|  void* userData | User-defined data.|
86
87### onDestroy()
88
89```
90void (*onDestroy)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData)
91```
92
93**Description**
94
95Triggered when this **Web** component is destroyed.
96
97**Parameters**
98
99| Name| Description|
100| -- | -- |
101| const char* webTag | Name of the **Web** component.|
102| ArkWeb_OnComponentCallback callback | Callback of **onDestroy**.|
103|  void* userData | User-defined data.|
104