From 1b44893f33908c986acb59afcfcf481a183391b8 Mon Sep 17 00:00:00 2001 From: yangbiao199318 Date: Sat, 22 Feb 2025 18:41:56 +0800 Subject: [PATCH] =?UTF-8?q?Dialog=E7=94=9F=E5=91=BD=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=E8=A1=A5=E9=BD=90CAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangbiao199318 --- arkui/ace_engine/native/native_dialog.h | 89 +++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 72d1e3ba0..f609945e5 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -377,6 +377,95 @@ 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)); +} ArkUI_NativeDialogAPI_3; + /** * @brief Sets whether to block the system behavior of dismissing a dialog box. * -- Gitee