diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 34e04ae3cb1d9c4fbc8e8397f525f7cdc1cc4795..45c527e3e3d650ccf40b13fc6de568353050148a 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2733,5 +2733,37 @@ { "first_introduced": "15", "name": "OH_ArkUI_NodeUtils_GetPositionToParent" + }, + { + "first_introduced": "17", + "name": "OH_ArkUI_UIInputEvent_GetEventTargetWidth" + }, + { + "first_introduced": "17", + "name": "OH_ArkUI_UIInputEvent_GetEventTargetHeight" + }, + { + "first_introduced": "17", + "name": "OH_ArkUI_UIInputEvent_GetEventTargetPositionX" + }, + { + "first_introduced": "17", + "name": "OH_ArkUI_UIInputEvent_GetEventTargetPositionY" + }, + { + "first_introduced": "17", + "name": "OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionX" + }, + { + "first_introduced": "17", + "name": "OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionY" + }, + { + "first_introduced": "17", + "name": "OH_ArkUI_HoverEvent_IsHovered" + }, + { + "first_introduced": "17", + "name": "OH_ArkUI_UIInputEvent_GetModifierKeyStates" } ] \ 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 fe0c8624094da074cc710119d31458cd4736f42b..fb3ec8e1bbc0d9b02a9c26e8670ff2eeaf470784 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -6161,6 +6161,17 @@ typedef enum { */ NODE_DISPATCH_KEY_EVENT = 24, + /** + * @brief Defines the event triggered when the mouse pointer hovers over or moves away from a component. + * + * This event is triggered when the mouse pointer enters or leaves the component's bounding box. \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_UIInputEvent}. \n + * + *@since 17 + */ + NODE_ON_HOVER_EVENT = 27, + /** * @brief Defines the hover event. * diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 608841059cc4ce41c74e48a6d44391b9142569b7..939a1bf6eee9b48dfb110bb233225c90c39a2e6c 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -1046,6 +1046,86 @@ int32_t OH_ArkUI_PointerEvent_SetClonedEventFingerIdByIndex( */ int32_t OH_ArkUI_PointerEvent_PostClonedEvent(ArkUI_NodeHandle node, const ArkUI_UIInputEvent* event); +/** +* @brief Obtains the width of the component hit by an event. +* +* @param event Pointer to an ArkUI_UIInputEvent object. +* @return Returns the width of the component hit by the event; returns 0.0f if any parameter error occurs. +* @since 17 +*/ +float OH_ArkUI_UIInputEvent_GetEventTargetWidth(const ArkUI_UIInputEvent* event); + +/** +* @brief Obtains the height of the component hit by an event. +* +* @param event Pointer to an ArkUI_UIInputEvent object. +* @return Returns the height of the component hit by the event; returns 0.0f if any parameter error occurs. +* @since 17 +*/ +float OH_ArkUI_UIInputEvent_GetEventTargetHeight(const ArkUI_UIInputEvent* event); + +/** +* @brief Obtains the X coordinate of the component hit by an event. +* +* @param event Pointer to an ArkUI_UIInputEvent object. +* @return Returns the X coordinate of the component hit by the event; returns 0.0f if any parameter error occurs. +* @since 17 +*/ +float OH_ArkUI_UIInputEvent_GetEventTargetPositionX(const ArkUI_UIInputEvent* event); + +/** +* @brief Obtains the Y coordinate of the component hit by an event. +* +* @param event Pointer to an ArkUI_UIInputEvent object. +* @return Returns the Y coordinate of the component hit by the event; +* returns 0.0f if any parameter error occurs. +* @since 17 +*/ +float OH_ArkUI_UIInputEvent_GetEventTargetPositionY(const ArkUI_UIInputEvent* event); + +/** +* @brief Obtains the global X coordinate of the component hit by an event. +* +* @param event Pointer to an ArkUI_UIInputEvent object. +* @return Returns the global X coordinate of the component hit by the event; +* returns 0.0f if any parameter error occurs. +* @since 17 +*/ +float OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionX(const ArkUI_UIInputEvent* event); + +/** +* @brief Obtains the global Y coordinate of the component hit by an event. +* +* @param event Pointer to an ArkUI_UIInputEvent object. +* @return Returns the global Y coordinate of the component hit by the event; +* returns 0.0f if any parameter error occurs. +* @since 17 +*/ +float OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionY(const ArkUI_UIInputEvent* event); + +/** +* @brief Checks whether the cursor is hovering over this component. +* +* @param event Pointer to an ArkUI_UIInputEvent object. +* @return Returns true if the cursor is hovering over the current component. +* Returns false if the cursor is not hovering over the current component. +* @since 17 +*/ +bool OH_ArkUI_HoverEvent_IsHovered(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the state of the modifier keys in a UI input event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param keys Pointer to a variable where the current combination of pressed modifier keys will be returned. + * The application can use bitwise operations to determine the state of each modifier key. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 17 + */ +int32_t OH_ArkUI_UIInputEvent_GetModifierKeyStates(const ArkUI_UIInputEvent* event, uint64_t* keys); + #ifdef __cplusplus }; #endif