diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 5de204ab42866f32ea1afae3fbb04128333ff732..72d1e3ba0ac26786c52a8df2578ee0d47036c256 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -39,7 +39,6 @@ #include #include "native_type.h" -#include "native_node.h" #ifdef __cplusplus extern "C" { @@ -99,13 +98,6 @@ typedef bool (*ArkUI_OnWillDismissEvent)(int32_t reason); */ typedef struct ArkUI_DialogDismissEvent ArkUI_DialogDismissEvent; -/** - * @brief Defines a struct for the content object of a custom dialog box. - * - * @since 18 - */ -typedef struct ArkUI_CustomDialogOptions ArkUI_CustomDialogOptions; - /** * @brief Provides the custom dialog box APIs for the native side. * @@ -385,265 +377,6 @@ 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 18 - */ -typedef struct { - /** - * @brief Provides the custom dialog box APIs for the native side. The API scope is {@link ArkUI_NativeDialogAPI_1} - * - * @since 18 - */ - ArkUI_NativeDialogAPI_1 nativeDialogAPI1; - /** - * @brief Provides the custom dialog box APIs for the native side. The API scope is {@link ArkUI_NativeDialogAPI_2} - * - * @since 18 - */ - 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 18 - */ - 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 18 - */ - - 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 18 - */ - 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 18 - */ - 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 18 - */ - int32_t (*registerOnDidDisappear)( - ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData)); - - /** - * @brief Sets the border width of the dialog box. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param top Width of the top border. - * @param right Width of the right border. - * @param bottom Width of the bottom border. - * @param left Width of the left border. - * @param unit Unit of the width. The default value is vp. - * @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 occur.. - * @since 18 - */ - int32_t (*setBorderWidth)( - ArkUI_NativeDialogHandle handle, float top, float right, float bottom, float left, ArkUI_LengthMetricUnit unit); - - /** - * @brief Sets the border color of the dialog box. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param top Color of the top border. - * @param right Color of the right border. - * @param bottom Color of the bottom border. - * @param left Color of the left border. - * @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 occur.. - * @since 18 - */ - int32_t (*setBorderColor)( - ArkUI_NativeDialogHandle handle, uint32_t top, uint32_t right, uint32_t bottom, uint32_t left); - - /** - * @brief Sets the border style of the dialog box. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param top Style of the top border. - * @param right Style of the right border. - * @param bottom Style of the bottom border. - * @param left Style of the left border. - * @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 occur.. - * @since 18 - */ - int32_t (*setBorderStyle)( - ArkUI_NativeDialogHandle handle, int32_t top, int32_t right, int32_t bottom, int32_t left); - - /** - * @brief Sets the width of the dialog box background. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param width Width of the background. - * @param unit Unit of the width. The default value is vp. - * @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 occur.. - * @since 18 - */ - int32_t (*setWidth)(ArkUI_NativeDialogHandle handle, float width, ArkUI_LengthMetricUnit unit); - - /** - * @brief Sets the height of the dialog box background. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param height Height of the background. - * @param unit Unit of the height. The default value is vp. - * @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 occur.. - * @since 18 - */ - int32_t (*setHeight)(ArkUI_NativeDialogHandle handle, float height, ArkUI_LengthMetricUnit unit); - - /** - * @brief Sets the shadow of the dialog box background. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param shadow Shadow style of the background, specified by an enumerated value. - * @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 occur.. - * @since 18 - */ - int32_t (*setShadow)(ArkUI_NativeDialogHandle handle, ArkUI_ShadowStyle shadow); - - /** - * @brief Sets the custom shadow of the dialog box background. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param customShadow Custom shadow parameter. The format is the same as that of the NODE_SHADOW property. - * @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 occur.. - * @since 18 - */ - int32_t (*setCustomShadow)(ArkUI_NativeDialogHandle handle, const ArkUI_AttributeItem* customShadow); - - /** - * @brief Sets the background blur style of the dialog box. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param blurStyle Background blur style, specified by an enumerated value. - * @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 occur.. - * @since 18 - */ - int32_t (*setBackgroundBlurStyle)(ArkUI_NativeDialogHandle handle, ArkUI_BlurStyle blurStyle); - - /** - * @brief Sets the keyboard avoidance mode of the dialog box. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param keyboardAvoidMode Keyboard avoidance mode, specified by an enumerated value. - * @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 occur.. - * @since 18 - */ - int32_t (*setKeyboardAvoidMode)(ArkUI_NativeDialogHandle handle, ArkUI_KeyboardAvoidMode keyboardAvoidMode); - - /** - * @brief Sets whether to enable the hover mode for the dialog box. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param enableHoverMode Whether to enable the hover mode. The default value is false. - * @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 occur.. - * @since 18 - */ - int32_t (*enableHoverMode)(ArkUI_NativeDialogHandle handle, bool enableHoverMode); - - /** - * @brief Set the default display area of the dialog box in hover mode. - * - * @note This method must be called before the show method. - * @param handle Pointer to the dialog box controller. - * @param hoverModeAreaType Display area in hover mode, specified by an enumerated value. - * @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 occur. - * @since 18 - */ - int32_t (*setHoverModeArea)(ArkUI_NativeDialogHandle handle, ArkUI_HoverModeAreaType hoverModeAreaType); - - /** - * @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 18 - */ - int32_t (*setFocusable)(ArkUI_NativeDialogHandle handle, bool focusable); -} ArkUI_NativeDialogAPI_3; - /** * @brief Sets whether to block the system behavior of dismissing a dialog box. * @@ -679,414 +412,6 @@ void* OH_ArkUI_DialogDismissEvent_GetUserData(ArkUI_DialogDismissEvent* event); */ int32_t OH_ArkUI_DialogDismissEvent_GetDismissReason(ArkUI_DialogDismissEvent* event); -/** - * @brief Displays a custom dialog box. - * - * @param options Dialog box parameters. - * @param callback Callback to be invoked when the custom dialog box displays. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_OpenDialog(ArkUI_CustomDialogOptions* options, void (*callback)(int32_t dialogId)); - -/** - * @brief Updates a custom dialog box. - * - * @param options Dialog box parameters. - * @param callback Callback to be invoked when the custom dialog box updates. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_UpdateDialog(ArkUI_CustomDialogOptions* options, void (*callback)(int32_t dialogId)); - -/** - * @brief Closes a custom dialog box. - * - * @param dialogId Dialog id. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_CloseDialog(int32_t dialogId); - -/** - * @brief Creates custom dialog box options. - * - * @param content Content of the custom dialog box. - * @return Returns the pointer to the custom dialog box options. - * @since 18 - */ -ArkUI_CustomDialogOptions* OH_ArkUI_CustomDialog_CreateOptions(ArkUI_NodeHandle content); - -/** - * @brief Destroys the custom dialog box options. - * - * @param options The pointer to the custom dialog box options. - * @since 18 - */ -void OH_ArkUI_CustomDialog_DisposeOptions(ArkUI_CustomDialogOptions* options); - -/** - * @brief Sets the level mode for a custom dialog box. - * - * @note This method must be called before the OH_ArkUI_CustomDialog_OpenDialog method. - * @param options Indicates the pointer to the custom dialog options. - * @param levelMode Indicates the level mode. The parameter type is {@link ArkUI_LevelMode}. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetLevelMode(ArkUI_CustomDialogOptions* options, ArkUI_LevelMode levelMode); - -/** - * @brief Sets the level uniqueId for a custom dialog box. - * - * @param options Indicates the pointer to the custom dialog options. - * @param uniqueId Indicates the unique id of any nodes in router or navigation pages. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetLevelUniqueId(ArkUI_CustomDialogOptions* options, int32_t uniqueId); - -/** - * @brief Sets the immersive mode for a custom dialog box. - * - * @note This method must be called before the OH_ArkUI_CustomDialog_OpenDialog method. - * @param options Indicates the pointer to the custom dialog options. - * @param immersiveMode Indicates the immersive mode. The parameter type is {@link ArkUI_ImmersiveMode}. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetImmersiveMode(ArkUI_CustomDialogOptions* options, ArkUI_ImmersiveMode immersiveMode); - -/** - * @brief Sets the background color of the dialog box. - * - * @param options Dialog box parameters. - * @param backgroundColor Background color of the dialog box. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetBackgroundColor(ArkUI_CustomDialogOptions* options, uint32_t backgroundColor); - -/** - * @brief Sets the corner radius for a custom dialog box. - * - * @param options Dialog box parameters. - * @param topLeft Corner radius of the upper left corner. - * @param topRight Corner radius of the upper right corner. - * @param bottomLeft Corner radius of the lower left corner. - * @param bottomRight Corner radius of the lower right corner. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetCornerRadius( - ArkUI_CustomDialogOptions* options, float topLeft, float topRight, float bottomLeft, float bottomRight); - -/** - * @brief Sets the border width of the dialog box. - * - * @param options Dialog box parameters. - * @param top Width of the top border. - * @param right Width of the right border. - * @param bottom Width of the bottom border. - * @param left Width of the left border. - * @param unit Unit of the width. The default value is vp. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetBorderWidth( - ArkUI_CustomDialogOptions* options, float top, float right, float bottom, float left, ArkUI_LengthMetricUnit unit); - -/** - * @brief Sets the border color of the dialog box. - * - * @param options Dialog box parameters. - * @param top Color of the top border. - * @param right Color of the right border. - * @param bottom Color of the bottom border. - * @param left Color of the left border. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetBorderColor( - ArkUI_CustomDialogOptions* options, uint32_t top, uint32_t right, uint32_t bottom, uint32_t left); - -/** - * @brief Sets the border style of the dialog box. - * - * @param options Dialog box parameters. - * @param top Style of the top border. - * @param right Style of the right border. - * @param bottom Style of the bottom border. - * @param left Style of the left border. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetBorderStyle( - ArkUI_CustomDialogOptions* options, int32_t top, int32_t right, int32_t bottom, int32_t left); - -/** - * @brief Sets the width of the dialog box background. - * - * @param options Dialog box parameters. - * @param width Width of the background. - * @param unit Unit of the width. The default value is vp. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetWidth(ArkUI_CustomDialogOptions* options, float width, ArkUI_LengthMetricUnit unit); - -/** - * @brief Sets the height of the dialog box background. - * - * @param options Dialog box parameters. - * @param height Height of the background. - * @param unit Unit of the height. The default value is vp. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetHeight(ArkUI_CustomDialogOptions* options, float height, ArkUI_LengthMetricUnit unit); - -/** - * @brief Sets the shadow of the dialog box background. - * - * @param options Dialog box parameters. - * @param shadow Shadow style of the background, specified by an enumerated value. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetShadow(ArkUI_CustomDialogOptions* options, ArkUI_ShadowStyle shadow); - -/** - * @brief Sets the custom shadow of the dialog box background. - * - * @param options Dialog box parameters. - * @param customShadow Custom shadow parameter. The format is the same as that of the NODE_SHADOW property. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetCustomShadow( - ArkUI_CustomDialogOptions* options, const ArkUI_AttributeItem* customShadow); - -/** - * @brief Sets the background blur style of the dialog box. - * - * @param options Dialog box parameters. - * @param blurStyle Background blur style, specified by an enumerated value. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetBackgroundBlurStyle(ArkUI_CustomDialogOptions* options, ArkUI_BlurStyle blurStyle); - -/** - * @brief Sets the alignment mode of the dialog box. - * - * @param options Dialog box parameters. - * @param alignment Alignment mode of the dialog box. The parameter type is {@link ArkUI_Alignment}. - * @param offsetX Indicates the horizontal offset of the custom dialog box. The value is a floating point number. - * @param offsetY Indicates the vertical offset of the custom dialog box. The value is a floating point number. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetAlignment( - ArkUI_CustomDialogOptions* options, int32_t alignment, float offsetX, float offsetY); - -/** - * @brief Sets the modal mode for a custom dialog box. - * - * @param options Dialog box parameters. - * @param isModal Whether the dialog box is a modal. A modal dialog box has a mask applied, - * while a non-modal dialog box does not. The value true means that the dialog box is a modal. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetModalMode(ArkUI_CustomDialogOptions* options, bool isModal); - -/** - * @brief Specifies whether to allow users to touch the mask to dismiss the custom dialog box. - * - * @param options Dialog box parameters. - * @param autoCancel Specifies whether to allow users to touch the mask to dismiss the dialog box. - * The value true means to allow users to do so, and false means the opposite. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetAutoCancel(ArkUI_CustomDialogOptions* options, bool autoCancel); - -/** - * @brief Sets whether to display the dialog box in a subwindow. - * - * @param options Dialog box parameters. - * @param showInSubwindow Whether to display the dialog box in a subwindow when it is not in the main window. - * The default value is false, meaning the dialog box is displayed within the application, not in a - * separate subwindow. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetSubwindowMode(ArkUI_CustomDialogOptions* options, bool showInSubwindow); - -/** - * @brief Sets the mask for a custom dialog box. - * - * @param options Dialog box parameters. - * @param maskColor Mask color, in 0xargb format. - * @param maskRect Pointer to the mask area. Events outside the mask area are transparently transmitted, - * and events within the mask area are not. The parameter type is {@link ArkUI_Rect}. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetMask( - ArkUI_CustomDialogOptions* options, uint32_t maskColor, const ArkUI_Rect* maskRect); - -/** - * @brief Sets the keyboard avoidance mode of the dialog box. - * - * @param options Dialog box parameters. - * @param keyboardAvoidMode Keyboard avoidance mode, specified by an enumerated value. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetKeyboardAvoidMode( - ArkUI_CustomDialogOptions* options, ArkUI_KeyboardAvoidMode keyboardAvoidMode); - -/** - * @brief Sets whether to enable the hover mode for the dialog box. - * - * @param options Dialog box parameters. - * @param enabled Whether to enable the hover mode. The default value is false. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetHoverModeEnabled(ArkUI_CustomDialogOptions* options, bool enabled); - -/** - * @brief Set the default display area of the dialog box in hover mode. - * - * @param options Dialog box parameters. - * @param hoverModeAreaType Display area in hover mode, specified by an enumerated value. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_SetHoverModeArea( - ArkUI_CustomDialogOptions* options, ArkUI_HoverModeAreaType hoverModeAreaType); - -/** - * @brief Registers a callback for the dismissal event of the custom dialog box. - * - * @param options Dialog box parameters. - * @param userData Pointer to the user-defined data. - * @param callback Callback for the dismissal event of the custom dialog box. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_RegisterOnWillDismissCallback( - ArkUI_CustomDialogOptions* options, void* userData, void (*callback)(ArkUI_DialogDismissEvent* event)); - -/** - * @brief Registers a callback to be invoked when the custom dialog box is about to appear. - * - * @param options Dialog box parameters. - * @param userData Pointer to the user-defined data. - * @param callback Callback to be invoked when the dialog box is about to appear. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_RegisterOnWillAppearCallback( - ArkUI_CustomDialogOptions* options, void* userData, void (*callback)(void* userData)); - -/** - * @brief Registers a callback to be invoked when the custom dialog box appears. - * - * @param options Dialog box parameters. - * @param userData Pointer to the user-defined data. - * @param callback Callback to be invoked when the custom dialog box appears. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_RegisterOnDidAppearCallback( - ArkUI_CustomDialogOptions* options, void* userData, void (*callback)(void* userData)); - -/** - * @brief Registers a callback to be invoked when the custom dialog box is about to disappear. - * - * @param options Dialog box parameters. - * @param userData Pointer to the user-defined data. - * @param callback Callback to be invoked when the dialog box is about to disappear. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_RegisterOnWillDisappearCallback( - ArkUI_CustomDialogOptions* options, void* userData, void (*callback)(void* userData)); - -/** - * @brief Registers a callback to be invoked when the custom dialog box disappears. - * - * @param options Dialog box parameters. - * @param userData Pointer to the user-defined data. - * @param callback Callback to be invoked when the custom dialog box disappears. - * @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 18 - */ -int32_t OH_ArkUI_CustomDialog_RegisterOnDidDisappearCallback( - ArkUI_CustomDialogOptions* options, void* userData, void (*callback)(void* userData)); - #ifdef __cplusplus }; #endif