From 1c5f69045c65c0442c66b9fdc32a761572fbcb92 Mon Sep 17 00:00:00 2001 From: yangbiao199318 Date: Sun, 18 May 2025 15:46:28 +0800 Subject: [PATCH] =?UTF-8?q?dialog=E7=8A=B6=E6=80=81=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangbiao199318 --- arkui/ace_engine/native/libace.ndk.json | 4 ++ arkui/ace_engine/native/native_dialog.h | 58 +++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index bbb084234..b6860d666 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3203,6 +3203,10 @@ "first_introduced": "19", "name": "OH_ArkUI_CustomDialog_RegisterOnDidDisappearCallback" }, + { + "first_introduced": "20", + "name": "OH_ArkUI_CustomDialog_GetState" + }, { "first_introduced": "19", "name": "OH_ArkUI_TextPickerRangeContentArray_Create" diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index f6ffbeb68..5bdde7f9d 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -61,6 +61,52 @@ typedef enum { DIALOG_DISMISS_SLIDE_DOWN, } ArkUI_DismissReason; +/** +* @brief Enumerates the state of dialog. +* +* @syscap SystemCapability.ArkUI.ArkUI.Full +* +* @since 20 +*/ +typedef enum { + /** + * @brief Uninitialized. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DIALOG_UNINITIALIZED = 0, + /** + * @brief Initialized. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DIALOG_INITIALIZED, + /** + * @brief Appearing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DIALOG_APPEARING, + /** + * @brief Appeared. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DIALOG_APPEARED, + /** + * @brief Disappearing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DIALOG_DISAPPEARING, + /** + * @brief Disappeared. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DIALOG_DISAPPEARED, +} ArkUI_DialogState; + /** * @brief Enumerates the level mode. * @@ -1136,6 +1182,18 @@ int32_t OH_ArkUI_CustomDialog_RegisterOnWillDisappearCallback( int32_t OH_ArkUI_CustomDialog_RegisterOnDidDisappearCallback( ArkUI_CustomDialogOptions* options, void* userData, void (*callback)(void* userData)); +/** + * @brief Get state of dialog. + * + * @param handle Indicates the pointer to the custom dialog box controller. + * @param state Dialog state object. + * @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 20 + */ +int32_t OH_ArkUI_CustomDialog_GetState(ArkUI_NativeDialogHandle handle, ArkUI_DialogState* state); + /** * @brief Sets the background blur effect for a dialog box. * -- Gitee