harmony 鸿蒙native_node.h
native_node.h
Overview
Provides type definitions for NativeNode APIs.
Library: libace_ndk.z.so
File to include:
System capability: SystemCapability.ArkUI.ArkUI.Full
Since: 12
Related module: ArkUI_NativeModule
Summary
Structs
Name | Description |
---|---|
struct ArkUI_AttributeItem | Defines a general input parameter struct for the setAttribute function. |
struct ArkUI_NodeComponentEvent | Defines a struct for the component callback event. |
struct ArkUI_StringAsyncEvent | Defines a struct for the component callback event that uses string parameters. |
struct ArkUI_NativeNodeAPI_1 | Defines a struct for node APIs of ArkUI on the native side. |
Macros
Name | Description |
---|---|
MAX_NODE_SCOPE_NUM | 1000 |
MAX_COMPONENT_EVENT_ARG_NUM | 12 |
Types
Name | Description |
---|---|
typedef struct ArkUI_NodeEvent ArkUI_NodeEvent | Defines a struct for the component event. |
typedef struct ArkUI_NodeCustomEvent ArkUI_NodeCustomEvent | Defines a struct for the custom component event. |
typedef struct ArkUI_NodeAdapter * ArkUI_NodeAdapterHandle | Defines a struct for the component adapter, which is used for lazy loading of elements of scrollable components. |
typedef struct ArkUI_NodeAdapterEvent ArkUI_NodeAdapterEvent | Defines a struct for the component adapter event. |
typedef struct ArkUI_NodeContentEvent ArkUI_NodeContentEvent | Defines a struct for the NodeContent event. |
typedef void(* ArkUI_NodeContentCallback) (ArkUI_NodeContentEvent *event) | Defines a callback for the NodeContent event. |
Enums
Functions
Name | Description |
---|---|
ArkUI_NodeEventType OH_ArkUI_NodeEvent_GetEventType (ArkUI_NodeEvent *event) | Obtains the type of a component event. |
int32_t OH_ArkUI_NodeEvent_GetTargetId (ArkUI_NodeEvent *event) | Obtains the custom ID of a component event. |
ArkUI_NodeHandle OH_ArkUI_NodeEvent_GetNodeHandle (ArkUI_NodeEvent *event) | Obtains the component object that triggers an event. |
ArkUI_UIInputEvent * OH_ArkUI_NodeEvent_GetInputEvent (ArkUI_NodeEvent *event) | Obtains input event (for example, touch event) data for a component event. |
ArkUI_NodeComponentEvent * OH_ArkUI_NodeEvent_GetNodeComponentEvent (ArkUI_NodeEvent *event) | Obtains the numerical data in a component event. |
ArkUI_StringAsyncEvent * OH_ArkUI_NodeEvent_GetStringAsyncEvent (ArkUI_NodeEvent *event) | Obtains the string data in a component event. |
void * OH_ArkUI_NodeEvent_GetUserData (ArkUI_NodeEvent *event) | Obtains the custom data in a component event. |
int32_t OH_ArkUI_NodeEvent_GetNumberValue (ArkUI_NodeEvent *event, int32_t index, ArkUI_NumberValue *value) | Obtains the numeric-type parameter of a component event. |
int32_t OH_ArkUI_NodeEvent_GetStringValue (ArkUI_NodeEvent *event, int32_t index, char **string, int32_t *stringSize) | Obtains the string-type parameter of a component event. The string data is valid only during an event callback. To use it outside an event callback, you are advised to copy the string data. |
int32_t OH_ArkUI_NodeEvent_SetReturnNumberValue (ArkUI_NodeEvent *event, ArkUI_NumberValue *value, int32_t size) | Sets the return value for a component event. |
ArkUI_NodeAdapterHandle OH_ArkUI_NodeAdapter_Create () | Creates a component adapter. |
void OH_ArkUI_NodeAdapter_Dispose (ArkUI_NodeAdapterHandle handle) | Disposes of a component adapter. |
int32_t OH_ArkUI_NodeAdapter_SetTotalNodeCount (ArkUI_NodeAdapterHandle handle, uint32_t size) | Sets the total number of elements in the specified adapter. |
uint32_t OH_ArkUI_NodeAdapter_GetTotalNodeCount (ArkUI_NodeAdapterHandle handle) | Obtains the total number of elements in the specified adapter. |
int32_t OH_ArkUI_NodeAdapter_RegisterEventReceiver (ArkUI_NodeAdapterHandle handle, void *userData, void(*receiver)(ArkUI_NodeAdapterEvent *event)) | Registers an event callback for the specified adapter. |
void OH_ArkUI_NodeAdapter_UnregisterEventReceiver (ArkUI_NodeAdapterHandle handle) | Unregisters an event callback for the specified adapter. |
int32_t OH_ArkUI_NodeAdapter_ReloadAllItems (ArkUI_NodeAdapterHandle handle) | Instructs the specified adapter to reload all elements. |
int32_t OH_ArkUI_NodeAdapter_ReloadItem (ArkUI_NodeAdapterHandle handle, uint32_t startPosition, uint32_t itemCount) | Instructs the specified adapter to reload certain elements. |
int32_t OH_ArkUI_NodeAdapter_RemoveItem (ArkUI_NodeAdapterHandle handle, uint32_t startPosition, uint32_t itemCount) | Instructs the specified adapter to remove certain elements. |
int32_t OH_ArkUI_NodeAdapter_InsertItem (ArkUI_NodeAdapterHandle handle, uint32_t startPosition, uint32_t itemCount) | Instructs the specified adapter to insert certain elements. |
int32_t OH_ArkUI_NodeAdapter_MoveItem (ArkUI_NodeAdapterHandle handle, uint32_t from, uint32_t to) | Instructs the specified adapter to move certain elements. |
int32_t OH_ArkUI_NodeAdapter_GetAllItems (ArkUI_NodeAdapterHandle handle, ArkUI_NodeHandle **items, uint32_t *size) | Obtains all elements stored in the specified adapter. |
void * OH_ArkUI_NodeAdapterEvent_GetUserData (ArkUI_NodeAdapterEvent *event) | Obtains the custom data passed in during registration of the specified event. |
ArkUI_NodeAdapterEventType OH_ArkUI_NodeAdapterEvent_GetType (ArkUI_NodeAdapterEvent *event) | Obtains the event type. |
ArkUI_NodeHandle OH_ArkUI_NodeAdapterEvent_GetRemovedNode (ArkUI_NodeAdapterEvent *event) | Obtains the element to be removed for the event to be destroyed. |
uint32_t OH_ArkUI_NodeAdapterEvent_GetItemIndex (ArkUI_NodeAdapterEvent *event) | Obtains the index of the element to be operated for the specified adapter event. |
ArkUI_NodeHandle OH_ArkUI_NodeAdapterEvent_GetHostNode (ArkUI_NodeAdapterEvent *event) | Obtains the scrollable container node that uses the specified adapter. |
int32_t OH_ArkUI_NodeAdapterEvent_SetItem (ArkUI_NodeAdapterEvent *event, ArkUI_NodeHandle node) | Sets the component to be added to the specified adapter. |
int32_t OH_ArkUI_NodeAdapterEvent_SetNodeId (ArkUI_NodeAdapterEvent *event, int32_t id) | Sets the component ID to be generated. |
ArkUI_LayoutConstraint * OH_ArkUI_NodeCustomEvent_GetLayoutConstraintInMeasure (ArkUI_NodeCustomEvent *event) | Obtains the size constraint for measurement through a custom component event. |
ArkUI_IntOffset OH_ArkUI_NodeCustomEvent_GetPositionInLayout (ArkUI_NodeCustomEvent *event) | Obtains the expected position of a component relative to its parent component in the layout phase through a custom component event. |
ArkUI_DrawContext * OH_ArkUI_NodeCustomEvent_GetDrawContextInDraw (ArkUI_NodeCustomEvent *event) | Obtains the drawing context through a custom component event. |
int32_t OH_ArkUI_NodeCustomEvent_GetEventTargetId (ArkUI_NodeCustomEvent *event) | Obtains the ID of a custom component event. |
void * OH_ArkUI_NodeCustomEvent_GetUserData (ArkUI_NodeCustomEvent *event) | Obtains custom event parameters through a custom component event. |
ArkUI_NodeHandle OH_ArkUI_NodeCustomEvent_GetNodeHandle (ArkUI_NodeCustomEvent *event) | Obtains a component object through a custom component event. |
ArkUI_NodeCustomEventType OH_ArkUI_NodeCustomEvent_GetEventType (ArkUI_NodeCustomEvent *event) | Obtains the event type through a custom component event. |
int32_t OH_ArkUI_NodeCustomEvent_GetCustomSpanMeasureInfo (ArkUI_NodeCustomEvent *event, ArkUI_CustomSpanMeasureInfo *info) | Obtains the measurement information of a custom span through a custom component event. |
int32_t OH_ArkUI_NodeCustomEvent_SetCustomSpanMetrics (ArkUI_NodeCustomEvent *event, ArkUI_CustomSpanMetrics *metrics) | Sets the measurement metrics of a custom span through a custom component event. |
int32_t OH_ArkUI_NodeCustomEvent_GetCustomSpanDrawInfo (ArkUI_NodeCustomEvent *event, ArkUI_CustomSpanDrawInfo *info) | Obtains the drawing information of a custom span through a custom component event. |
int32_t OH_ArkUI_NodeContent_RegisterCallback (ArkUI_NodeContentHandle content, ArkUI_NodeContentCallback callback) | Registers an event callback for the NodeContent. |
ArkUI_NodeContentEventType OH_ArkUI_NodeContentEvent_GetEventType (ArkUI_NodeContentEvent *event) | Obtains the type of the specified NodeContent event. |
ArkUI_NodeContentHandle OH_ArkUI_NodeContentEvent_GetNodeContentHandle (ArkUI_NodeContentEvent *event) | Obtains the object that triggers the specified NodeContent event. |
int32_t OH_ArkUI_NodeContent_SetUserData (ArkUI_NodeContentHandle content, void *userData) | Saves custom data to the specified NodeContent object. |
void * OH_ArkUI_NodeContent_GetUserData (ArkUI_NodeContentHandle content) | Obtains the custom data saved on the specified NodeContent object. |
int32_t OH_ArkUI_NodeContent_AddNode (ArkUI_NodeContentHandle content, ArkUI_NodeHandle node) | Adds an ArkUI component node to the specified NodeContent object. |
int32_t OH_ArkUI_NodeContent_RemoveNode (ArkUI_NodeContentHandle content, ArkUI_NodeHandle node) | Removes an ArkUI component node from the specified NodeContent object. |
int32_t OH_ArkUI_NodeContent_InsertNode (ArkUI_NodeContentHandle content, ArkUI_NodeHandle node, int32_t position) | Inserts an ArkUI component node into a specific position of the specified NodeContent object. |
int32_t OH_ArkUI_NodeUtils_GetLayoutSize (ArkUI_NodeHandle node, ArkUI_IntSize *size) | Obtains the layout area size of the component. The size does not count in transformation attributes, such as scale. |
int32_t OH_ArkUI_NodeUtils_GetLayoutPosition (ArkUI_NodeHandle node, ArkUI_IntOffset *localOffset) | Obtains the position of the component’s layout area relative to its parent component. The relative position does not count in transformation attributes, such as translate. |
int32_t OH_ArkUI_NodeUtils_GetLayoutPositionInWindow (ArkUI_NodeHandle node, ArkUI_IntOffset *globalOffset) | Obtains the position of the component’s layout area relative to the window. The relative position does not count in transformation attributes, such as translate. |
int32_t OH_ArkUI_NodeUtils_GetLayoutPositionInScreen (ArkUI_NodeHandle node, ArkUI_IntOffset *screenOffset) | Obtains the position of the component’s layout area relative to the screen. The relative position does not count in transformation attributes, such as translate. |
int32_t OH_ArkUI_NodeUtils_GetPositionWithTranslateInWindow (ArkUI_NodeHandle node, ArkUI_IntOffset *translateOffset) | Obtains the position of the component in the window, including the translate attribute. |
int32_t OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen (ArkUI_NodeHandle node, ArkUI_IntOffset *translateOffset) | Obtains the position of the component on the screen, including the translate attribute. |
void OH_ArkUI_NodeUtils_AddCustomProperty (ArkUI_NodeHandle node, const char *name, const char *value) | Sets a custom property for a component. This API takes effect only in the main thread. |
void OH_ArkUI_NodeUtils_RemoveCustomProperty (ArkUI_NodeHandle node, const char *name) | Removes a custom property that has been set for the specified component. |
int32_t OH_ArkUI_NodeUtils_GetCustomProperty (ArkUI_NodeHandle node, const char *name, ArkUI_CustomProperty **handle) | Obtains the value of a custom property of the specified component. |
ArkUI_NodeHandle OH_ArkUI_NodeUtils_GetParentInPageTree (ArkUI_NodeHandle node) | Obtains the parent node, which can be a component node created with ArkTS. |
int32_t OH_ArkUI_NodeUtils_GetActiveChildrenInfo (ArkUI_NodeHandle head, ArkUI_ActiveChildrenInfo **handle) | Obtains all active child nodes of the specified node. Spans are not counted as child nodes. |
ArkUI_NodeHandle OH_ArkUI_NodeUtils_GetCurrentPageRootNode (ArkUI_NodeHandle node) | Obtains the root node of the current page. |
bool OH_ArkUI_NodeUtils_IsCreatedByNDK (ArkUI_NodeHandle node) | Checks whether the specified component is created with the C API. |
int32_t OH_ArkUI_NodeUtils_GetNodeType (ArkUI_NodeHandle node) | Obtains the type of the specified node. |
int32_t OH_ArkUI_List_CloseAllSwipeActions (ArkUI_NodeHandle node, void *userData, void(*onFinish)(void *userData)) | Collapses the list items in the expanded state. |
ArkUI_ContextHandle OH_ArkUI_GetContextByNode (ArkUI_NodeHandle node) | Obtains the pointer to the UI context object of the specified node. |
int32_t OH_ArkUI_RegisterSystemColorModeChangeEvent (ArkUI_NodeHandle node, void *userData, void(*onColorModeChange)(ArkUI_SystemColorMode colorMode, void *userData)) | Registers an event listener for system color mode changes. A single component can only register one callback for system color mode changes. |
void OH_ArkUI_UnregisterSystemColorModeChangeEvent (ArkUI_NodeHandle node) | Unregisters the event listener for system color mode changes. |
int32_t OH_ArkUI_RegisterSystemFontStyleChangeEvent (ArkUI_NodeHandle node, void *userData, void(*onFontStyleChange)(ArkUI_SystemFontStyleEvent *event, void *userData)) | Registers an event listener for system font style changes. A single component can only register one callback for system font style changes. |
void OH_ArkUI_UnregisterSystemFontStyleChangeEvent (ArkUI_NodeHandle node) | Unregisters the event listener for system color mode changes. |
float OH_ArkUI_SystemFontStyleEvent_GetFontSizeScale (const ArkUI_SystemFontStyleEvent *event) | Obtains the font size from the system font style change event. |
float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale (const ArkUI_SystemFontStyleEvent *event) | Obtains the font weight from the system font style change event. |
int32_t OH_ArkUI_RegisterLayoutCallbackOnNodeHandle(ArkUI_NodeHandle node, void* userData, void (*onLayoutCompleted)(void* userData)) | Registers a layout completion callback function for a specific component. Only one layout completion callback can be registered per component. |
int32_t OH_ArkUI_RegisterDrawCallbackOnNodeHandle(ArkUI_NodeHandle node, void* userData, void (*onDrawCompleted)(void* userData)) | Registers a drawing completion callback function for a specific component. Only one drawing completion callback can be registered per component. |
int32_t OH_ArkUI_UnregisterLayoutCallbackOnNodeHandle(ArkUI_NodeHandle node) | Unregisters the layout completion callback function for a specific component. |
int32_t OH_ArkUI_UnregisterDrawCallbackOnNodeHandle(ArkUI_NodeHandle node) | Unregisters the drawing completion callback function for a specific component. |
ArkUI_TextChangeEvent OH_ArkUI_NodeEvent_GetTextChangeEvent(ArkUI_NodeEvent *event) | Obtains the data related to a text change (including preview text content change) event in the text box. |
int32_t OH_ArkUI_GetNodeSnapshot(ArkUI_NodeEvent *event) | Obtains a snapshot of the specified node. |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent
harmony 鸿蒙ARKUI_TextPickerRangeContent
harmony 鸿蒙ArkUI_AnimateCompleteCallback
harmony 鸿蒙ArkUI_ContextCallback
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦