2
Ark_NodeHandle createTextNode(Ark_Int32 nodeId);
3
Ark_NodeHandle createSpanNode(Ark_Int32 nodeId);
4
Ark_NodeHandle createImageSpanNode(Ark_Int32 nodeId);
5
Ark_NodeHandle createImageNode(Ark_Int32 nodeId);
6
Ark_NodeHandle createToggleNode(Ark_Int32 nodeId);
7
Ark_NodeHandle createLoadingProgress(Ark_Int32 nodeId);
8
Ark_NodeHandle createTextInputNode(Ark_Int32 nodeId);
9
Ark_NodeHandle createStackNode(Ark_Int32 nodeId);
10
Ark_NodeHandle createScrollNode(Ark_Int32 nodeId);
11
Ark_NodeHandle createListNode(Ark_Int32 nodeId);
12
Ark_NodeHandle createSwiperNode(Ark_Int32 nodeId);
13
Ark_NodeHandle createTextAreaNode(Ark_Int32 nodeId);
14
Ark_NodeHandle createButtonNode(Ark_Int32 nodeId);
15
Ark_NodeHandle createProgressNode(Ark_Int32 nodeId);
16
Ark_NodeHandle createCheckBoxNode(Ark_Int32 nodeId);
17
Ark_NodeHandle createColumnNode(Ark_Int32 nodeId);
18
Ark_NodeHandle createRowNode(Ark_Int32 nodeId);
19
Ark_NodeHandle createFlexNode(Ark_Int32 nodeId);
20
Ark_NodeHandle createListItemNode(Ark_Int32 nodeId);
21
Ark_NodeHandle createRefreshNode(Ark_Int32 nodeId);
22
Ark_NodeHandle createRootNode(Ark_Int32 nodeId);
23
Ark_NodeHandle createComponentRootNode(Ark_Int32 nodeId);
24
#ifdef XCOMPONENT_SUPPORTED
25
Ark_NodeHandle createXComponentNode(Ark_Int32 nodeId);
27
Ark_NodeHandle createListItemGroupNode(Ark_Int32 nodeId);
28
Ark_NodeHandle createSliderNode(Ark_Int32 nodeId);
29
Ark_NodeHandle createCanvasNode(Ark_Int32 nodeId);
30
Ark_NodeHandle createDatePickerNode(Ark_Int32 nodeId);
31
Ark_NodeHandle createTimePickerNode(Ark_Int32 nodeId);
32
Ark_NodeHandle createTextPickerNode(Ark_Int32 nodeId);
33
Ark_NodeHandle createCalendarPickerNode(Ark_Int32 nodeId);
34
Ark_NodeHandle createCustomNode(Ark_Int32 nodeId);
35
Ark_NodeHandle createNavigationNode(Ark_Int32 nodeId);
36
Ark_NodeHandle createWaterFlowNode(Ark_Int32 nodeId);
37
Ark_NodeHandle createFlowItemNode(Ark_Int32 nodeId);
38
Ark_NodeHandle createCircleNode(Ark_Int32 nodeId);
39
Ark_NodeHandle createRelativeContainerNode(Ark_Int32 nodeId);
40
Ark_NodeHandle createGridNode(Ark_Int32 nodeId);
41
Ark_NodeHandle createTabsNode(Ark_Int32 nodeId);
42
Ark_NodeHandle createGridItemNode(Ark_Int32 nodeId);
43
Ark_NodeHandle createBlankNode(Ark_Int32 nodeId);
44
Ark_NodeHandle createDividerNode(Ark_Int32 nodeId);
45
Ark_NodeHandle createAlphabetIndexerNode(Ark_Int32 nodeId);
46
Ark_NodeHandle createSearchNode(Ark_Int32 nodeId);
47
Ark_NodeHandle createGridRowNode(Ark_Int32 nodeId);
48
Ark_NodeHandle createGridColNode(Ark_Int32 nodeId);
49
Ark_NodeHandle createRadioNode(Ark_Int32 nodeId);
50
Ark_NodeHandle createTabContentNode(Ark_Int32 nodeId);
52
void SetCallbackMethod(ArkUIAPICallbackMethod* method);
53
} // namespace ViewModel
55
using FrameNodeCreator = Ark_NodeHandle(Ark_Int32 nodeId);
58
Ark_NodeHandle CreateNode(%CPP_PREFIX%Ark_NodeType type, Ark_Int32 id, Ark_Int32 flags) {
59
if (id == %CPP_PREFIX%ARKUI_AUTO_GENERATE_NODE_ID) {
60
id = ElementRegister::GetInstance()->MakeUniqueId();
64
case %CPP_PREFIX%ARKUI_TEXT: return ViewModel::createTextNode(id);
65
case %CPP_PREFIX%ARKUI_SPAN: return ViewModel::createSpanNode(id);
66
case %CPP_PREFIX%ARKUI_IMAGE_SPAN: return ViewModel::createImageSpanNode(id);
67
case %CPP_PREFIX%ARKUI_IMAGE: return ViewModel::createImageNode(id);
68
case %CPP_PREFIX%ARKUI_TOGGLE: return ViewModel::createToggleNode(id);
69
case %CPP_PREFIX%ARKUI_LOADING_PROGRESS: return ViewModel::createLoadingProgress(id);
70
case %CPP_PREFIX%ARKUI_TEXT_INPUT: return ViewModel::createTextInputNode(id);
71
case %CPP_PREFIX%ARKUI_STACK: return ViewModel::createStackNode(id);
72
case %CPP_PREFIX%ARKUI_SCROLL: return ViewModel::createScrollNode(id);
73
case %CPP_PREFIX%ARKUI_LIST: return ViewModel::createListNode(id);
74
case %CPP_PREFIX%ARKUI_SWIPER: return ViewModel::createSwiperNode(id);
75
case %CPP_PREFIX%ARKUI_TEXTAREA: return ViewModel::createTextAreaNode(id);
76
case %CPP_PREFIX%ARKUI_BUTTON: return ViewModel::createButtonNode(id);
77
case %CPP_PREFIX%ARKUI_PROGRESS: return ViewModel::createProgressNode(id);
78
case %CPP_PREFIX%ARKUI_CHECKBOX: return ViewModel::createCheckBoxNode(id);
79
case %CPP_PREFIX%ARKUI_COLUMN: return ViewModel::createColumnNode(id);
80
case %CPP_PREFIX%ARKUI_ROW: return ViewModel::createRowNode(id);
81
case %CPP_PREFIX%ARKUI_FLEX: return ViewModel::createFlexNode(id);
82
case %CPP_PREFIX%ARKUI_LIST_ITEM: return ViewModel::createListItemNode(id);
83
case %CPP_PREFIX%ARKUI_REFRESH: return ViewModel::createRefreshNode(id);
84
case %CPP_PREFIX%ARKUI_ROOT: return ViewModel::createRootNode(id);
85
case %CPP_PREFIX%ARKUI_COMPONENT_ROOT: return ViewModel::createComponentRootNode(id);
86
#ifdef XCOMPONENT_SUPPORTED
87
case %CPP_PREFIX%ARKUI_XCOMPONENT: return ViewModel::createXComponentNode(id);
89
case %CPP_PREFIX%ARKUI_LIST_ITEM_GROUP: return ViewModel::createListItemGroupNode(id);
90
case %CPP_PREFIX%ARKUI_SLIDER: return ViewModel::createSliderNode(id);
91
case %CPP_PREFIX%ARKUI_CANVAS: return ViewModel::createCanvasNode(id);
92
case %CPP_PREFIX%ARKUI_DATE_PICKER: return ViewModel::createDatePickerNode(id);
93
case %CPP_PREFIX%ARKUI_TIME_PICKER: return ViewModel::createTimePickerNode(id);
94
case %CPP_PREFIX%ARKUI_TEXT_PICKER: return ViewModel::createTextPickerNode(id);
95
case %CPP_PREFIX%ARKUI_CALENDAR_PICKER: return ViewModel::createCalendarPickerNode(id);
96
case %CPP_PREFIX%ARKUI_CUSTOM: return ViewModel::createCustomNode(id);
97
case %CPP_PREFIX%ARKUI_NAVIGATION: return ViewModel::createNavigationNode(id);
98
case %CPP_PREFIX%ARKUI_WATER_FLOW: return ViewModel::createWaterFlowNode(id);
99
case %CPP_PREFIX%ARKUI_FLOW_ITEM: return ViewModel::createFlowItemNode(id);
100
case %CPP_PREFIX%ARKUI_CIRCLE: return ViewModel::createCircleNode(id);
101
case %CPP_PREFIX%ARKUI_RELATIVE_CONTAINER: return ViewModel::createRelativeContainerNode(id);
102
case %CPP_PREFIX%ARKUI_GRID: return ViewModel::createGridNode(id);
103
case %CPP_PREFIX%ARKUI_TABS: return ViewModel::createTabsNode(id);
104
case %CPP_PREFIX%ARKUI_GRID_ITEM: return ViewModel::createGridItemNode(id);
105
case %CPP_PREFIX%ARKUI_BLANK: return ViewModel::createBlankNode(id);
106
case %CPP_PREFIX%ARKUI_DIVIDER: return ViewModel::createDividerNode(id);
107
case %CPP_PREFIX%ARKUI_ALPHABET_INDEXER: return ViewModel::createAlphabetIndexerNode(id);
108
case %CPP_PREFIX%ARKUI_SEARCH: return ViewModel::createSearchNode(id);
109
case %CPP_PREFIX%ARKUI_GRID_ROW: return ViewModel::createGridRowNode(id);
110
case %CPP_PREFIX%ARKUI_GRID_COL: return ViewModel::createGridColNode(id);
111
case %CPP_PREFIX%ARKUI_RADIO: return ViewModel::createRadioNode(id);
112
case %CPP_PREFIX%ARKUI_TABCONTENT: return ViewModel::createTabContentNode(id);
113
default: return nullptr;
117
void SetCallbackMethod(%CPP_PREFIX%Ark_APICallbackMethod* method)
119
ViewModel::SetCallbackMethod(reinterpret_cast<ArkUIAPICallbackMethod*>(method));