From 92e0c9e291e18352960fe6dede86f232795cd590 Mon Sep 17 00:00:00 2001 From: houguobiao Date: Thu, 20 Feb 2025 21:31:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89=E7=84=A6=E7=82=B9?= =?UTF-8?q?=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houguobiao Change-Id: Ic7c8a9789fdb9dd29ba326159adf58a52436e891 --- arkui/ace_engine/native/native_dialog.h | 101 ++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 72d1e3ba0..5d2e193d5 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -377,6 +377,107 @@ typedef struct { int32_t (*setImmersiveMode)(ArkUI_NativeDialogHandle handle, ArkUI_ImmersiveMode immersiveMode); } ArkUI_NativeDialogAPI_2; +/** + * @brief Provides the custom dialog box APIs for the native side. + * + * @version 3 + * @since 16 + */ +typedef struct { + /** + * @brief Provides the custom dialog box APIs for the native side. The API scope is {@link ArkUI_NativeDialogAPI_1} + * + * @since 16 + */ + ArkUI_NativeDialogAPI_1 nativeDialogAPI1; + /** + * @brief Provides the custom dialog box APIs for the native side. The API scope is {@link ArkUI_NativeDialogAPI_2} + * + * @since 16 + */ + ArkUI_NativeDialogAPI_2 nativeDialogAPI2; + /** + * @brief Sets the display order for a custom dialog box. + * + * @note This method must be called before the show method. + * @param handle Indicates the pointer to the custom dialog box controller. + * @param levelOrder Indicates the display order. The valid range is [-100000.0, 100000.0]. + * @return Returns the error 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 16 + */ + int32_t (*setLevelOrder)(ArkUI_NativeDialogHandle handle, double levelOrder); + + /** + * @brief Registers a listener callback before the dialog openAnimation starts. + * + * @param handle Indicates the pointer to the custom dialog box controller. + * @param userData Indicates the pointer to the custom data. + * @param callback Indicates the callback before the dialog openAnimation starts. + * @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 16 + */ + int32_t (*registerOnWillAppear)( + ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData)); + + /** + * @brief Registers a listener callback when the dialog appears. + * + * @param handle Indicates the pointer to the custom dialog box controller. + * @param userData Indicates the pointer to the custom data. + * @param callback Indicates the callback when the dialog appears. + * @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 16 + */ + int32_t (*registerOnDidAppear)( + ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData)); + + /** + * @brief Registers a listener callback before the dialog closeAnimation starts. + * + * @param handle Indicates the pointer to the custom dialog box controller. + * @param userData Indicates the pointer to the custom data. + * @param callback Indicates the callback before the dialog closeAnimation starts. + * @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 16 + */ + int32_t (*registerOnWillDisappear)( + ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData)); + + /** + * @brief Registers a listener callback when the dialog disappears. + * + * @param handle Indicates the pointer to the custom dialog box controller. + * @param userData Indicates the pointer to the custom data. + * @param callback Indicates the callback when the dialog disappears. + * @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 16 + */ + int32_t (*registerOnDidDisappear)( + ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData)); + + /** + * @brief Sets whether to get focus when the custom dialog is displayed. + * + * @param handle Indicates the pointer to the custom dialog box controller. + * @param focusable Specifies whether to get focus when the custom dialog is displayed. The default value is true. + * @return Returns the error 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 16 + */ + int32_t (*setFocusable)(ArkUI_NativeDialogHandle handle, bool focusable); +} ArkUI_NativeDialogAPI_3; + /** * @brief Sets whether to block the system behavior of dismissing a dialog box. * -- Gitee