From d4293a30e8af37cdd4ec33155133e3a2f129481a Mon Sep 17 00:00:00 2001 From: liukaii Date: Fri, 18 Apr 2025 13:18:19 +0800 Subject: [PATCH] ban Signed-off-by: liukaii Change-Id: I8e77c2e1fc8098979ebc033b31d6a56c86ac071a --- arkui/ace_engine/native/drag_and_drop.h | 25 +++++++++++++++++++++++++ arkui/ace_engine/native/libace.ndk.json | 4 ++++ 2 files changed, 29 insertions(+) diff --git a/arkui/ace_engine/native/drag_and_drop.h b/arkui/ace_engine/native/drag_and_drop.h index 9e9d3db43..350071550 100644 --- a/arkui/ace_engine/native/drag_and_drop.h +++ b/arkui/ace_engine/native/drag_and_drop.h @@ -927,6 +927,31 @@ ArkUI_ErrorCode OH_ArkUI_DragEvent_GetDragSource(ArkUI_DragEvent* event, char *b */ ArkUI_ErrorCode OH_ArkUI_DragEvent_IsRemote(ArkUI_DragEvent* event, bool* isRemote); +/** + * @brief Sets whether to enable the display of a disallow status icon. + * + * Typically, when a component can receive or process data dragged by the user, or when it declares to the + * system that data should be processed in COPY way by setting ARKUI_DROP_OPERATION_COPY through + * {@link OH_ArkUI_DragEvent_SetSuggestedDropOperation}, the system will display + * a plus sign together with the data number on the upper-left corner of the dragged object; if setting + * ARKUI_DROP_OPERATION_MOVE to the system to declare that data should be processed in CUT way, the system will only + * display the data number on the upper-left corner of the dragged object. + * + * In some cases, when the system determines or the component explicitly declares that it cannot handle the + * data that the user is dragging, the system displays a badge icon in the same way as it does for DragBehavior.MOVE. + * So if you want to show the more clearly status, you can call this method on the UI instance in advance to force + * the system to display a clear prohibition icon on the upper left corner in such cases, and the user can clearly + * know that data cannot be dropped here. + * + * @param uiContext Pointer to a UI instance. + * @param enabled Whether to enable the display of the disallow badge icon. + * @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 20 + */ +ArkUI_ErrorCode OH_ArkUI_EnableDropDisallowedBadge(ArkUI_ContextHandle uiContext, bool enabled); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 77e3c83b7..4cd949efe 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3031,6 +3031,10 @@ "first_introduced": "19", "name": "OH_ArkUI_NotifyDragEndPendingDone" }, + { + "first_introduced": "20", + "name": "OH_ArkUI_EnableDropDisallowedBadge" + }, { "first_introduced": "18", "name": "OH_ArkUI_GestureInterrupter_GetUserData" -- Gitee