diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3c739a283d083bc3ec54e71cbce89094a70bce10..a67b8e83ddf43470b8b40693a2c9922f6aae4410 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -4062,5 +4062,13 @@ { "first_introduced": "20", "name": "OH_ArkUI_PostUITaskAndWait" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_NativeModule_RegisterCommonEvent" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_NativeModule_UnregisterCommonEvent" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 53cfc3bf409b8b335ca8db05bc4e9ae1bbac66a9..a479a2d1a489b3d408633daf5fae80a52f2ededd 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7204,6 +7204,16 @@ typedef enum { */ NODE_ON_HOVER_MOVE = 29, + /** + * @brief Defines the size change event. + * + * The event will be triggered when the component size changes. + * When the event callback occurs, the {@link ArkUI_NodeEvent} object can be obtained from the + * {@link ArkUI_UIInputEvent} object. \n + * @since 20 + */ + NODE_ON_SIZE_CHANGE = 30, + /** * @brief Triggers onDetectResultUpdate callback * when the text is set to TextDataDetectorConfig and recognized successfully. @@ -10027,6 +10037,36 @@ int32_t OH_ArkUI_PostUITask(ArkUI_ContextHandle context, void* taskData, void (* * @since 20 */ int32_t OH_ArkUI_PostUITaskAndWait(ArkUI_ContextHandle context, void* taskData, void (*task)(void* taskData)); + +/** + * @brief Register common event callback of target node. + * + * @param node The ArkUI-NodeHandle pointer. + * @param eventType Indicates the type of event to set. + * @param userData Indicates the pointer to the custom data. + * @param callback Indicates the event callback function. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function params is invalid. + * Returns {@link ARKUI_ERROR_CODE_NODE_UNSUPPORT_EVENT_TYPE} Function parameter eventType is not supported. + * @since 20 + */ +int32_t OH_ArkUI_NativeModule_RegisterCommonEvent(ArkUI_NodeHandle node, ArkUI_NodeEventType eventType, + void* userData, void (*callback)(ArkUI_NodeEvent* event, void* userData)); + +/** + * @brief Unregister common event callback of target node. + * + * @param node The ArkUI-NodeHandle pointer. + * @param eventType Indicates the type of event to set. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function params is invalid. + * Returns {@link ARKUI_ERROR_CODE_NODE_UNSUPPORT_EVENT_TYPE} Function parameter eventType is not supported. + * @since 20 + */ +int32_t OH_ArkUI_NativeModule_UnregisterCommonEvent(ArkUI_NodeHandle node, ArkUI_NodeEventType eventType); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 3bfa0c36dc25d8298fcc4a207a499250e009a8f4..01e6650f41af2ef37621c9b8bac941b8e54b8fbd 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2255,6 +2255,11 @@ typedef enum { ARKUI_ERROR_CODE_NODE_EVENT_PARAM_INVALID = 106108, /** The component event does not support return values. */ ARKUI_ERROR_CODE_NODE_EVENT_NO_RETURN = 106109, + /** + * @error The node is not support event type. + * @since 20 + */ + ARKUI_ERROR_CODE_NODE_UNSUPPORT_EVENT_TYPE = 106110, /** The index value is invalid. */ ARKUI_ERROR_CODE_NODE_INDEX_INVALID = 106200, /** Failed to query route navigation information. */