!4719 merge GestureCollectInterceptC into master

GestureCollectInterceptC

Created-by: yuanlin94
Commit-by: yuanlin94
Merged-by: openharmony_ci
Description: ### 相关的Issue

https://gitcode.com/openharmony/interface_sdk_c/issues/3631
### 原因(目的、解决的问题等)


### 描述(做了什么,变更了什么)


### 自检结果(结果截图添加到下面)
- [x] 是否通过C语法扫描
- [x] 是否通过注释规则扫描
- [x] 是否更新json文件
- [x] 实现代码是否已经合入
- [x] 目标是否已经添加到interface/sdk_c仓ndk依赖目标(ndk_targets.gni)里
- [x] 头文件library声明与SDK so库名称一致

### 兼容性影响评估,如有影响请写明(Y/N)
- [N] 不兼容
  - [ ] 是否经过评审

### L0新增用例自检结果
- [ ] 是,有新增L0用例,且完成自检
- [x] 否

### API参考文档影响评估(提供docs仓pr链接)
- [x] 是,已刷新API参考文档
- [ ] 否,不涉及刷新API参考文档
https://gitcode.com/openharmony/docs/pull/137111

See merge request: openharmony/interface_sdk_c!4719
This commit is contained in:
openharmony_ci
2026-04-03 16:43:19 +08:00
4 changed files with 174 additions and 0 deletions
+28
View File
@@ -6518,6 +6518,34 @@
"first_introduced": "24",
"name": "OH_ArkUI_TextLayoutManager_GetCharacterRangeForGlyphRange"
},
{
"first_introduced": "26.0.0",
"name": "OH_ArkUI_NodeEvent_GetGestureCollectInterceptInfo"
},
{
"first_introduced": "26.0.0",
"name": "OH_ArkUI_GestureCollectInterceptInfo_GetResponseRecognizers"
},
{
"first_introduced": "26.0.0",
"name": "OH_ArkUI_GestureCollectInterceptInfo_GetTouchRecognizers"
},
{
"first_introduced": "26.0.0",
"name": "OH_ArkUI_GestureCollectInterceptInfo_SetGestureCollectIntervention"
},
{
"first_introduced": "26.0.0",
"name": "OH_ArkUI_TouchRecognizer_IsHostBelongsTo"
},
{
"first_introduced": "26.0.0",
"name": "OH_ArkUI_GestureRecognizer_IsHostBelongsTo"
},
{
"first_introduced": "26.0.0",
"name": "OH_ArkUI_GetGestureBindNodeUniqueId"
},
{
"first_introduced": "24",
"name": "OH_ArkUI_FontWeightConfigs_Create"
+116
View File
@@ -225,6 +225,51 @@ typedef enum {
DRAG_DROP,
} ArkUI_GestureRecognizerType;
/**
* @brief Defines the intervention types for gesture and event collection.
*
* @since 26.0.0
*/
typedef enum {
/**
* @brief Continues the normal gesture and event collection process. No intervention is performed.
* @since 26.0.0
*/
OH_ARKUI_GESTURE_COLLECT_INTERVENTION_CONTINUE = 0,
/**
* @brief Discards all pending low-priority gestures and events. \n
* The gestures of the left sibling component and ancestor nodes (parent nodes and above) are discarded. \n
* Only the gestures already collected on the current node and higher-priority nodes are retained.
* @since 26.0.0
*/
OH_ARKUI_GESTURE_COLLECT_INTERVENTION_DISCARD_LOWER = 1,
/**
* @brief Discards all collected high-priority gestures and events. \n
* The gestures of the right sibling component and the current node are discarded. \n
* Continues processing the collection flow for lower-priority gestures (left sibling and ancestor nodes).
* @since 26.0.0
*/
OH_ARKUI_GESTURE_COLLECT_INTERVENTION_DISCARD_HIGHER = 2,
/**
* @brief Discards the gestures and events of the current node. \n
* The gestures and events of the current node are excluded from the gesture tree. \n
* The gestures of the sibling components (left and right) and the ancestor node are still collected.
* @since 26.0.0
*/
OH_ARKUI_GESTURE_COLLECT_INTERVENTION_DISCARD_SELF = 3,
/**
* @brief Discards the gestures and events to be collected from the left sibling component. \n
* The gestures and events of the current node and the right sibling component are retained. \n
* Continues the collection flow for the parent and ancestor nodes.
* @since 26.0.0
*/
OH_ARKUI_GESTURE_COLLECT_INTERVENTION_DISCARD_LOWER_PRIORITY_SIBLINGS = 4,
} OH_ArkUI_GestureCollectIntervention;
/**
* @brief Enumerates gesture interruption results.
*
@@ -1251,6 +1296,77 @@ void* OH_ArkUI_GestureInterrupter_GetUserData(ArkUI_GestureInterruptInfo* event)
*/
ArkUI_ErrorCode OH_ArkUI_PreventGestureRecognizerBegin(ArkUI_GestureRecognizer* recognizer);
/**
* @brief Obtains the gesture recognizer from the gesture collection interception information.
*
* @param info Pointer to the gesture collection interception information.
* @param array Pointer to the gesture recognizer array.
* @param size Size of the gesture recognizer array.
* @return 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 26.0.0
*/
ArkUI_ErrorCode OH_ArkUI_GestureCollectInterceptInfo_GetResponseRecognizers(
const ArkUI_GestureCollectInterceptInfo* info, ArkUI_GestureRecognizerHandleArray* array, int32_t* size);
/**
* @brief Obtains the handle to touch recognizer from the gesture collection interception information.
*
* @param info Pointer to the gesture collection interception information.
* @param recognizers Pointer to the array of handles to touch recognizers.
* @param size Size of the recognizers array.
* @return 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 26.0.0
*/
ArkUI_ErrorCode OH_ArkUI_GestureCollectInterceptInfo_GetTouchRecognizers(const ArkUI_GestureCollectInterceptInfo* info,
ArkUI_TouchRecognizerHandleArray* recognizers, int32_t* size);
/**
* @brief Sets the gesture collection intervention mode.
* @param info Pointer to the gesture collection interception information.
* @param intervention Gesture collection intervention mode, which is of
* type {@link OH_ArkUI_GestureCollectIntervention}.
* @return 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 26.0.0
*/
ArkUI_ErrorCode OH_ArkUI_GestureCollectInterceptInfo_SetGestureCollectIntervention(
ArkUI_GestureCollectInterceptInfo* info, OH_ArkUI_GestureCollectIntervention intervention);
/**
* @brief Obtains the unique ID of the component linked to a gesture recognizer.
*
* @param recognizer Pointer to the gesture recognizer.
* @param uniqueId Unique ID of the component linked to a gesture recognizer.
* @return 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 26.0.0
*/
ArkUI_ErrorCode OH_ArkUI_GetGestureBindNodeUniqueId(const ArkUI_GestureRecognizer* recognizer, int32_t* uniqueId);
/**
* @brief Checks whether the node linked to the gesture is a child node of the passed component.
*
* @param recognizer Handle to the touch recognizer.
* @param uniqueId Unique ID of the component.
* @return Returns <b>true</b> if the node linked to the gesture is a child node of the passed component.
* Returns <b>false</b> otherwise.
* @since 26.0.0
*/
bool OH_ArkUI_TouchRecognizer_IsHostBelongsTo(const ArkUI_TouchRecognizerHandle recognizer, int32_t uniqueId);
/**
* @brief Checks whether the node linked to the gesture is a child node of the passed component.
*
* @param recognizer Pointer to the gesture recognizer.
* @param uniqueId Unique ID of the component.
* @return Returns <b>true</b> if the node linked to the gesture is a child node of the passed component.
* Returns <b>false</b> otherwise.
* @since 26.0.0
*/
bool OH_ArkUI_GestureRecognizer_IsHostBelongsTo(const ArkUI_GestureRecognizer* recognizer, int32_t uniqueId);
#ifdef __cplusplus
};
#endif
+23
View File
@@ -9484,6 +9484,17 @@ typedef enum {
*/
NODE_ON_NEED_SOFTKEYBOARD = 36,
/**
* @brief This callback is invoked when the events and gestures on this node and
* higher-priority nodes are collected. \n
* This callback is used to intervene in the collection result of events and gestures. \n
*
* When the event callback occurs, the {@link ArkUI_GestureCollectInterceptInfo} object can be obtained from the
* {@link ArkUI_NodeEvent} object. \n
* @since 26.0.0
*/
NODE_ON_GESTURE_COLLECT_INTERCEPT = 37,
/**
* @brief Triggers onDetectResultUpdate callback
* when the text is set to TextDataDetectorConfig and recognized successfully.
@@ -13245,6 +13256,18 @@ int32_t OH_ArkUI_Swiper_ShowNext(ArkUI_NodeHandle node);
int32_t OH_ArkUI_NativeModule_GetPageRootNodeHandleByContext(
ArkUI_ContextHandle context, ArkUI_NodeHandle* rootNode);
/**
* @brief Obtains the <b>ArkUI_GestureCollectInterceptInfo</b> object from a specified <b>ArkUI_NodeEvent</b> object.
*
* @param nodeEvent Pointer to the <b>ArkUI_NodeEvent</b> object.
* @return Returns the pointer to the <b>ArkUI_GestureCollectInterceptInfo</b> object.
* It is valid only during callback and does not need to be released.
* Returns <b>null</b> if the input parameter is invalid or the
* information is not gesture collection interception information.
* @since 26.0.0
*/
ArkUI_GestureCollectInterceptInfo* OH_ArkUI_NodeEvent_GetGestureCollectInterceptInfo(ArkUI_NodeEvent* nodeEvent);
#ifdef __cplusplus
};
#endif
+7
View File
@@ -94,6 +94,13 @@ typedef struct ArkUI_Node* ArkUI_NodeHandle;
*/
typedef struct ArkUI_NativeDialog* ArkUI_NativeDialogHandle;
/**
* @brief Defines information about gesture collection interception.
*
* @since 26.0.0
*/
typedef struct ArkUI_GestureCollectInterceptInfo ArkUI_GestureCollectInterceptInfo;
/**
* @brief Defines the return value structure for the <b>onGetIrregularSizeByIndex</b> callback
* in <b>Grid</b> layout options.