From 944c7301d78610c83163bbe66c2694bcd7a60ae0 Mon Sep 17 00:00:00 2001 From: zhanghaibo Date: Mon, 25 Nov 2024 17:01:03 +0800 Subject: [PATCH] get state of custom dialog Signed-off-by: zhanghaibo Change-Id: I605cab0a1ed89217ce4b01909387bbf75f16edc4 --- arkui/ace_engine/native/native_dialog.h | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 95b1a6cbe..df4324d70 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -60,6 +60,52 @@ typedef enum { DIALOG_DISMISS_SLIDE_DOWN, } ArkUI_DismissReason; +/** +* @brief Enumerates the state of dialog. +* +* @syscap SystemCapability.ArkUI.ArkUI.Full +* +* @since 16 +*/ +typedef enum { + /** + * @brief Uninitialized. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 16 + */ + DIALOG_UNINITIALIZED = 0, + /** + * @brief Initialized. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 16 + */ + DIALOG_INITIALIZED, + /** + * @brief Appearing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 16 + */ + DIALOG_APPEARING, + /** + * @brief Appeared. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 16 + */ + DIALOG_APPEARED, + /** + * @brief Disappearing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 16 + */ + DIALOG_DISAPPEARING, + /** + * @brief Disappeared. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 16 + */ + DIALOG_DISAPPEARED, +} ArkUI_DialogState; + /** * @brief Invoked when the dialog box is closed. * @@ -271,6 +317,18 @@ typedef struct { * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. */ int32_t (*close)(ArkUI_NativeDialogHandle handle); + /** + * @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 16 + */ + int32_t (*getState)(ArkUI_NativeDialogHandle handle, ArkUI_DialogState* state); + /** * @brief Registers a listener for the dismiss event of the custom dialog box. * -- Gitee