From 45e3c034692af8755a029dcedc918bddf5688f74 Mon Sep 17 00:00:00 2001 From: zhanghang Date: Tue, 18 Feb 2025 15:49:35 +0800 Subject: [PATCH] textPicker and customDialog Signed-off-by: zhanghang --- arkui/ace_engine/native/libace.ndk.json | 108 +++++ arkui/ace_engine/native/native_dialog.h | 539 ++++++++++++++++++++++++ arkui/ace_engine/native/native_node.h | 84 ++++ arkui/ace_engine/native/native_type.h | 24 ++ 4 files changed, 755 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index ba3782ae6..047f1d14f 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3042,5 +3042,113 @@ { "first_introduced": "16", "name": "OH_ArkUI_NodeUtils_GetPositionToParent" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_CreateOptions" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_OpenDialog" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_UpdateDialog" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_CloseDialog" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetBackgroundColor" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetCornerRadius" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetBorderWidth" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetBorderColor" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetBorderStyle" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetWidth" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetHeight" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetShadow" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetCustomShadow" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetBackgroundBlurStyle" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetAlignment" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetModalMode" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetAutoCancel" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetSubwindowMode " + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetMask" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetKeyboardAvoidMode " + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetEnableHoverMode" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_SetHoverModeArea" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_RegisterOnWillDismissCalllback" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_RegisterOnWillAppearCallback" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_RegisterOnDidAppearCallback" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_RegisterOnWillDisappearCallback" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_CustomDialog_RegisterOnDidDisappearCallback" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 72d1e3ba0..16ba751a3 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -39,6 +39,7 @@ #include #include "native_type.h" +#include "native_node.h" #ifdef __cplusplus extern "C" { @@ -98,6 +99,13 @@ 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 16 + */ +typedef struct ArkUI_CustomDialogOptions ArkUI_CustomDialogOptions; + /** * @brief Provides the custom dialog box APIs for the native side. * @@ -375,6 +383,177 @@ typedef struct { * @since 15 */ int32_t (*setImmersiveMode)(ArkUI_NativeDialogHandle handle, ArkUI_ImmersiveMode immersiveMode); + + /** + * @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 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ + int32_t (*setHoverModeArea)(ArkUI_NativeDialogHandle handle, ArkUI_HoverModeAreaType hoverModeAreaType); } ArkUI_NativeDialogAPI_2; /** @@ -412,6 +591,366 @@ 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. + * @return Returns the result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +int32_t OH_ArkUI_CustomDialog_OpenDialog(ArkUI_CustomDialogOptions* options); + +/** + * @brief Updates a custom dialog box. + * + * @param options Dialog box parameters. + * @return Returns the result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +int32_t OH_ArkUI_CustomDialog_UpdateDialog(ArkUI_CustomDialogOptions* options); + +/** + * @brief Closes a custom dialog box. + * + * @param options Dialog box parameters. + * @return Returns the result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +int32_t OH_ArkUI_CustomDialog_CloseDialog(ArkUI_CustomDialogOptions* options); + +/** + * @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 16 + */ +ArkUI_CustomDialogOptions* OH_ArkUI_CustomDialog_CreateOptions(ArkUI_NodeHandle content); + +/** + * @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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 op border. + * @param unit Unit of the width. The default value is vp. + * @return Returns the result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 isShowInSubwindow 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +int32_t OH_ArkUI_CustomDialog_SetSubwindowMode(ArkUI_CustomDialogOptions* options, bool isShowInSubwindow); + +/** + * @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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 enableHoverMode Whether to enable the hover mode. The default value is false. + * @return Returns the result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +int32_t OH_ArkUI_CustomDialog_SetEnableHoverMode(ArkUI_CustomDialogOptions* options, bool enableHoverMode); + +/** + * @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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +int32_t OH_ArkUI_CustomDialog_RegisterOnWillDismissCalllback( + 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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +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 result code. + * Returns 0 if the operation is successful. + * Returns 401 if a parameter error occurs. + * @since 16 + */ +int32_t OH_ArkUI_CustomDialog_RegisterOnDidDisappearCallback( + ArkUI_CustomDialogOptions* options, void* userData, void (*callback)(void* userData)); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 4ae0ebd2f..5f88776bd 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7832,6 +7832,20 @@ typedef struct ArkUI_NodeAdapter* ArkUI_NodeAdapterHandle; */ typedef struct ArkUI_NodeAdapterEvent ArkUI_NodeAdapterEvent; +/** + * @brief Defines the data selection list for the text picker. + * + * @since 16 + */ +typedef struct ArkUI_TextPickerRangeContentArray ArkUI_TextPickerRangeContentArray; + + /** + * @brief Defines the multi-column cascading data selection list for the multi-column cascading data picker. + * + * @since 16 + */ +typedef struct ArkUI_TextCascadePickerRangeContentArray ArkUI_TextCascadePickerRangeContentArray; + /** * @brief Enumerates component adapter events. * @@ -9208,6 +9222,76 @@ int32_t OH_ArkUI_GetNodeSnapshot(ArkUI_NodeHandle node, ArkUI_SnapshotOptions* s */ int32_t OH_ArkUI_NodeUtils_GetPositionToParent(ArkUI_NodeHandle node, ArkUI_IntOffset* globalOffset); +/** + *@brief Creates an object of the TextPickerRangeContent array. + *@param length Length of the TextPickerRangeContent array. + *@return Returns a pointer to an empty TextPickerRangeContent array. + *@since 16 + */ +ArkUI_TextPickerRangeContentArray* OH_ArkUI_TextPickerRangeContentArray_Create(int32_t length); + +/** + *@brief Sets the icon data at the specified position in the TextPickerRangeContent array. + *@param handle Pointer to the TextPickerRangeContent array. + *@param icon Pointer to the icon image address. + *@param index Position in the array, starting from 0. + *@since 16 + */ +void OH_ArkUI_TextPickerRangeContentArray_SetIconAtIndex( + ArkUI_TextPickerRangeContentArray* handle, char* icon, int32_t index); + +/** + *@brief Sets the text data at the specified position in the TextPickerRangeContent array. + *@param handle Pointer to the TextPickerRangeContent array. + *@param text Pointer to the text content. + *@param index Position in the array, starting from 0. + *@since 16 + */ +void OH_ArkUI_TextPickerRangeContentArray_SetTextAtIndex( + ArkUI_TextPickerRangeContentArray* handle, char* text, int32_t index); + +/** + *@brief Destroys a TextPickerRangeContent array object. + *@param handle Pointer to the TextPickerRangeContent array. + *@since 16 + */ +void OH_ArkUI_TextPickerRangeContentArray_Destory(ArkUI_TextPickerRangeContentArray* handle); + +/** + *@brief Destroys a TextCascadePickerRangeContent array object. + *@param length Length of the TextCascadePickerRangeContent array. + *@return Returns a pointer to an empty TextCascadePickerRangeContent array. + *@since 16 + */ +ArkUI_TextCascadePickerRangeContentArray* OH_ArkUI_TextCascadePickerRangeContentArray_Create(int32_t length); + +/** + *@brief Sets the text data at the specified position in the TextCascadePickerRangeContent array. + * @param handle Pointer to the TextCascadePickerRangeContent array. + *@param text Pointer to the text content. + *@param index Position in the array, starting from 0. + *@since 16 + */ +void OH_ArkUI_TextCascadePickerRangeContentArray_SetTextAtIndex( + ArkUI_TextCascadePickerRangeContentArray* handle, char* text, int32_t index); + +/** + *@brief Sets the child data at the specified position in the TextCascadePickerRangeContent array. + * @param handle Pointer to the TextCascadePickerRangeContent array. + *@param child Pointer to the child node array. + *@param index Position in the array, starting from 0. + *@since 16 + */ +void OH_ArkUI_TextCascadePickerRangeContentArray_SetChildAtIndex( + ArkUI_TextCascadePickerRangeContentArray* handle, ArkUI_TextCascadePickerRangeContentArray* child, int32_t index); + +/** + *@brief Destroys a TextCascadePickerRangeContent array object. + * @param handle Pointer to the TextCascadePickerRangeContent array. + *@since 16 + */ +void OH_ArkUI_TextCascadePickerRangeContentArray_Destory(ArkUI_TextCascadePickerRangeContentArray* handle); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 816448d71..c2f0d9b5b 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2491,6 +2491,30 @@ typedef enum { ARKUI_LIST_ITEM_SWIPE_AREA_FOOTER, } ArkUI_ListItemGroupArea; +/** + * @brief Enumerates the keyboard avoidance modes. + * + * @since 16 + */ +typedef enum { + /** Automatically avoids the soft keyboard and compresses the height when reaching the maximum limit. */ + ARKUI_KEYBOARD_AVOID_MODE_DEFAULT = 0, + /** Does not avoid the keyboard. */ + ARKUI_KEYBOARD_AVOID_MODE_NONE, +}ArkUI_KeyboardAvoidMode; + +/** + * @brief Enumerates the types of display areas for the hover mode. + * + * @since 16 + */ +typedef enum { + /** Upper half screen. */ + ARKUI_HOVER_MODE_AREA_TYPE_TOP = 0, + /** Lower half screen. */ + ARKUI_HOVER_MODE_AREA_TYPE_BUTTOM, +}ArkUI_HoverModeAreaType; + /** * @brief defines the enumerated value of the direction of the extended security zone. * -- Gitee