From 7b2732948f17a55d483b918dbccf2ac9c3eb524a Mon Sep 17 00:00:00 2001 From: houguobiao Date: Thu, 6 Mar 2025 11:52:36 +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: I7b5949514ac5735d71ced02efea18556bcef669b --- arkui/ace_engine/native/native_dialog.h | 170 ++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 27bbaf88e..30b1f7878 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -464,6 +464,176 @@ typedef struct { */ 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; /** -- Gitee