From f9823d4ed16215f99269b3d02e376e92584ec962 Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Wed, 2 Apr 2025 13:54:52 +0800 Subject: [PATCH 01/35] =?UTF-8?q?=E8=BE=93=E5=85=A5=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=88TextInput=E3=80=81TextArea=EF=BC=89=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E2=80=9D=E9=AA=8C=E8=AF=81=E7=A0=81=E2=80=9D=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangxiuxiu96 Change-Id: I4e14b7336e80538931f6448518b3f1c904af0351 --- arkui/ace_engine/native/native_type.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 64676cb95..d47237099 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -423,6 +423,11 @@ typedef enum { ARKUI_TEXTINPUT_TYPE_NEW_PASSWORD = 11, /** Number input mode with a decimal point. */ ARKUI_TEXTINPUT_TYPE_NUMBER_DECIMAL = 12, + /** + * One time code input mode. + * @since 20 + */ + ARKUI_TEXTINPUT_TYPE_ONE_TIME_CODE = 14, } ArkUI_TextInputType; /** @@ -439,6 +444,11 @@ typedef enum { ARKUI_TEXTAREA_TYPE_PHONE_NUMBER = 3, /** Email address input mode. */ ARKUI_TEXTAREA_TYPE_EMAIL = 5, + /** + * One time code input mode. + * @since 20 + */ + ARKUI_TEXTAREA_TYPE_ONE_TIME_CODE = 14, } ArkUI_TextAreaType; /** -- Gitee From ace548d08df7aecdb064819448140816441f1d1c Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Thu, 3 Apr 2025 11:14:27 +0800 Subject: [PATCH 02/35] longpressApi Signed-off-by: wangxiuxiu96 Change-Id: I32e434d4f916186f2d5ae674ac84151373a21629 --- arkui/ace_engine/native/native_node.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 68e034586..2fd5023e9 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -6668,6 +6668,15 @@ typedef enum { * */ NODE_TEXT_ON_DETECT_RESULT_UPDATE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_TEXT, + /** + * @brief Defines the long press event for span + * + * The event is triggered when the span is long pressed. + * When the event callback occurs, the {@link ArkUI_NodeEvent} object can be obtained from the + * {@link ArkUI_UIInputEvent} object.\n + *@since 20 + */ + NODE_TEXT_SPAN_ON_LONG_PRESS = 1001, /** * @brief Defines the image loading success event. * -- Gitee From da5bda74188a157ed864dea750f28d02ae563df3 Mon Sep 17 00:00:00 2001 From: ShortMessage Date: Mon, 7 Apr 2025 19:43:02 +0800 Subject: [PATCH 03/35] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E7=BC=96=E8=BE=91=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ShortMessage --- arkui/ace_engine/native/native_type.h | 2 ++ inputmethod/include/inputmethod_types_capi.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 64676cb95..23b97c735 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -423,6 +423,8 @@ typedef enum { ARKUI_TEXTINPUT_TYPE_NEW_PASSWORD = 11, /** Number input mode with a decimal point. */ ARKUI_TEXTINPUT_TYPE_NUMBER_DECIMAL = 12, + /** OneTimeCode input mode. */ + ARKUI_TEXTINPUT_TYPE_ONE_TIME_CODE = 13, } ArkUI_TextInputType; /** diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h index b3848f15f..d2d267128 100644 --- a/inputmethod/include/inputmethod_types_capi.h +++ b/inputmethod/include/inputmethod_types_capi.h @@ -215,6 +215,10 @@ typedef enum InputMethod_TextInputType { * The text input type is NUMBER DECIMAL. */ IME_TEXT_INPUT_TYPE_NUMBER_DECIMAL = 12, + /** + * The text input type is ONE_TIME_CODE. + */ + IME_TEXT_INPUT_TYPE_ONE_TIME_CODE = 13, } InputMethod_TextInputType; /** -- Gitee From e3201b71cbef61d4586524755bce11251e2b6802 Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Tue, 8 Apr 2025 17:42:00 +0800 Subject: [PATCH 04/35] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=B3=95=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E6=94=AF=E6=8C=81=E6=84=9F=E7=9F=A5=E5=88=B0=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=A1=86=E4=B8=AD=E7=9A=84=E5=8D=A0=E4=BD=8D=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=92=8C=E6=89=80=E5=B1=9EAbility=E7=9A=84=E5=90=8D?= =?UTF-8?q?=E5=AD=97-ndk-=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianyong325 Change-Id: I05523003bd658c55e58f7d18ab417096ba2df84e --- .../include/inputmethod_text_config_capi.h | 69 +++++++++++++++++++ inputmethod/libohinputmethodndk.json | 16 +++++ 2 files changed, 85 insertions(+) diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index ad639af2d..3cf362df4 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -131,6 +131,40 @@ InputMethod_ErrorCode OH_TextConfig_SetSelection(InputMethod_TextConfig *config, */ InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, int32_t windowId); +/** + * @brief Set placeholder into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param placeholder The placeholder, which is defined in {@link InputMethod_TextConfig}. Max size 256 char16_t. + * @param length The size of placeholder. Max is char16_t. + * The placeholderlength, which is defined in {@link InputMethod_TextConfig}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 18 + */ +InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *config, const char16_t *placeholder, + size_t length); + +/** + * @brief Set placeholder into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. Max size 32 char16_t. + * @param length The size of abilityName. Max is 32 char16_t. + * The abilityNamelength, which is defined in {@link InputMethod_TextConfig}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 18 + */ +InputMethod_ErrorCode OH_TextConfig_SetAbilityName(InputMethod_TextConfig *config, const char16_t *abilityName, + size_t length); + /** * @brief Get input type from TextConfig * @@ -222,6 +256,41 @@ InputMethod_ErrorCode OH_TextConfig_GetSelection(InputMethod_TextConfig *config, * @since 12 */ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, int32_t *windowId); +/** + * @brief Get placeholder into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param placeholder Returns the placeholder. which is defined in {@link InputMethod_TextConfig}. + * The free function needs to be called externally to release the internal requested memory。 + * @param length return the size of placeholder. + * The abilityNamelength, which is defined in {@link InputMethod_TextConfig}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 18 + */ +InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *config, char16_t **placeholder, + size_t* const length); + +/** + * @brief Get abilityName into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. + * The free function needs to be called externally to release the internal requested memory. + * @param length return the size of abilityName. + * The abilityNamelength, which is defined in {@link InputMethod_TextConfig}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 18 + */ +InputMethod_ErrorCode OH_TextConfig_GetAbilityName(InputMethod_TextConfig *config, char16_t **abilityName, + size_t* const length); #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/inputmethod/libohinputmethodndk.json b/inputmethod/libohinputmethodndk.json index b90b67567..b01c96dad 100644 --- a/inputmethod/libohinputmethodndk.json +++ b/inputmethod/libohinputmethodndk.json @@ -322,5 +322,21 @@ { "first_introduced": "15", "name": "OH_AttachOptions_GetRequestKeyboardReason" + }, + { + "first_introduced": "18", + "name": "OH_TextConfig_SetPlaceholder" + }, + { + "first_introduced": "18", + "name": "OH_TextConfig_SetAbilityName" + }, + { + "first_introduced": "18", + "name": "OH_TextConfig_GetPlaceholder" + }, + { + "first_introduced": "18", + "name": "OH_TextConfig_GetAbilityName" } ] \ No newline at end of file -- Gitee From 567e7c5a4ac614fb1ae7896c37e7ae172ec009a0 Mon Sep 17 00:00:00 2001 From: yangbiao199318 Date: Tue, 8 Apr 2025 16:58:14 +0800 Subject: [PATCH 05/35] add textpicker's selected background style Signed-off-by: yangbiao199318 --- arkui/ace_engine/native/native_node.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 8c4787c8e..31931955e 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4224,6 +4224,28 @@ typedef enum { * @since 18 */ NODE_TEXT_PICKER_ENABLE_HAPTIC_FEEDBACK = 15010, + /** + * @brief Defines the background color and border radius of the selected items. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].u32: background color, in 0xARGB format, for example, 0xFF1122FF. \n + * 1: .value[1].f32: radius of the four corners. \n + * 2: .value[1].f32: radius of the upper left corner. \n + * .value[2].f32: radius of the upper right corner. \n + * .value[3].f32: radius of the lower left corner. \n + * .value[4].f32: radius of the lower right corner. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: background color, in 0xARGB format, for example, 0xFF1122FF. \n * + * .value[1].f32: radius of the upper left corner. \n + * .value[2].f32: radius of the upper right corner. \n + * .value[3].f32: radius of the lower left corner. \n + * .value[4].f32: radius of the lower right corner. \n + * + * @since 20 + */ + NODE_TEXT_PICKER_SELECTED_BACKGROUND_STYLE = 15011, /** * @brief Defines the style of the background in the selected state of the calendar picker. * This attribute can be set, reset, and obtained as required through APIs. -- Gitee From 107f9fd081eb002666c7f076e55a93583e4bef38 Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Wed, 9 Apr 2025 16:15:17 +0800 Subject: [PATCH 06/35] =?UTF-8?q?=E4=BF=AE=E6=94=B9ndk=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianyong325 Change-Id: Ib5bb971d1b5d18bbb58ccca31e58230a5f15c6d2 --- .../include/inputmethod_text_config_capi.h | 18 ++++++++++-------- inputmethod/libohinputmethodndk.json | 8 ++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 3cf362df4..46821fe51 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -135,15 +135,16 @@ InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, * @brief Set placeholder into TextConfig. * * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. - * @param placeholder The placeholder, which is defined in {@link InputMethod_TextConfig}. Max size 256 char16_t. - * @param length The size of placeholder. Max is char16_t. + * @param placeholder The placeholder, which is defined in {@link InputMethod_TextConfig}. + * Cannot exceed 256 UTF-16 encoded characters. + * @param length The size of placeholder. Counting unit chart16_t. * The placeholderlength, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_PARAMCHECK} - parameter check failed. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. - * @since 18 + * @since 20 */ InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *config, const char16_t *placeholder, size_t length); @@ -152,15 +153,16 @@ InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *confi * @brief Set placeholder into TextConfig. * * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. - * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. Max size 32 char16_t. - * @param length The size of abilityName. Max is 32 char16_t. + * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. + * Cannot exceed 256 UTF-16 encoded characters. + * @param length The size of abilityName. Counting unit chart16_t. * The abilityNamelength, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_PARAMCHECK} - parameter check failed. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. - * @since 18 + * @since 20 */ InputMethod_ErrorCode OH_TextConfig_SetAbilityName(InputMethod_TextConfig *config, const char16_t *abilityName, size_t length); @@ -269,7 +271,7 @@ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, * {@link IME_ERR_PARAMCHECK} - parameter check failed. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. - * @since 18 + * @since 20 */ InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *config, char16_t **placeholder, size_t* const length); @@ -287,7 +289,7 @@ InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *confi * {@link IME_ERR_PARAMCHECK} - parameter check failed. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. - * @since 18 + * @since 20 */ InputMethod_ErrorCode OH_TextConfig_GetAbilityName(InputMethod_TextConfig *config, char16_t **abilityName, size_t* const length); diff --git a/inputmethod/libohinputmethodndk.json b/inputmethod/libohinputmethodndk.json index b01c96dad..7b9425fce 100644 --- a/inputmethod/libohinputmethodndk.json +++ b/inputmethod/libohinputmethodndk.json @@ -324,19 +324,19 @@ "name": "OH_AttachOptions_GetRequestKeyboardReason" }, { - "first_introduced": "18", + "first_introduced": "20", "name": "OH_TextConfig_SetPlaceholder" }, { - "first_introduced": "18", + "first_introduced": "20", "name": "OH_TextConfig_SetAbilityName" }, { - "first_introduced": "18", + "first_introduced": "20", "name": "OH_TextConfig_GetPlaceholder" }, { - "first_introduced": "18", + "first_introduced": "20", "name": "OH_TextConfig_GetAbilityName" } ] \ No newline at end of file -- Gitee From 81004a95a6a546e5978fcc95b9c5b76d0482ccf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E5=87=AF?= Date: Thu, 10 Apr 2025 16:22:16 +0800 Subject: [PATCH 07/35] view capi translate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永凯 --- arkui/ace_engine/native/native_node.h | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 8c4787c8e..2abd2a9ca 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1929,6 +1929,40 @@ typedef enum { */ NODE_VISIBLE_AREA_APPROXIMATE_CHANGE_RATIO = 102, + /** + * @brief Defines the translate attribute, which supports for percentile translation input, and can be set, reset, + * and obtained as required through APIs.\n + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: distance to translate along the x-axis. The default unit is percentage. + * The unit is vp only if value[3] exists and value[3] is 0. The default value of value[0] is 0.\n + * .value[1].f32: distance to translate along the y-axis. The default unit is percentage. + * The unit is vp only if value[4] exists and value[4] is 0. The default value of value[1] is 0.\n + * .value[2].f32: distance to translate along the z-axis, in vp. The default value is 0.\n + * .value[3]?.i32: Whether the translation distance along the x-axis is specified as a percentage. + * The value can be 0 or 1. When the value is 1, it is specified as a percentage. + * For example, value[0].f32=0.1 and value[3].i32=1 indicates a 10% shift in the x direction. + * The default value is 1.\n + * .value[4]?.i32: Whether the translation distance along the y-axis is specified as a percentage. + * The value can be 0 or 1. When the value is 1, it is specified as a percentage. + * For example, value[1].f32=0.1 and value[4].i32=1 indicates a 10% shift in the y direction. + * The default value is 1.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: distance to translate along the x-axis. The unit depends on value[3].\n + * .value[1].f32: distance to translate along the y-axis. The unit depends on value[4].\n + * .value[2].f32: distance to translate along the z-axis. The unit is vp.\n + * .value[3].i32: Whether the unit of the X-axis translation distance is in percentage. When value[3].i32 is 0, + * the unit of the X-axis translation distance is vp; when value[3].i32 is 1, the unit of the X-axis translation + * distance is percentage;\n + * .value[4].i32: Whether the unit of the Y-axis translation distance is in percentage. When value[4].i32 is 0, + * the unit of the Y-axis translation distance is vp; when value[4].i32 is 1, the unit of the Y-axis translation + * distance is percentage;\n + * + * @since 20 + */ + NODE_TRANSLATE_WITH_PERCENT = 103, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * -- Gitee From cac51e2a48afd779c593c1e8f133bf096e07384d Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Thu, 10 Apr 2025 19:41:38 +0800 Subject: [PATCH 08/35] =?UTF-8?q?=E4=BF=AE=E6=94=B9ndk=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianyong325 Change-Id: I70a05f2cfba5a7a48670c32db02fb58384c52ffb --- .../include/inputmethod_text_config_capi.h | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 46821fe51..16f5b499d 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -138,7 +138,7 @@ InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, * @param placeholder The placeholder, which is defined in {@link InputMethod_TextConfig}. * Cannot exceed 256 UTF-16 encoded characters. * @param length The size of placeholder. Counting unit chart16_t. - * The placeholderlength, which is defined in {@link InputMethod_TextConfig}. + * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_PARAMCHECK} - parameter check failed. @@ -146,7 +146,7 @@ InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 20 */ -InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *config, const char16_t *placeholder, + InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *config, const char16_t *placeholder, size_t length); /** @@ -156,7 +156,7 @@ InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *confi * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. * Cannot exceed 256 UTF-16 encoded characters. * @param length The size of abilityName. Counting unit chart16_t. - * The abilityNamelength, which is defined in {@link InputMethod_TextConfig}. + * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_PARAMCHECK} - parameter check failed. @@ -258,14 +258,16 @@ InputMethod_ErrorCode OH_TextConfig_GetSelection(InputMethod_TextConfig *config, * @since 12 */ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, int32_t *windowId); + /** * @brief Get placeholder into TextConfig. * * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param placeholder Returns the placeholder. which is defined in {@link InputMethod_TextConfig}. - * The free function needs to be called externally to release the internal requested memory。 - * @param length return the size of placeholder. - * The abilityNamelength, which is defined in {@link InputMethod_TextConfig}. + * The user needs to allocate memory. + * @param length Input and output parameters. The input is the size requested by the user (unit: chart16_t), + * returns the size of the placeholder. + * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_PARAMCHECK} - parameter check failed. @@ -273,8 +275,8 @@ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 20 */ -InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *config, char16_t **placeholder, - size_t* const length); + InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *config, char16_t *placeholder, + size_t *length); /** * @brief Get abilityName into TextConfig. @@ -282,8 +284,9 @@ InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *confi * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. * The free function needs to be called externally to release the internal requested memory. - * @param length return the size of abilityName. - * The abilityNamelength, which is defined in {@link InputMethod_TextConfig}. + * @param length Input and output parameters. The input is the size requested by the user (unit: chart16_t), + * returns the size of the ability name. + * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_PARAMCHECK} - parameter check failed. @@ -291,8 +294,8 @@ InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *confi * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 20 */ -InputMethod_ErrorCode OH_TextConfig_GetAbilityName(InputMethod_TextConfig *config, char16_t **abilityName, - size_t* const length); +InputMethod_ErrorCode OH_TextConfig_GetAbilityName(InputMethod_TextConfig *config, char16_t *abilityName, + size_t *length); #ifdef __cplusplus } #endif /* __cplusplus */ -- Gitee From 3df27f01c15be3d9d9b8cc66d1186a203884baa6 Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Thu, 10 Apr 2025 19:47:40 +0800 Subject: [PATCH 09/35] =?UTF-8?q?=E4=BF=AE=E6=94=B9ndk=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianyong325 Change-Id: I18f400e9d86a938d0f53d9441fae75db0a3c2d9f --- inputmethod/include/inputmethod_text_config_capi.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 16f5b499d..52514458b 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -137,7 +137,7 @@ InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param placeholder The placeholder, which is defined in {@link InputMethod_TextConfig}. * Cannot exceed 256 UTF-16 encoded characters. - * @param length The size of placeholder. Counting unit chart16_t. + * @param length The size of placeholder. Counting unit char16_t. * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. @@ -155,7 +155,7 @@ InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. * Cannot exceed 256 UTF-16 encoded characters. - * @param length The size of abilityName. Counting unit chart16_t. + * @param length The size of abilityName. Counting unit char16_t. * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. @@ -265,7 +265,7 @@ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param placeholder Returns the placeholder. which is defined in {@link InputMethod_TextConfig}. * The user needs to allocate memory. - * @param length Input and output parameters. The input is the size requested by the user (unit: chart16_t), + * @param length Input and output parameters. The input is the size requested by the user (unit: char16_t), * returns the size of the placeholder. * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. @@ -284,7 +284,7 @@ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. * The free function needs to be called externally to release the internal requested memory. - * @param length Input and output parameters. The input is the size requested by the user (unit: chart16_t), + * @param length Input and output parameters. The input is the size requested by the user (unit: char16_t), * returns the size of the ability name. * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. -- Gitee From 0a5fd8c18bd43018972f8483952e5b126382fe14 Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Thu, 10 Apr 2025 20:39:22 +0800 Subject: [PATCH 10/35] =?UTF-8?q?=E4=BF=AE=E6=94=B9ndk=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianyong325 Change-Id: Ie6c1ab7d123ef57066176ab04eb489bb3617586f --- inputmethod/include/inputmethod_text_config_capi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 52514458b..dd75cf2ca 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -146,7 +146,7 @@ InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 20 */ - InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *config, const char16_t *placeholder, +InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *config, const char16_t *placeholder, size_t length); /** @@ -275,7 +275,7 @@ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 20 */ - InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *config, char16_t *placeholder, +InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *config, char16_t *placeholder, size_t *length); /** -- Gitee From 9fb554f248a66db0d208f8473477d46197b8687c Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Fri, 11 Apr 2025 09:22:41 +0800 Subject: [PATCH 11/35] checkcode Signed-off-by: qianyong325 Change-Id: I8b0009adfdb96f9eda39050f4d94759dba9349a9 --- inputmethod/include/inputmethod_text_config_capi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index dd75cf2ca..2e85b3e2d 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -265,7 +265,7 @@ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param placeholder Returns the placeholder. which is defined in {@link InputMethod_TextConfig}. * The user needs to allocate memory. - * @param length Input and output parameters. The input is the size requested by the user (unit: char16_t), + * @param length Input and output parameters. The input is the size requested by the user (unit: char16_t), * returns the size of the placeholder. * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. @@ -284,7 +284,7 @@ InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *confi * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param abilityName The abilityName, which is defined in {@link InputMethod_TextConfig}. * The free function needs to be called externally to release the internal requested memory. - * @param length Input and output parameters. The input is the size requested by the user (unit: char16_t), + * @param length Input and output parameters. The input is the size requested by the user (unit: char16_t), * returns the size of the ability name. * The length, which is defined in {@link InputMethod_TextConfig}. * @return Returns a specific error code. -- Gitee From 3135da340a3ee39e88888f2b0cd7030ed02f4fcd Mon Sep 17 00:00:00 2001 From: yangbiao199318 Date: Thu, 10 Apr 2025 15:58:24 +0800 Subject: [PATCH 12/35] SliderCAPI Signed-off-by: yangbiao199318 --- arkui/ace_engine/native/native_node.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 8c4787c8e..d8167edd3 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4561,6 +4561,32 @@ typedef enum { */ NODE_SLIDER_ENABLE_HAPTIC_FEEDBACK = 17013, + /** + * @brief Sets a custom component on the leading side of the Slider component. + * + * Attribute setting method {@link ArkUI_AttributeItem} parameter format:\n + * .object: Parameter type {@link ArkUI_NodeHandle}. + * + * The prefix component will be placed at the start position of the Slider, + * typically on the left side in LTR layouts. + * + * @since 20 + */ + NODE_SLIDER_PREFIX, + + /** + * @brief Sets a custom component on the trailing side of the Slider component. + * + * Attribute setting method {@link link ArkUI_AttributeItem} parameter format:\n + * .object: Parameter type {@link ArkUI_NodeHandle}. + * + * The suffix component will be placed at the end position of the Slider, + * typically on the right side in LTR layouts. + * + * @since 20 + */ + NODE_SLIDER_SUFFIX, + /** * @brief Set the selection status of an option button. Attribute setting, * attribute resetting, and attribute obtaining are supported. -- Gitee From 23c29f2c90513eb27a52b143be3f8d7c1eb04f6c Mon Sep 17 00:00:00 2001 From: yzj688 Date: Fri, 11 Apr 2025 15:45:38 +0800 Subject: [PATCH 13/35] =?UTF-8?q?Drawing=20=E5=A2=9E=E5=8A=A0pixelmap?= =?UTF-8?q?=E6=9E=84=E9=80=A0canvas=E6=8E=A5=E5=8F=A3=20Signed-off-by:=20y?= =?UTF-8?q?zj688=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- graphic/graphic_2d/native_drawing/drawing_canvas.h | 14 ++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index 2581f31ab..c9ac9b2a5 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -75,6 +75,20 @@ typedef enum { */ OH_Drawing_Canvas* OH_Drawing_CanvasCreate(void); +/** + * @brief Creates an OH_Drawing_Canvas object from OH_Drawing_PixelMap. + * The OH_Drawing_PixelMap should be dissolved by OH_Drawing_PixelMapDissolve after the OH_Drawing_Canvas is destroyed. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param pixelMap Indicates the pointer to an OH_Drawing_PixelMap object. + * @return Returns the pointer to the OH_Drawing_Canvas object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is that the available memory is empty or pixelMap is nullptr. + * @since 20 + * @version 1.0 + */ +OH_Drawing_Canvas* OH_Drawing_CanvasCreateWithPixelMap(OH_Drawing_PixelMap* pixelMap); + /** * @brief Destroys an OH_Drawing_Canvas object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index e13687d42..afa41b0d6 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -50,6 +50,10 @@ "name": "OH_Drawing_BrushReset" }, { "name": "OH_Drawing_CanvasCreate" }, + { + "first_introduced": "20", + "name": "OH_Drawing_CanvasCreateWithPixelMap" + }, { "name": "OH_Drawing_CanvasDestroy" }, { "name": "OH_Drawing_CanvasBind" }, { "name": "OH_Drawing_CanvasAttachPen" }, -- Gitee From 30ff0e0b14d67444380217a0561b11a1a2a83c47 Mon Sep 17 00:00:00 2001 From: ustc-tianyu Date: Wed, 2 Apr 2025 18:59:44 +0800 Subject: [PATCH 14/35] adddrawingCinterface Signed-off-by: ustc-tianyu --- .../native_drawing/drawing_color_filter.h | 13 +++++++ .../native_drawing/drawing_image_filter.h | 29 +++++++++++++++ .../native_drawing/drawing_shader_effect.h | 36 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 20 +++++++++++ 4 files changed, 98 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_color_filter.h b/graphic/graphic_2d/native_drawing/drawing_color_filter.h index 051ef91bd..bfad30b6b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_color_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_color_filter.h @@ -113,6 +113,19 @@ OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateSrgbGammaToLinear(void); */ OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLuma(void); +/** + * @brief Creates an OH_Drawing_ColorFilter with the given mutColor used to multiply source color and addColor + * used to add to source color. The Alpha channel will not be affected. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param mulColor Indicates the color, which is a 32-bit (ARGB) variable. + * @param addColor Indicates the color, which is a 32-bit (ARGB) variable. + * @return Returns the pointer to the OH_Drawing_ColorFilter object created. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLighting(uint32_t mulColor, uint32_t addColor); + /** * @brief Destroys an OH_Drawing_ColorFilter object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/drawing_image_filter.h b/graphic/graphic_2d/native_drawing/drawing_image_filter.h index 3fde3b724..90d1f21f2 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_image_filter.h @@ -79,6 +79,35 @@ OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur(float sigmaX, float sig OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromColorFilter(OH_Drawing_ColorFilter* colorFilter, OH_Drawing_ImageFilter* imageFilter); +/** + * @brief Creates an OH_Drawing_ImageFilter object with the provided x and y offset. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param x Indicates the x offset. + * @param y Indicates the y offset. + * @param imageFilter Indicates the input filter, or uses the source bitmap if this is null. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is that the available memory is empty. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateOffset(float x, float y, OH_Drawing_ImageFilter* imageFilter); + +/** + * @brief Creates an OH_Drawing_ImageFilter object that applies the shader to the input. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param shaderEffct Indicates the shader effect to be applied to the image. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is that the available memory is empty or + * a nullptr OH_Drawing_ShaderEffect is passed. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromShaderEffect(OH_Drawing_ShaderEffect* shaderEffct); + /** * @brief Destroys an OH_Drawing_ImageFilter object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h index b42156a5f..b7ec8b28c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h @@ -167,6 +167,26 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMat const OH_Drawing_Point2D* centerPt, float radius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode tileMode, const OH_Drawing_Matrix* matrix); +/** + * @brief Creates an OH_Drawing_ShaderEffect that generates a sweep gradient given a center. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param centerPt Indicates the center of the circle for the gradient. + * @param colors Indicates the colors to be distributed between the two points. + * @param pos Indicates the relative position of each corresponding color in the colors array. + * @param size Indicates the number of colors and pos. + * @param tileMode Indicates the tile mode. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object, + which represents the local matrix of the created OH_Drawing_ShaderEffect object. + If matrix is nullptr, defaults to the identity matrix. + * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateSweepGradientWithLocalMatrix( + const OH_Drawing_Point* centerPt, const uint32_t* colors, const float* pos, uint32_t size, + OH_Drawing_TileMode tileMode, const OH_Drawing_Matrix* matrix); + /** * @brief Creates an OH_Drawing_ShaderEffect that generates a sweep gradient given a center. * @@ -226,6 +246,22 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateTwoPointConicalGradient(co float startRadius, const OH_Drawing_Point2D* endPt, float endRadius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode tileMode, const OH_Drawing_Matrix* matrix); +/** + * @brief Creates an OH_Drawing_ShaderEffect that generates by two shaders.. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param dst Indicates the destination ShaderEffect pointer. + * @param src Indicates the source ShaderEffect pointer. + * @param mode Indicates the blend mode. + * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is that the available memory is empty or any of dst and src is nullptr. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateCompose(OH_Drawing_ShaderEffect* dst, + OH_Drawing_ShaderEffect* src, OH_Drawing_BlendMode mode); + /** * @brief Destroys an OH_Drawing_ShaderEffect object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index afa41b0d6..3af5dfe2e 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -181,6 +181,10 @@ { "name": "OH_Drawing_ColorFilterCreateCompose" }, { "name": "OH_Drawing_ColorFilterCreateLinearToSrgbGamma" }, { "name": "OH_Drawing_ColorFilterCreateLuma" }, + { + "first_introduced": "20", + "name": "OH_Drawing_ColorFilterCreateLighting" + }, { "name": "OH_Drawing_ColorFilterCreateMatrix" }, { "name": "OH_Drawing_ColorFilterCreateSrgbGammaToLinear" }, { "name": "OH_Drawing_ColorFilterDestroy" }, @@ -342,6 +346,14 @@ "first_introduced": "12", "name": "OH_Drawing_ImageFilterCreateFromColorFilter" }, + { + "first_introduced": "20", + "name": "OH_Drawing_ImageFilterCreateOffset" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_ImageFilterCreateFromShaderEffect" + }, { "first_introduced": "12", "name": "OH_Drawing_ImageFilterDestroy" @@ -698,6 +710,10 @@ "first_introduced": "12", "name": "OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix" }, + { + "first_introduced": "20", + "name": "OH_Drawing_ShaderEffectCreateSweepGradientWithLocalMatrix" + }, { "name": "OH_Drawing_ShaderEffectCreateSweepGradient" }, { "first_introduced": "12", @@ -707,6 +723,10 @@ "first_introduced": "12", "name": "OH_Drawing_ShaderEffectCreateTwoPointConicalGradient" }, + { + "first_introduced": "20", + "name": "OH_Drawing_ShaderEffectCreateCompose" + }, { "name": "OH_Drawing_ShaderEffectDestroy" }, { "first_introduced": "12", -- Gitee From 53ca24b6d697295768236983f598048353060984 Mon Sep 17 00:00:00 2001 From: zhanghang Date: Fri, 14 Mar 2025 11:05:34 +0800 Subject: [PATCH 15/35] Add max pull down distance for refresh Signed-off-by: zhanghang --- arkui/ace_engine/native/native_node.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index edf6df2dd..fc0927559 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -6028,6 +6028,19 @@ typedef enum { * */ NODE_REFRESH_PULL_TO_REFRESH = 1009004, + /** + * @brief Sets the maximum pull-down distance for refreshing. + * This attribute can be set, reset, and obtained through the API as required. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: maximum pull-down distance, in vp. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: maximum pull-down distance, in vp. + * + * @since 20 + */ + NODE_REFRESH_MAX_PULL_DOWN_DISTANCE = 1009005, /** * @brief Defines the main axis direction of the component layout. -- Gitee From 5bc93ec5ae3ddc8bda7df5a5311334ee03026395 Mon Sep 17 00:00:00 2001 From: yangyang706 Date: Sat, 19 Apr 2025 14:57:23 +0800 Subject: [PATCH 16/35] add native child exit callback register and unregister Signed-off-by: yangyang706 Change-Id: Ie6409343f4822a79aa594562e19b99c1991c135c --- .../child_process/libchild_process.ndk.json | 10 ++++- .../child_process/native_child_process.h | 45 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/ability/ability_runtime/child_process/libchild_process.ndk.json b/ability/ability_runtime/child_process/libchild_process.ndk.json index d812f5a08..9d78ead9a 100644 --- a/ability/ability_runtime/child_process/libchild_process.ndk.json +++ b/ability/ability_runtime/child_process/libchild_process.ndk.json @@ -10,5 +10,13 @@ { "first_introduced": "16", "name": "OH_Ability_GetCurrentChildProcessArgs" + }, + { + "first_introduced": "20", + "name": "OH_Ability_RegisterNativeChildProcessExitCallback" + }, + { + "first_introduced": "20", + "name": "OH_Ability_UnregisterNativeChildProcessExitCallback" } -] \ No newline at end of file +] diff --git a/ability/ability_runtime/child_process/native_child_process.h b/ability/ability_runtime/child_process/native_child_process.h index 283710400..f1849e2fd 100644 --- a/ability/ability_runtime/child_process/native_child_process.h +++ b/ability/ability_runtime/child_process/native_child_process.h @@ -111,6 +111,12 @@ typedef enum Ability_NativeChildProcess_ErrCode { * An invalid IPC object pointer may be returned. */ NCP_ERR_CONNECTION_FAILED = 16010008, + + /** + * @error The callback does not exist; it may not have been registered or has already been unregistered. + * @since 20 + */ + NCP_ERR_CALLBACK_NOT_EXIST = 16010009, } Ability_NativeChildProcess_ErrCode; @@ -288,6 +294,45 @@ Ability_NativeChildProcess_ErrCode OH_Ability_StartNativeChildProcess( */ NativeChildProcess_Args* OH_Ability_GetCurrentChildProcessArgs(); +/** + * @brief Define a callback function to handle the exit of a native child process. + * + * @param pid The pid of the exited native child process. + * @param signal The signal of the exited native child process. + * @since 20 + */ +typedef void (*OH_Ability_OnNativeChildProcessExit)(int32_t pid, int32_t signal); + +/** + * @brief Register a native child process exit callback. + * Registering the same callback repeatedly will only keep one. + * + * @param onProcessExit Pointer to the callback function to handle the exit of a native child process. + * For details, see {@link OH_Ability_OnNativeChildProcessExit}. + * @return Returns {@link NCP_NO_ERROR} if the call is successful. + * Returns {@link NCP_ERR_INVALID_PARAM} if the param is invalid. + * Returns {@link NCP_ERR_INTERNAL} if internal error occurs. + * For details, see {@link Ability_NativeChildProcess_ErrCode}. + * @since 20 + */ +Ability_NativeChildProcess_ErrCode OH_Ability_RegisterNativeChildProcessExitCallback( + OH_Ability_OnNativeChildProcessExit onProcessExit); + +/** + * @brief Unregister a native child process exit callback. + * + * @param onProcessExit Pointer to the callback function to handle the exit of a native child process. + * For details, see {@link OH_Ability_OnNativeChildProcessExit}. + * @return Returns {@link NCP_NO_ERROR} if the call is successful. + * Returns {@link NCP_ERR_INVALID_PARAM} if the param is invalid. + * Returns {@link NCP_ERR_INTERNAL} if internal error occurs. + * Returns {@link NCP_ERR_CALLBACK_NOT_EXIST} if the callback is not exist. + * For details, see {@link Ability_NativeChildProcess_ErrCode}. + * @since 20 + */ +Ability_NativeChildProcess_ErrCode OH_Ability_UnregisterNativeChildProcessExitCallback( + OH_Ability_OnNativeChildProcessExit onProcessExit); + #ifdef __cplusplus } // extern "C" #endif -- Gitee From d9ef1e40bc6597bcc70e4b611b0000e3b8197480 Mon Sep 17 00:00:00 2001 From: liukaii Date: Fri, 18 Apr 2025 13:12:07 +0800 Subject: [PATCH 17/35] =?UTF-8?q?=E8=8E=B7=E5=8F=96DragEvent=E7=9A=84Displ?= =?UTF-8?q?ayId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liukaii --- arkui/ace_engine/native/drag_and_drop.h | 12 ++++++++++++ arkui/ace_engine/native/libace.ndk.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/arkui/ace_engine/native/drag_and_drop.h b/arkui/ace_engine/native/drag_and_drop.h index 38e49caad..934453a32 100644 --- a/arkui/ace_engine/native/drag_and_drop.h +++ b/arkui/ace_engine/native/drag_and_drop.h @@ -434,6 +434,18 @@ float OH_ArkUI_DragEvent_GetVelocity(ArkUI_DragEvent* event); */ int32_t OH_ArkUI_DragEvent_GetModifierKeyStates(ArkUI_DragEvent* event, uint64_t* keys); +/** + * @brief Obtains the display ID of the screen for the specified drag event. + * + * @param event Pointer to an ArkUI_DragEvent object. + * @param displayId Display ID of the event occurs in. + * @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 20 + */ +ArkUI_ErrorCode OH_ArkUI_DragEvent_GetDisplayId(ArkUI_DragEvent *event, int32_t *displayId); + /** * @brief Request to start the data sync process with the sync option. * diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index c80fc0750..1cbd4baac 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2239,6 +2239,10 @@ "first_introduced": "12", "name": "OH_ArkUI_DragEvent_GetModifierKeyStates" }, + { + "first_introduced": "20", + "name": "OH_ArkUI_DragEvent_GetDisplayId" + }, { "first_introduced": "12", "name": "OH_ArkUI_SetDragEventStrictReportWithNode" -- Gitee From ac428546648add7d30d8b2af624042c88cea75c0 Mon Sep 17 00:00:00 2001 From: liukaii Date: Tue, 22 Apr 2025 15:22:51 +0800 Subject: [PATCH 18/35] feat: add statesStyle capi interface Signed-off-by: liukaii Change-Id: I260fde0299aa85fb7af3f71e497f30d89f9d01b7 --- arkui/ace_engine/native/libace.ndk.json | 8 +++++ arkui/ace_engine/native/native_node.h | 47 +++++++++++++++++++++++++ arkui/ace_engine/native/native_type.h | 22 ++++++++++++ 3 files changed, 77 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index c80fc0750..bad9356e8 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3290,5 +3290,13 @@ { "first_introduced": "18", "name": "OH_ArkUI_XComponent_IsInitialized" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_AddSupportedUIStates" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RemoveSupportedUIStates" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index edf6df2dd..abc05a00a 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -9320,6 +9320,53 @@ int32_t OH_ArkUI_GetNodeSnapshot(ArkUI_NodeHandle node, ArkUI_SnapshotOptions* s */ int32_t OH_ArkUI_NodeUtils_GetPositionToParent(ArkUI_NodeHandle node, ArkUI_IntOffset* globalOffset); +/** + * @brief Adds the polymorphic style states supported by the component. To handle states efficiently, specify the + * states of interest and the corresponding handler. When a state of interest occurs, the handler will be executed. + * - You can adjust the UI style based on the current state within the callback. If this API is called multiple + * times on the same node, the last set of states and handler will take precedence. + * - Some component types have default system handling for certain states. For example, the Button + * component has a default style effect for the PRESSED state. When custom state handling is implemented on such + * components, the default style effect will be applied first, followed by the custom style changes, resulting in + * a combined effect. To disable the default style effects, set excludeInner to true, if this is allowed + * by the system implementation. + * - And when this API is called, the provided handler function will be executed immediately. + * - There is no need to explicitly register a listener for the NORMAL state. Once a non-NORMAL state is registered, + * the system will automatically notify your application when the state changes back to NORMAL. + * + * @param node Target node. + * @param uiStates Target UI states to be handled on the node. + * The combined result of all target UI states can be calculated using the | operator. + * Example: targetUIStates = ArkUI_UIState::PRESSED | ArkUI_UIState::FOCUSED. + * @param statesChangeHandler Handler for UI state changes. + * It returns the current UI status. The value is the result of combining all current state enum values using the + * | operator. You can determine the state using the & operator. + * Example: if (currentStates & ArkUI_UIState::PRESSED == ArkUI_UIState::PRESSED) + * However, for checking the normal state, use the equality operator directly. + * Example: if (currentStates == ArkUI_UIState::NORMAL). + * @param excludeInner Whether to disable the default state styles. + * @param userData Custom data used in the onDrawCompleted callback. + * @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 20 + */ +ArkUI_ErrorCode OH_ArkUI_AddSupportedUIStates(ArkUI_NodeHandle node, int32_t uiStates, + void (statesChangeHandler)(int32_t currentStates, void* userData), bool excludeInner, void* userData); + +/** + * @brief Removes registered UI states. When all states registered using OH_ArkUI_AddSupportedUIStates + * are removed, the registered stateChangeHandler will no longer be executed. + * + * @param node Target node. + * @param uiStates Target UI states to be removed. + * @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 20 + */ +ArkUI_ErrorCode OH_ArkUI_RemoveSupportedUIStates(ArkUI_NodeHandle node, int32_t uiStates); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index d47237099..5ab1c6c47 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2586,6 +2586,28 @@ typedef enum { ARKUI_LAZY_EXPAND = 2, } ArkUI_ExpandMode; +/** + * @brief Defines the navigation point indicator style of the component. + * @brief Enumerates the UI states of a component, used for handling state-specific styles. + * + * @since 20 + */ +typedef enum { + /** Normal state. */ + UI_STATE_NORMAL = 0, + /** Pressed state. */ + UI_STATE_PRESSED = 1 << 0, + /** Focused state. */ + UI_STATE_FOCUSED = 1 << 1, + /** Disabled state. */ + UI_STATE_DISABLED = 1 << 2, + /** + * Selected state. This state is supported only by specific component types: + * Checkbox, Radio, Toggle, List, Grid, and MenuItem. + */ + UI_STATE_SELECTED = 1 << 3, +} ArkUI_UIState; + /** * @brief Defines parameter used by the system font style callback event. * -- Gitee From fb83cb86ec4712ed72a5d59292c76d0f6154e243 Mon Sep 17 00:00:00 2001 From: liukaii Date: Fri, 18 Apr 2025 13:18:19 +0800 Subject: [PATCH 19/35] ban Signed-off-by: liukaii Change-Id: I8e77c2e1fc8098979ebc033b31d6a56c86ac071a --- arkui/ace_engine/native/drag_and_drop.h | 25 +++++++++++++++++++++++++ arkui/ace_engine/native/libace.ndk.json | 4 ++++ 2 files changed, 29 insertions(+) diff --git a/arkui/ace_engine/native/drag_and_drop.h b/arkui/ace_engine/native/drag_and_drop.h index 38e49caad..76b0b1bea 100644 --- a/arkui/ace_engine/native/drag_and_drop.h +++ b/arkui/ace_engine/native/drag_and_drop.h @@ -884,6 +884,31 @@ int32_t OH_ArkUI_NotifyDragResult(int32_t requestIdentify, ArkUI_DragResult resu */ int32_t OH_ArkUI_NotifyDragEndPendingDone(int32_t requestIdentify); +/** + * @brief Sets whether to enable the display of a disallow status icon. + * + * Typically, when a component can receive or process data dragged by the user, or when it declares to the + * system that data should be processed in COPY way by setting ARKUI_DROP_OPERATION_COPY through + * {@link OH_ArkUI_DragEvent_SetSuggestedDropOperation}, the system will display + * a plus sign together with the data number on the upper-left corner of the dragged object; if setting + * ARKUI_DROP_OPERATION_MOVE to the system to declare that data should be processed in CUT way, the system will only + * display the data number on the upper-left corner of the dragged object. + * + * In some cases, when the system determines or the component explicitly declares that it cannot handle the + * data that the user is dragging, the system displays a badge icon in the same way as it does for DragBehavior.MOVE. + * So if you want to show the more clearly status, you can call this method on the UI instance in advance to force + * the system to display a clear prohibition icon on the upper left corner in such cases, and the user can clearly + * know that data cannot be dropped here. + * + * @param uiContext Pointer to a UI instance. + * @param enabled Whether to enable the display of the disallow badge icon. + * @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 20 + */ +int32_t OH_ArkUI_EnableDropDisallowedBadge(ArkUI_ContextHandle uiContext, bool enabled); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index c80fc0750..00b92e9fd 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3027,6 +3027,10 @@ "first_introduced": "18", "name": "OH_ArkUI_NotifyDragEndPendingDone" }, + { + "first_introduced": "20", + "name": "OH_ArkUI_EnableDropDisallowedBadge" + }, { "first_introduced": "18", "name": "OH_ArkUI_GestureInterrupter_GetUserData" -- Gitee From 1a392f92cc92e08032ece7a3bcc88c60b08e806b Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 22 Apr 2025 14:10:30 +0000 Subject: [PATCH 20/35] avrecorder supports aac file format Signed-off-by: Steven --- multimedia/player_framework/avrecorder_base.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multimedia/player_framework/avrecorder_base.h b/multimedia/player_framework/avrecorder_base.h index 4e668f781..561e24f98 100644 --- a/multimedia/player_framework/avrecorder_base.h +++ b/multimedia/player_framework/avrecorder_base.h @@ -125,6 +125,11 @@ typedef enum OH_AVRecorder_ContainerFormatType { AVRECORDER_CFT_MP3 = 9, /* An audio container format type wav. */ AVRECORDER_CFT_WAV = 10, + /** + * @brief A audio container format type aac with ADTS. + * @since 20 + */ + AVRECORDER_CFT_AAC = 11, } OH_AVRecorder_ContainerFormatType; /** -- Gitee From 2268937cc9393132f5bad76ce85c7ffb643d4063 Mon Sep 17 00:00:00 2001 From: wangweiyuan Date: Sat, 19 Apr 2025 19:12:02 +0800 Subject: [PATCH 21/35] =?UTF-8?q?Text=E6=8E=A7=E4=BB=B6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E8=A1=8C=E5=B0=BE=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangweiyuan --- arkui/ace_engine/native/native_node.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index edf6df2dd..0d0a0a121 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -2359,6 +2359,21 @@ typedef enum { * @since 20 */ NODE_TEXT_LINE_COUNT = 1031, + + /** + * @brief Sets whether to optimize the trailing spaces at the end of each line during text layout. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * value[0].i32: whether to optimize trailing spaces at the end of each line during text layout. + * The default value is false. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * value[0].i32: whether to optimize trailing spaces at the end of each line during text layout. \n + * + * @since 20 + */ + NODE_TEXT_OPTIMIZE_TRAILING_SPACE = 1032, /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. -- Gitee From 7b8ac542e4de2170d6b6176986b7386ed16449e5 Mon Sep 17 00:00:00 2001 From: 18795846185 Date: Wed, 9 Apr 2025 13:48:48 +0800 Subject: [PATCH 22/35] resource dir Signed-off-by: 18795846185 --- .../ability_runtime/application_context.h | 18 ++++++++++++++++++ .../libability_runtime.ndk.json | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index bb39d5978..ed62cf402 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -213,6 +213,24 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetDistributedFiles AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCloudFileDir( char* buffer, const int32_t bufferSize, int32_t* writeLength); +/** + * @brief Obtain the resource directory of the target module. + * + * @param moduleName The module name. + * @param buffer A pointer to a buffer that receives the resource directory of the target module. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 20 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir(const char* moduleName, + char* buffer, const int32_t bufferSize, int32_t* writeLength); + /** * @brief Starts self UIAbility. * diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index 3ae8eaeee..6790d7d68 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -174,5 +174,9 @@ { "first_introduced": "17", "name": "OH_AbilityRuntime_GetStartOptionsMaxWindowHeight" + }, + { + "first_introduced": "20", + "name": "OH_AbilityRuntime_ApplicationContextGetResourceDir" } ] \ No newline at end of file -- Gitee From 21f78bb51db71531923929a615aae19c791109c3 Mon Sep 17 00:00:00 2001 From: yangbiao199318 Date: Mon, 14 Apr 2025 11:24:20 +0800 Subject: [PATCH 23/35] =?UTF-8?q?dialog=E7=8A=B6=E6=80=81=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2capi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangbiao199318 --- arkui/ace_engine/native/native_dialog.h | 59 +++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 5de204ab4..42fb45feb 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. * @@ -303,6 +349,7 @@ typedef struct { * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. */ int32_t (*close)(ArkUI_NativeDialogHandle handle); + /** * @brief Registers a listener for the dismiss event of the custom dialog box. * @@ -315,6 +362,18 @@ typedef struct { */ int32_t (*registerOnWillDismissWithUserData)( ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(ArkUI_DialogDismissEvent* event)); + + /** + * @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 (*getState)(ArkUI_NativeDialogHandle handle, ArkUI_DialogState* state); } ArkUI_NativeDialogAPI_1; /** -- Gitee From 8249134baf9ab9fdb72f29a313bffb8ca02e5fd5 Mon Sep 17 00:00:00 2001 From: mobHot Date: Sun, 20 Apr 2025 20:58:15 +0800 Subject: [PATCH 24/35] add the support for trimming line end space Signed-off-by: mobHot Change-Id: Ie9ed8598790afff270517980b095e260e3e1ed75 --- .../native_drawing/drawing_text_typography.h | 12 ++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 966621728..c6f3c2d54 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -2899,6 +2899,18 @@ void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle* style, OH_Drawi */ size_t OH_Drawing_GetDrawingArraySize(OH_Drawing_Array* drawingArray); +/** + * @brief Sets whether to optimize whitespace at the end of each line for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param trailingSpaceOptimized Boolean value indicating whether to optimize whitespace at the end of each line + * for text typography to set. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextTrailingSpaceOptimized(OH_Drawing_TypographyStyle* style, bool trailingSpaceOptimized); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 3af5dfe2e..5f661fe58 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1817,5 +1817,9 @@ { "first_introduced": "18", "name": "OH_Drawing_CanvasDrawPixelMapNine" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_SetTypographyTextTrailingSpaceOptimized" } ] \ No newline at end of file -- Gitee From 2e59711f8c5847c3d1f1ad327b4ac7755eeffdb4 Mon Sep 17 00:00:00 2001 From: sunyaozu Date: Fri, 25 Apr 2025 10:49:09 +0800 Subject: [PATCH 25/35] add ubrk_setUText interface Signed-off-by: sunyaozu --- third_party/icu4c/libicu.ndk.json | 4 ++++ third_party/icu4c/ndk_headers/unicode/ubrk.h | 23 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/third_party/icu4c/libicu.ndk.json b/third_party/icu4c/libicu.ndk.json index 40397f053..42149b48e 100644 --- a/third_party/icu4c/libicu.ndk.json +++ b/third_party/icu4c/libicu.ndk.json @@ -187,6 +187,10 @@ "first_introduced": "12", "name":"ubrk_setText" }, + { + "first_introduced": "20", + "name":"ubrk_setUText" + }, { "first_introduced": "12", "name":"ubrk_current" diff --git a/third_party/icu4c/ndk_headers/unicode/ubrk.h b/third_party/icu4c/ndk_headers/unicode/ubrk.h index 9724bcf56..98a27959a 100644 --- a/third_party/icu4c/ndk_headers/unicode/ubrk.h +++ b/third_party/icu4c/ndk_headers/unicode/ubrk.h @@ -12,6 +12,7 @@ #include "unicode/utypes.h" #include "unicode/uloc.h" +#include "unicode/utext.h" #if U_SHOW_CPLUSPLUS_API #include "unicode/localpointer.h" @@ -338,6 +339,28 @@ ubrk_setText(UBreakIterator* bi, int32_t textLength, UErrorCode* status); +/** + * Sets an existing iterator to point to a new piece of text. + * + * All index positions returned by break iterator functions are + * native indices from the UText. For example, when breaking UTF-8 + * encoded text, the break positions returned by \ref ubrk_next, \ref ubrk_previous, etc. + * will be UTF-8 string indices, not UTF-16 positions. + * + * @param bi The iterator to use + * @param text The text to be set. + * This function makes a shallow clone of the supplied UText. This means + * that the caller is free to immediately close or otherwise reuse the + * UText that was passed as a parameter, but that the underlying text itself + * must not be altered while being referenced by the break iterator. + * @param status The error code + * @stable ICU 3.4 + */ +U_CAPI void U_EXPORT2 +ubrk_setUText(UBreakIterator* bi, + UText* text, + UErrorCode* status); + /** * Determine the most recently-returned text boundary. * -- Gitee From 27da9990d726742c840f0bc7b212346f05df7ca1 Mon Sep 17 00:00:00 2001 From: ZY_encoder Date: Wed, 23 Apr 2025 22:07:45 +0800 Subject: [PATCH 26/35] Support high contrast setting on APP Signed-off-by: ZY_encoder --- graphic/graphic_2d/native_drawing/BUILD.gn | 2 + .../native_drawing/drawing_text_global.h | 76 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 + 3 files changed, 82 insertions(+) create mode 100644 graphic/graphic_2d/native_drawing/drawing_text_global.h diff --git a/graphic/graphic_2d/native_drawing/BUILD.gn b/graphic/graphic_2d/native_drawing/BUILD.gn index 88c0459bc..884354659 100644 --- a/graphic/graphic_2d/native_drawing/BUILD.gn +++ b/graphic/graphic_2d/native_drawing/BUILD.gn @@ -57,6 +57,7 @@ ohos_ndk_headers("native_drawing_header") { "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_typography.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_typeface.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_types.h", + "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_global.h" ] } @@ -106,5 +107,6 @@ ohos_ndk_library("libnative_drawing_ndk") { "native_drawing/drawing_text_typography.h", "native_drawing/drawing_typeface.h", "native_drawing/drawing_types.h", + "native_drawing/drawing_text_global.h" ] } diff --git a/graphic/graphic_2d/native_drawing/drawing_text_global.h b/graphic/graphic_2d/native_drawing/drawing_text_global.h new file mode 100644 index 000000000..7a7493c94 --- /dev/null +++ b/graphic/graphic_2d/native_drawing/drawing_text_global.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Drawing + * @{ + * + * @brief Provides the global text capability. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * + * @since 20 + * @version 1.0 + */ + +/** + * @file drawing_text_global.h + * + * @brief Declares functions related to run in the drawing module. + * + * @kit ArkGraphics2D + * @library libnative_drawing.so + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @since 20 + * @version 1.0 + */ + +#ifndef DRAWING_TEXT_GLOBAL_H +#define DRAWING_TEXT_GLOBAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Defines text rendering high contrast mode to enhance readability. + * @since 20 + * @version 1.0 + */ +typedef enum { + /** Follow system's high contrast settings for text rendering */ + TEXT_FOLLOW_SYSTEM_HIGH_CONTRAST, + /** Disable high contrast rendering regardless of system settings */ + TEXT_APP_DISABLE_HIGH_CONTRAST, + /** Enable high contrast rendering regardless of system settings */ + TEXT_APP_ENABLE_HIGH_CONTRAST +} OH_Drawing_TextHighContrast; + + +/** + * @brief Sets high contrast mode of text rendering. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param action OH_Drawing_TextHighContrast object. + * @since 20 + */ +void OH_Drawing_SetTextHighContrast(OH_Drawing_TextHighContrast action); + +#ifdef __cplusplus +} +#endif +#endif // DRAWING_TEXT_GLOBAL_H + +/** @} */ \ No newline at end of file diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 3af5dfe2e..892d5f62f 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1817,5 +1817,9 @@ { "first_introduced": "18", "name": "OH_Drawing_CanvasDrawPixelMapNine" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_SetTextHighContrast" } ] \ No newline at end of file -- Gitee From 5debe51b649be66f68b6364f9f3bbcfdacccd5c5 Mon Sep 17 00:00:00 2001 From: liufei Date: Mon, 21 Apr 2025 16:26:26 +0800 Subject: [PATCH 27/35] feat(typography): add function to handle encoded text - Add new function OH_Drawing_TypographyHandlerAddEncodedText to support UTF-8, UTF-16, and UTF-32 text formats - Enhance text handling capabilities of the OH_Drawing_TypographyCreate object - Update API documentation to include new function description Signed-off-by: liufei --- .../native_drawing/drawing_text_typography.h | 14 ++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index c6f3c2d54..9052c1697 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -975,6 +975,20 @@ void OH_Drawing_TypographyHandlerPushTextStyle(OH_Drawing_TypographyCreate* hand */ void OH_Drawing_TypographyHandlerAddText(OH_Drawing_TypographyCreate* handler, const char* text); +/** + * @brief Sets the text content. The content supports UTF-8, UTF-16, and UTF-32 formats. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param text Indicates the pointer to the text content to set. + * @param byteLength Set the byte length of the text content. + * @param textEncodingType Indicates the text encoding type OH_Drawing_TextEncoding. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_TypographyHandlerAddEncodedText(OH_Drawing_TypographyCreate* handler, const void* text, + size_t byteLength, OH_Drawing_TextEncoding textEncodingType); + /** * @brief Removes the topmost style in the stack, leaving the remaining styles in effect. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 786bf22fb..5076d9588 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1825,5 +1825,9 @@ { "first_introduced": "20", "name": "OH_Drawing_SetTextHighContrast" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_TypographyHandlerAddEncodedText" } ] \ No newline at end of file -- Gitee From b24abd43f3c4278f965425374b85ba458e5aef0a Mon Sep 17 00:00:00 2001 From: lixiaoxiang Date: Thu, 17 Apr 2025 11:59:10 +0800 Subject: [PATCH 28/35] add newDrawingCInterface Signed-off-by: lixiaoxiang --- .../native_drawing/drawing_matrix.h | 11 ++++ .../graphic_2d/native_drawing/drawing_path.h | 57 +++++++++++++++++++ .../native_drawing/drawing_region.h | 11 ++++ .../native_drawing/drawing_round_rect.h | 11 ++++ .../native_drawing/libnative_drawing.ndk.json | 28 +++++++++ 5 files changed, 118 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_matrix.h b/graphic/graphic_2d/native_drawing/drawing_matrix.h index bbf6645df..5b6fc1f66 100644 --- a/graphic/graphic_2d/native_drawing/drawing_matrix.h +++ b/graphic/graphic_2d/native_drawing/drawing_matrix.h @@ -57,6 +57,17 @@ extern "C" { */ OH_Drawing_Matrix* OH_Drawing_MatrixCreate(void); +/** + * @brief Creates an OH_Drawing_Matrix copy object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @return Returns the pointer to the OH_Drawing_Matrix object created. + * @since 20 + * @version 1.0 + */ +OH_Drawing_Matrix* OH_Drawing_MatrixCopy(const OH_Drawing_Matrix* matrix); + /** * @brief Creates an OH_Drawing_Matrix object with rotation. Sets matrix to * rotate by degrees about a pivot point at (px, py). diff --git a/graphic/graphic_2d/native_drawing/drawing_path.h b/graphic/graphic_2d/native_drawing/drawing_path.h index a198ec855..713456d67 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path.h +++ b/graphic/graphic_2d/native_drawing/drawing_path.h @@ -171,6 +171,49 @@ OH_Drawing_Path* OH_Drawing_PathCopy(OH_Drawing_Path* path); */ void OH_Drawing_PathDestroy(OH_Drawing_Path* path); +/** + * @brief Sets OH_Drawing_Path object with the same content of another. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param other Indicates the pointer to an OH_Drawing_Path object to copy content from. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if path or other is nullptr. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_PathSetPath(OH_Drawing_Path* path, OH_Drawing_Path* other); + +/** + * @brief Checks if OH_Drawing_Path object is empty. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param isEmpty Indicates the return value. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if path or isEmpty is nullptr. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_PathIsEmpty(OH_Drawing_Path* path, bool* isEmpty); + +/** + * @brief Checks if OH_Drawing_Path represents a rectangle. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param rect Indicates the Pointer to an OH_Drawing_Rect object. + * @param isRect Indicates the return value. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if path or isRect is nullptr. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_PathIsRect(OH_Drawing_Path* path, OH_Drawing_Rect* rect, bool* isRect); + /** * @brief Sets the start point of a path. * @@ -569,6 +612,20 @@ void OH_Drawing_PathTransformWithPerspectiveClip(OH_Drawing_Path* src, const OH_ */ void OH_Drawing_PathSetFillType(OH_Drawing_Path* path, OH_Drawing_PathFillType pathFillType); +/** + * @brief Gets FillType, the rule used to fill path. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param pathFillType Indicates the FillType apply to path. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if path or pathFillType is nullptr. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_PathGetFillType(OH_Drawing_Path* path, OH_Drawing_PathFillType* pathFillType); + /** * @brief Gets the length of the current path object. * diff --git a/graphic/graphic_2d/native_drawing/drawing_region.h b/graphic/graphic_2d/native_drawing/drawing_region.h index ea27f3bce..a73a71fe8 100644 --- a/graphic/graphic_2d/native_drawing/drawing_region.h +++ b/graphic/graphic_2d/native_drawing/drawing_region.h @@ -89,6 +89,17 @@ typedef enum { */ OH_Drawing_Region* OH_Drawing_RegionCreate(void); +/** + * @brief Creates an OH_Drawing_Region copy object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param region Indicates the pointer to an OH_Drawing_Region object to copy. + * @return Returns the pointer to the OH_Drawing_Region object created. + * @since 20 + * @version 1.0 + */ +OH_Drawing_Region* OH_Drawing_RegionCopy(const OH_Drawing_Region* region); + /** * @brief Determines whether the region contains the specified coordinates. * diff --git a/graphic/graphic_2d/native_drawing/drawing_round_rect.h b/graphic/graphic_2d/native_drawing/drawing_round_rect.h index e3dec061f..f675f1ab5 100644 --- a/graphic/graphic_2d/native_drawing/drawing_round_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_round_rect.h @@ -85,6 +85,17 @@ typedef enum { */ OH_Drawing_RoundRect* OH_Drawing_RoundRectCreate(const OH_Drawing_Rect* rect, float xRad, float yRad); +/** + * @brief Creates an OH_Drawing_RoundRect copy object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param roundRect Indicates the pointer to an OH_Drawing_RoundRect object to copy. + * @return Returns the pointer to the OH_Drawing_RoundRect object created. + * @since 20 + * @version 1.0 + */ +OH_Drawing_RoundRect* OH_Drawing_RoundRectCopy(const OH_Drawing_RoundRect* roundRect); + /** * @brief Sets the radiusX and radiusY for a specific corner position. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 3af5dfe2e..85eb6285f 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -360,6 +360,10 @@ }, { "name": "OH_Drawing_MaskFilterCreateBlur" }, { "name": "OH_Drawing_MaskFilterDestroy" }, + { + "first_introduced": "20", + "name": "OH_Drawing_MatrixCopy" + }, { "name": "OH_Drawing_MatrixCreate" }, { "name": "OH_Drawing_MatrixCreateRotation" }, { "name": "OH_Drawing_MatrixCreateScale" }, @@ -531,6 +535,22 @@ "first_introduced": "12", "name": "OH_Drawing_PathGetMatrix" }, + { + "first_introduced": "20", + "name": "OH_Drawing_PathGetFillType" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_PathIsEmpty" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_PathIsRect" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_PathSetPath" + }, { "first_introduced": "12", "name": "OH_Drawing_PenCopy" @@ -669,6 +689,10 @@ "first_introduced": "12", "name": "OH_Drawing_RoundRectGetCorner" }, + { + "first_introduced": "20", + "name": "OH_Drawing_RoundRectCopy" + }, { "first_introduced": "12", "name": "OH_Drawing_RoundRectSetCorner" @@ -1206,6 +1230,10 @@ "first_introduced": "12", "name": "OH_Drawing_RegionCreate" }, + { + "first_introduced": "20", + "name": "OH_Drawing_RegionCopy" + }, { "first_introduced": "12", "name": "OH_Drawing_RegionContains" -- Gitee From 3566708bd767fc3cb8cc6fbd7d758c9ff8cd53e4 Mon Sep 17 00:00:00 2001 From: ShortMessage Date: Mon, 28 Apr 2025 17:53:12 +0800 Subject: [PATCH 29/35] =?UTF-8?q?UDMF=E6=96=B0=E5=A2=9E=E9=80=9A=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ShortMessage --- distributeddatamgr/udmf/include/udmf.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index 171f4ca52..286723b23 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -68,6 +68,30 @@ typedef enum Udmf_Intention { * @brief The intention is pasteboard. */ UDMF_INTENTION_PASTEBOARD, + /** + * @brief The intention is data hub. + * + * @since 20 + */ + UDMF_INTENTION_DATA_HUB, + /** + * @brief The intention is system share. + * + * @since 20 + */ + UDMF_INTENTION_SYSTEM_SHARE, + /** + * @brief The intention is picker. + * + * @since 20 + */ + UDMF_INTENTION_PICKER, + /** + * @brief The intention is menu. + * + * @since 20 + */ + UDMF_INTENTION_MENU, } Udmf_Intention; /** -- Gitee From e1759a2523c1e7045a52ec5bdacc4e7cc89b53dd Mon Sep 17 00:00:00 2001 From: liyongzhuang Date: Tue, 29 Apr 2025 02:33:50 +0000 Subject: [PATCH 30/35] ndk jsb Signed-off-by: liyongzhuang --- .../interfaces/native/libohweb.ndk.json | 4 ++++ .../native/native_interface_arkweb.h | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/web/webview/interfaces/native/libohweb.ndk.json b/web/webview/interfaces/native/libohweb.ndk.json index 4981b04a4..aa5489f4a 100644 --- a/web/webview/interfaces/native/libohweb.ndk.json +++ b/web/webview/interfaces/native/libohweb.ndk.json @@ -322,5 +322,9 @@ { "first_introduced": "18", "name": "OH_ArkWeb_RegisterScrollCallback" + }, + { + "first_introduced": "20", + "name": "OH_NativeArkWeb_RegisterAsyncThreadJavaScriptProxy" } ] diff --git a/web/webview/interfaces/native/native_interface_arkweb.h b/web/webview/interfaces/native/native_interface_arkweb.h index 9f8127988..333bd2085 100644 --- a/web/webview/interfaces/native/native_interface_arkweb.h +++ b/web/webview/interfaces/native/native_interface_arkweb.h @@ -36,6 +36,7 @@ #include #include "arkweb_error_code.h" +#include "arkweb_type.h" #ifdef __cplusplus extern "C" { @@ -185,6 +186,23 @@ ArkWeb_ErrorCode OH_NativeArkWeb_LoadData(const char* webTag, const char* baseUrl, const char* historyUrl); +/** + * @brief Register a JavaScript object with callback methods, which may return values. This object will be injected + * into all frames of the current page, including all iframes, and will be accessible using the specified + * name in ArkWeb_ProxyObjectWithResult. The object will only be available in JavaScript after the next + * load or reload. + * These methods will be executed in the ArkWeb worker thread. + * + * @param webTag The name of the web component. + * @param proxyObject The JavaScript object to register, the object has callback functions with return value. + * @param permission The JSON string, which defaults to null, is used to configure the permission control for + * JSBridge, allowing for the definition of URL whitelists at the object and method levels. + * + * @since 20 + */ +void OH_NativeArkWeb_RegisterAsyncThreadJavaScriptProxy(const char* webTag, + const ArkWeb_ProxyObjectWithResult* proxyObject, const char* permission); + #ifdef __cplusplus }; #endif -- Gitee From af0ab11ae9c7629f1a9daa89f38ab73084fd0f15 Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Tue, 22 Apr 2025 18:35:51 +0800 Subject: [PATCH 31/35] textArea and textInput add CAPI Signed-off-by: wangxiuxiu96 Change-Id: I9cc115fdb62a12c561c250a3582ba52eb4342da0 --- arkui/ace_engine/native/native_node.h | 79 +++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index edf6df2dd..24d6ebc8f 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3167,6 +3167,20 @@ typedef enum { */ NODE_TEXT_INPUT_KEYBOARD_APPEARANCE = 7035, + /** + * @brief Set the line height of the input node. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: line height value. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}: \n + * .value[0].i32: line height value. \n + * + * @since 20 + */ + NODE_TEXT_INPUT_LINE_HEIGHT = 7037, + /** * @brief Defines the default placeholder text for the multi-line text box. * This attribute can be set, reset, and obtained as required through APIs. @@ -3515,6 +3529,45 @@ typedef enum { */ NODE_TEXT_AREA_KEYBOARD_APPEARANCE = 8026, + /** + * @brief Set the max lines of the node. This attrilbute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: max lines count. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: max lines count. \n + * + * @since 20 + */ + NODE_TEXT_AREA_MAX_LINES = 8027, + + /** + * @brief Set line spacing of the node. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: line spacing value. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: line spacing value. \n + * + * @since 20 + */ + NODE_TEXT_AREA_LINE_SPACING = 8028, + + /** + * @brief Set the line height of the node. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: line height value. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}: \n + * .value[0].i32: line height value. \n + * + * @since 20 + */ + NODE_TEXT_AREA_LINE_HEIGHT = 8031, + /** * @brief Defines the button text content. This attribute can be set, reset, and obtained as required through APIs. * @@ -7012,6 +7065,19 @@ typedef enum { */ NODE_TEXT_INPUT_ON_CHANGE_WITH_PREVIEW_TEXT = 7013, + /** + * @brief Defines the event triggered before content changes. + * + * When the event callback occurs, the union type {@link ArkUI_NodeEvent} is {@link ArkUI_TextChangeEvent}. \n + * {@link ArkUI_TextChangeEvent} contains the following parameters: \n + * ArkUI_TextChangeEvent.pStr: content in the TextInput component. + * ArkUI_TextChangeEvent.pExtendStr: content of the preview text in the TextInput component. + * ArkUI_TextChangeEvent.number: start position of the preview text in the TextInput component. + * + * @since 20 + */ + NODE_TEXT_INPUT_ON_WILL_CHANGE = 7014, + /** * @brief Defines the event triggered when the input in the text box changes. * @@ -7178,6 +7244,19 @@ typedef enum { */ NODE_TEXT_AREA_ON_CHANGE_WITH_PREVIEW_TEXT = 8012, + /** + * @brief Defines the event triggered before content changes + * + * When the event callback occurs, the union type {@link ArkUI_NodeEvent} is {@link ArkUI_TextChangeEvent}. \n + * {@link ArkUI_TextChangeEvent} contains the following parameters: \n + * ArkUI_TextChangeEvent.pStr: content in the TextArea component. + * ArkUI_TextChangeEvent.pExtendStr: content of the preview text in the TextArea component. + * ArkUI_TextChangeEvent.number: start position of the preview text in the TextArea component. + * + * @since 20 + */ + NODE_TEXT_AREA_ON_WILL_CHANGE = 8013, + /** * @brief Defines the event triggered when the selected status of the ARKUI_NODE_CHECKBOX component changes. * -- Gitee From 5339771d0976014f2dd551d5ec2acd4df6493210 Mon Sep 17 00:00:00 2001 From: wpy88 Date: Wed, 30 Apr 2025 14:59:31 +0800 Subject: [PATCH 32/35] wrap key interface c Signed-off-by: wpy88 --- security/huks/include/native_huks_api.h | 72 +++++++++++++++++++++++- security/huks/include/native_huks_type.h | 23 ++++++++ 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/security/huks/include/native_huks_api.h b/security/huks/include/native_huks_api.h index 37d74511b..585031dde 100644 --- a/security/huks/include/native_huks_api.h +++ b/security/huks/include/native_huks_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -437,6 +437,76 @@ struct OH_Huks_Result OH_Huks_FinishSession(const struct OH_Huks_Blob *handle, struct OH_Huks_Result OH_Huks_AbortSession(const struct OH_Huks_Blob *handle, const struct OH_Huks_ParamSet *paramSet); +/** + * @brief Get key alias list. + * + * @param paramSet Indicates the pointer to the parameters required for getting key alias list. + * By default, this parameter is a null pointer. + * @param outData Indicates the pointer to the output data. + * @return {@link OH_Huks_ErrCode#OH_HUKS_SUCCESS} 0 - If the operation is successful. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 401 - If paramSet or outData is invalid. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INTERNAL_ERROR} 12000012 - If system error ocurred. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_COMMUNICATION_FAIL} 12000005 - If Ipc commuication failed. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INSUFFICIENT_MEMORY} 12000014 - If the memory is insufficient. + * @since 20 + */ +struct OH_Huks_Result OH_Huks_ListAliases(const struct OH_Huks_ParamSet *paramSet, + struct OH_Huks_KeyAliasSet **outData); + +/** + * @brief Export the wrapped key encrypted by a specific key. + * @param keyAlias Indicates the pointer to the alias of the key to export. + * @param paramSet Indicates the pointer to the export parameters. + * @param wrappedKey Indicates the - indicates the wrapped key to export. + * @return {@link OH_Huks_ErrCode#OH_HUKS_SUCCESS} 0 - If the operation is successful. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_NOT_SUPPORTED_API} 801 - api is not supported + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_MISSING_CRYPTO_ALG_ARGUMENT} 12000002 - If failed to + * get key argument. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INVALID_CRYPTO_ALG_ARGUMENT} 12000003 - If the key argument + * is invalid. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_FILE_OPERATION_FAIL} 12000004 - If failed to remove file, + * or if failed to write file. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_COMMUNICATION_FAIL} 12000005 - If Ipc commuication failed. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_CRYPTO_FAIL} 12000006 - If crypto engine failed. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INTERNAL_ERROR} 12000012 - If system error ocurred. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INSUFFICIENT_MEMORY} 12000014 - If the memory is insufficient. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 12000018 - If keyAlias or paramSet or wrappedKey is invalid. + * @since 20 + * @version 1.0 + */ + struct OH_Huks_Result OH_Huks_WrapKey(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSet, + struct OH_Huks_Blob *wrappedKey); + +/** + * @brief Import the wrapped key encrypted by a specific key. + * @param keyAlias Indicates the pointer to the alias of the key to import. + * The alias must be unique in the process of the service. Otherwise, the key will be overwritten. + * @param paramSet Indicates the pointer to the import parameters. + * @param wrappedKey Indicates the - indicates the wrapped key to import. + * @return {@link OH_Huks_ErrCode#OH_HUKS_SUCCESS} 0 - If the operation is successful. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_NOT_SUPPORTED_API} 801 - api is not supported + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_MISSING_CRYPTO_ALG_ARGUMENT} 12000002 - If failed to + * get key argument. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INVALID_CRYPTO_ALG_ARGUMENT} 12000003 - If the key argument + * is invalid. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_FILE_OPERATION_FAIL} 12000004 - If failed to remove file, + * or if failed to write file. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_COMMUNICATION_FAIL} 12000005 - If Ipc commuication failed. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_CRYPTO_FAIL} 12000006 - If crypto engine failed. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_KEY_AUTH_PERMANENTLY_INVALIDATED} 12000007 - If auth token info + * verify failed. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_KEY_AUTH_VERIFY_FAILED} 12000008 - If auth token verify failed. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_KEY_AUTH_TIME_OUT} 12000009 - If authentication token timed out. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INTERNAL_ERROR} 12000012 - If system error ocurred. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INSUFFICIENT_MEMORY} 12000014 - If the memory is insufficient. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_CALL_SERVICE_FAILED} 12000015 - If connect userIam failed. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 12000018 - If keyAlias or paramSet or wrappedKey is invalid. + * @since 20 + * @version 1.0 + */ +struct OH_Huks_Result OH_Huks_UnwrapKey(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSet, + const struct OH_Huks_Blob *wrappedKey); + #ifdef __cplusplus } #endif diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index b3c1838c9..3556182a2 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -451,6 +451,12 @@ enum OH_Huks_ErrCode { * @since 11 */ OH_HUKS_ERR_CODE_DEVICE_PASSWORD_UNSET = 12000016, + /** + * The input parameter is invalid. + * + * @since 20 + */ + OH_HUKS_ERR_CODE_INVALID_ARGUMENT = 12000018 }; /** @@ -488,6 +494,8 @@ enum OH_Huks_UserAuthType { OH_HUKS_USER_AUTH_TYPE_FACE = 1 << 1, /** PIN authentication. */ OH_HUKS_USER_AUTH_TYPE_PIN = 1 << 2, + /** TUI PIN authentication. */ + OH_HUKS_USER_AUTH_TYPE_TUI_PIN = 1 << 5, }; /** @@ -601,6 +609,21 @@ enum OH_Huks_SecureSignType { OH_HUKS_SECURE_SIGN_WITH_AUTHINFO = 1, }; +/** + * @brief Enumerates for key wrap type. + * + * @since 20 + * @version 1.0 + */ + enum OH_Huks_KeyWrapType { + /** + * The hardware unique key wrap type. + * + * @since 20 + */ + OH_HUKS_KEY_WRAP_TYPE_HUK_BASED = 2, +}; + /** * @brief Enumerates the tag values used in parameter sets. * -- Gitee From 090460d6a89465b2aeea17debdabaeb2f7f04b08 Mon Sep 17 00:00:00 2001 From: wpy88 Date: Wed, 30 Apr 2025 17:22:47 +0800 Subject: [PATCH 33/35] wrap key interface c 2 Signed-off-by: wpy88 --- security/huks/include/native_huks_api.h | 8 +++++--- security/huks/include/native_huks_type.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/security/huks/include/native_huks_api.h b/security/huks/include/native_huks_api.h index 585031dde..88ba1b37b 100644 --- a/security/huks/include/native_huks_api.h +++ b/security/huks/include/native_huks_api.h @@ -470,11 +470,12 @@ struct OH_Huks_Result OH_Huks_ListAliases(const struct OH_Huks_ParamSet *paramSe * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_CRYPTO_FAIL} 12000006 - If crypto engine failed. * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INTERNAL_ERROR} 12000012 - If system error ocurred. * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INSUFFICIENT_MEMORY} 12000014 - If the memory is insufficient. - * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 12000018 - If keyAlias or paramSet or wrappedKey is invalid. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 12000018 - If keyAlias or paramSet or wrappedKey is + * invalid. * @since 20 * @version 1.0 */ - struct OH_Huks_Result OH_Huks_WrapKey(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSet, +struct OH_Huks_Result OH_Huks_WrapKey(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSet, struct OH_Huks_Blob *wrappedKey); /** @@ -500,7 +501,8 @@ struct OH_Huks_Result OH_Huks_ListAliases(const struct OH_Huks_ParamSet *paramSe * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INTERNAL_ERROR} 12000012 - If system error ocurred. * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_INSUFFICIENT_MEMORY} 12000014 - If the memory is insufficient. * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_CALL_SERVICE_FAILED} 12000015 - If connect userIam failed. - * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 12000018 - If keyAlias or paramSet or wrappedKey is invalid. + * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 12000018 - If keyAlias or paramSet or wrappedKey is + * invalid. * @since 20 * @version 1.0 */ diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index 3556182a2..3e96a6a52 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -456,7 +456,7 @@ enum OH_Huks_ErrCode { * * @since 20 */ - OH_HUKS_ERR_CODE_INVALID_ARGUMENT = 12000018 + OH_HUKS_ERR_CODE_INVALID_ARGUMENT = 12000018 }; /** @@ -615,7 +615,7 @@ enum OH_Huks_SecureSignType { * @since 20 * @version 1.0 */ - enum OH_Huks_KeyWrapType { +enum OH_Huks_KeyWrapType { /** * The hardware unique key wrap type. * -- Gitee From b3ed9fdb5a715149aafa692621100bd3a76c59c5 Mon Sep 17 00:00:00 2001 From: z00544238 Date: Wed, 30 Apr 2025 17:20:29 +0800 Subject: [PATCH 34/35] =?UTF-8?q?6.0=20RDB=20NDK=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BB=93=E4=BB=A3=E7=A0=81=E5=90=88=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: z00544238 --- distributeddatamgr/relational_store/BUILD.gn | 26 +- .../relational_store/include/oh_predicates.h | 55 +++++ .../include/oh_rdb_crypto_param.h | 227 ++++++++++++++++++ .../include/oh_rdb_transaction.h | 60 +++++ .../include/relational_store.h | 189 +++++++++++++++ .../relational_store/libnative_rdb.ndk.json | 92 +++++++ 6 files changed, 637 insertions(+), 12 deletions(-) create mode 100644 distributeddatamgr/relational_store/include/oh_rdb_crypto_param.h diff --git a/distributeddatamgr/relational_store/BUILD.gn b/distributeddatamgr/relational_store/BUILD.gn index 560c94d4d..8e2ef44e0 100644 --- a/distributeddatamgr/relational_store/BUILD.gn +++ b/distributeddatamgr/relational_store/BUILD.gn @@ -20,6 +20,7 @@ ohos_ndk_headers("native_rdb_ndk_header") { sources = [ "./include/oh_cursor.h", "./include/oh_predicates.h", + "./include/oh_rdb_crypto_param.h", "./include/oh_rdb_transaction.h", "./include/oh_rdb_types.h", "./include/oh_value_object.h", @@ -46,17 +47,18 @@ ohos_ndk_library("libnative_rdb_ndk") { ndk_description_file = "./libnative_rdb.ndk.json" min_compact_version = "11" system_capability_headers = [ - "$ndk_headers_out_dir/database/data/data_asset.h", - "$ndk_headers_out_dir/database/data/oh_data_value.h", - "$ndk_headers_out_dir/database/data/oh_data_values.h", - "$ndk_headers_out_dir/database/data/oh_data_values_buckets.h", - "$ndk_headers_out_dir/database/rdb/oh_cursor.h", - "$ndk_headers_out_dir/database/rdb/oh_predicates.h", - "$ndk_headers_out_dir/database/rdb/oh_rdb_transaction.h", - "$ndk_headers_out_dir/database/rdb/oh_rdb_types.h", - "$ndk_headers_out_dir/database/rdb/oh_value_object.h", - "$ndk_headers_out_dir/database/rdb/oh_values_bucket.h", - "$ndk_headers_out_dir/database/rdb/relational_store.h", - "$ndk_headers_out_dir/database/rdb/relational_store_error_code.h", + "database/data/data_asset.h", + "database/data/oh_data_value.h", + "database/data/oh_data_values.h", + "database/data/oh_data_values_buckets.h", + "database/rdb/oh_cursor.h", + "database/rdb/oh_predicates.h", + "database/rdb/oh_rdb_crypto_param.h", + "database/rdb/oh_rdb_transaction.h", + "database/rdb/oh_rdb_types.h", + "database/rdb/oh_value_object.h", + "database/rdb/oh_values_bucket.h", + "database/rdb/relational_store.h", + "database/rdb/relational_store_error_code.h", ] } diff --git a/distributeddatamgr/relational_store/include/oh_predicates.h b/distributeddatamgr/relational_store/include/oh_predicates.h index 32d4e3e9e..47d0c4147 100644 --- a/distributeddatamgr/relational_store/include/oh_predicates.h +++ b/distributeddatamgr/relational_store/include/oh_predicates.h @@ -47,6 +47,7 @@ #include #include "database/rdb/oh_value_object.h" +#include "database/data/oh_data_values.h" #ifdef __cplusplus extern "C" { @@ -410,6 +411,60 @@ struct OH_Predicates { int (*destroy)(OH_Predicates *predicates); }; +/** + * @brief Sets the OH_Predicates to match the field whose data type is string and value is not like the specified value. + * This method is similar to "Not like" of the SQL statement. + * + * @param predicates Represents a pointer to an instance of OH_Predicates. + * @param field Indicates the column name in the database table. + * @param pattern Indicates the value to compare against. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 +*/ +int OH_Predicates_NotLike(OH_Predicates *predicates, const char *field, const char *pattern); + +/** + * @brief Sets the OH_Predicates to match the specified field whose data type is string and the value contains + * a wildcard. Different from like, the input parameters of this method are case-sensitive. + * + * @param predicates Represents a pointer to an instance of OH_Predicates. + * @param field Indicates the column name in the database table. + * @param pattern Indicates the value to match with the predicate. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 +*/ +int OH_Predicates_Glob(OH_Predicates *predicates, const char *field, const char *pattern); + +/** + * @brief Sets the OH_Predicates to not match the specified field whose data type is string and the value contains + * a wildcard. Different from not like, the input parameters of this method are case-sensitive. + * + * @param predicates Represents a pointer to an instance of OH_Predicates. + * @param field Indicates the column name in the database table. + * @param pattern Indicates the value to compare against. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 +*/ +int OH_Predicates_NotGlob(OH_Predicates *predicates, const char *field, const char *pattern); + +/** + * @brief Sets the OH_Predicates to specify conditions to filter grouped results that will appear in the final result. + * + * @param predicates Represents a pointer to an instance of OH_Predicates. + * @param conditions Indicates filter conditions in the having clause. + * @param values Indicates a pointer to an instance of OH_Data_Values. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 +*/ +int OH_Predicates_Having(OH_Predicates *predicates, const char *conditions, const OH_Data_Values *values); #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/relational_store/include/oh_rdb_crypto_param.h b/distributeddatamgr/relational_store/include/oh_rdb_crypto_param.h new file mode 100644 index 000000000..10921ae89 --- /dev/null +++ b/distributeddatamgr/relational_store/include/oh_rdb_crypto_param.h @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup RDB + * @{ + * + * @brief The relational database (RDB) store manages data based on relational models. + * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases. + * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations + * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. + * + * @since 10 + */ + +/** + * @file oh_rdb_crypto_param.h + * + * @brief Provides functions and enumerations related to cryptographic parameters of the relational database. + * + * @kit ArkData + * @library libnative_rdb_ndk.z.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * + * @since 20 + */ + +#ifndef OH_RDB_CRYPTO_PARAM_H +#define OH_RDB_CRYPTO_PARAM_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the database encryption algorithms. + * + * @since 20 + */ +typedef enum Rdb_EncryptionAlgo { + /** + * @brief Indicates the database is encrypted using RDB_AES_256_GCM. + * + * @since 20 + */ + RDB_AES_256_GCM = 0, + /** + * @brief Indicates the database is encrypted using RDB_AES_256_CBC. + * + * @since 20 + */ + RDB_AES_256_CBC, +} Rdb_EncryptionAlgo; + +/** + * @brief Enumerates the supported HMAC algorithm when opening a database. + * + * @since 20 + */ +typedef enum Rdb_HmacAlgo { + /** + * @brief RDB_HMAC_SHA1 algorithm. + * + * @since 20 + */ + RDB_HMAC_SHA1 = 0, + /** + * @brief RDB_HMAC_SHA256 algorithm. + * + * @since 20 + */ + RDB_HMAC_SHA256, + /** + * @brief RDB_HMAC_SHA512 algorithm. + * + * @since 20 + */ + RDB_HMAC_SHA512, +} Rdb_HmacAlgo; + +/** + * @brief Enumerates the supported KDF algorithm when opening a database. + * + * @since 20 + */ +typedef enum Rdb_KdfAlgo { + /** + * @brief RDB_KDF_SHA1 algorithm. + * + * @since 20 + */ + RDB_KDF_SHA1 = 0, + /** + * @brief RDB_KDF_SHA256 algorithm. + * + * @since 20 + */ + RDB_KDF_SHA256, + /** + * @brief RDB_KDF_SHA512 algorithm. + * + * @since 20 + */ + RDB_KDF_SHA512, +} Rdb_KdfAlgo; + +/** + * @brief Specifies the cryptographic parameters used when opening an encrypted database. + * + * @since 20 + */ +typedef struct OH_Rdb_CryptoParam OH_Rdb_CryptoParam; + +/** + * @brief Creates an OH_Rdb_CryptoParam instance object. + * + * @return Returns a pointer to OH_Rdb_CryptoParam instance when the execution is successful. + * Otherwise, nullptr is returned. The memory must be released through the OH_Rdb_DestroyCryptoParam + * interface after the use is complete. + * @see OH_Rdb_DestroyCryptoParam. + * @since 20 + */ +OH_Rdb_CryptoParam *OH_Rdb_CreateCryptoParam(void); + +/** + * @brief Destroys an OH_Rdb_CryptoParam instance object. + * + * @param param Represents a pointer to an instance of OH_Rdb_CryptoParam. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Rdb_DestroyCryptoParam(OH_Rdb_CryptoParam *param); + +/** + * @brief Sets key data to the OH_Rdb_CryptoParam object. + * + * @param param Represents a pointer to an instance of OH_Rdb_CryptoParam. + * @param key Represents a pointer to array data. + * @param length Represents the size of key array. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Crypto_SetEncryptionKey(OH_Rdb_CryptoParam *param, const uint8_t *key, int32_t length); + +/** + * @brief Sets the number of KDF iterations used when opening an encrypted database. + * + * @param param Represents a pointer to an instance of OH_Rdb_CryptoParam. + * @param iteration Represents iterations times. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Crypto_SetIteration(OH_Rdb_CryptoParam *param, int64_t iteration); + +/** + * @brief Sets the encryption algorithm when opening an encrypted database. + * + * @param param Represents a pointer to an instance of OH_Rdb_CryptoParam. + * @param algo Represents the encryption algorithm. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Crypto_SetEncryptionAlgo(OH_Rdb_CryptoParam *param, int32_t algo); + +/** + * @brief Sets the HMAC algorithm when opening an encrypted database. + * + * @param param Represents a pointer to an instance of OH_Rdb_CryptoParam. + * @param algo Represents the HMAC algorithm. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Crypto_SetHmacAlgo(OH_Rdb_CryptoParam *param, int32_t algo); + +/** + * @brief Sets the KDF algorithm when opening an encrypted database. + * + * @param param Represents a pointer to an instance of OH_Rdb_CryptoParam. + * @param algo Represents the KDF algorithm. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Crypto_SetKdfAlgo(OH_Rdb_CryptoParam *param, int32_t algo); + +/** + * @brief Sets the page size used when opening an encrypted database. + * + * @param param Represents a pointer to an instance of OH_Rdb_CryptoParam. + * @param size Represents the page size. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Crypto_SetCryptoPageSize(OH_Rdb_CryptoParam *param, int64_t size); + +#ifdef __cplusplus +}; +#endif +#endif +/** @} */ diff --git a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h index 99cbfe20a..d1c71fb20 100644 --- a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h +++ b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h @@ -193,6 +193,36 @@ int OH_RdbTrans_Rollback(OH_Rdb_Transaction *trans); */ int OH_RdbTrans_Insert(OH_Rdb_Transaction *trans, const char *table, const OH_VBucket *row, int64_t *rowId); +/** + * @brief Inserts a row of data into the target table and support conflict resolution. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param table Represents the target table. + * @param row Represents the row data to be inserted into the table. + * @param resolution Represents the resolution when conflict occurs. + * @param rowId Represents row line number when insert successfully. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. + * @since 20 + */ +int OH_RdbTrans_InsertWithConflictResolution(OH_Rdb_Transaction *trans, const char *table, const OH_VBucket *row, + Rdb_ConflictResolution resolution, int64_t *rowId); + /** * @brief Inserts a batch of data into the target table. * @@ -251,6 +281,36 @@ int OH_RdbTrans_BatchInsert(OH_Rdb_Transaction *trans, const char *table, const int OH_RdbTrans_Update(OH_Rdb_Transaction *trans, const OH_VBucket *row, const OH_Predicates *predicates, int64_t *changes); +/** + * @brief Updates data in the database based on specified conditions and support conflict resolution. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param row Represents the row data to be updated into the table. + * @param predicates Represents the specified update condition by the instance object of OH_Predicates. + * @param resolution Represents the resolution when conflict occurs. + * @param changes Represents the number of successful insertions. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. + * @since 20 + */ +int OH_RdbTrans_UpdateWithConflictResolution(OH_Rdb_Transaction *trans, const OH_VBucket *row, + const OH_Predicates *predicates, Rdb_ConflictResolution resolution, int64_t *changes); + /** * @brief Deletes data from the database based on specified conditions * diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 54d2cc405..4360d4922 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -45,6 +45,7 @@ #include "database/rdb/oh_values_bucket.h" #include "database/rdb/oh_rdb_transaction.h" #include "database/rdb/oh_rdb_types.h" +#include "database/rdb/oh_rdb_crypto_param.h" #ifdef __cplusplus extern "C" { @@ -333,6 +334,55 @@ int OH_Rdb_SetArea(OH_Rdb_ConfigV2 *config, int area); */ int OH_Rdb_SetDbType(OH_Rdb_ConfigV2 *config, int dbType); +/** + * @brief Sets the customized directory relative to the database. + * + * @param config Represents a pointer to a configuration of the database related to this relation database store. + * @param customDir Represents the customized relative to the database directory, the value cannot exceed 128 bytes. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Rdb_SetCustomDir(OH_Rdb_ConfigV2 *config, const char *customDir); + +/** + * @brief Sets the relation database store is read-only mode. + * + * @param config Represents a pointer to a configuration of the database related to this relation database store. + * @param readOnly Represents whether the relation database store is read-only. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Rdb_SetReadOnly(OH_Rdb_ConfigV2 *config, bool readOnly); + +/** + * @brief Sets the dynamic libraries with capabilities such as Full-Text Search (FTS). + * + * @param config Represents a pointer to a configuration of the database related to this relation database store. + * @param plugins Represents the dynamic libraries. + * @param length the size of plugins that the maximum value is 16. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Rdb_SetPlugins(OH_Rdb_ConfigV2 *config, const char **plugins, int32_t length); + +/** + * @brief Sets the custom encryption parameters. + * + * @param config Represents a pointer to a configuration of the database related to this relation database store. + * @param cryptoParam Represents the custom encryption parameters. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 20 + */ +int OH_Rdb_SetCryptoParam(OH_Rdb_ConfigV2 *config, const OH_Rdb_CryptoParam *cryptoParam); + /** * @brief Set property tokenizer into config * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. @@ -501,6 +551,36 @@ int OH_Rdb_DeleteStoreV2(const OH_Rdb_ConfigV2 *config); */ int OH_Rdb_Insert(OH_Rdb_Store *store, const char *table, OH_VBucket *valuesBucket); +/** + * @brief Inserts a row of data into the target table and support conflict resolution. + * + * @param store Represents a pointer to an OH_Rdb_Store instance. + * @param table Represents the target table. + * @param row Represents the row data to be inserted into the table. + * @param resolution Represents the resolution when conflict occurs. + * @param rowId Represents the number of successful insertion. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. + * @since 20 + */ +int OH_Rdb_InsertWithConflictResolution(OH_Rdb_Store *store, const char *table, OH_VBucket *row, + Rdb_ConflictResolution resolution, int64_t *rowId); + /** * @brief Inserts a batch of data into the target table. * @@ -547,6 +627,36 @@ int OH_Rdb_BatchInsert(OH_Rdb_Store *store, const char *table, */ int OH_Rdb_Update(OH_Rdb_Store *store, OH_VBucket *valuesBucket, OH_Predicates *predicates); +/** + * @brief Updates data in the database based on specified conditions and support conflict resolution. + * + * @param store Represents a pointer to an OH_Rdb_Store instance. + * @param row Represents the row data to be inserted into the table. + * @param predicates Represents a pointer to an link OH_Predicates instance. + * @param resolution Represents the resolution when conflict occurs. + * @param changes Represents the number of successful update. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. + * @since 20 + */ +int OH_Rdb_UpdateWithConflictResolution(OH_Rdb_Store *store, OH_VBucket *row, OH_Predicates *predicates, + Rdb_ConflictResolution resolution, int64_t *changes); + /** * @brief Deletes data from the database based on specified conditions. * @@ -1405,6 +1515,85 @@ OH_Cursor *OH_Rdb_QueryLockedRow( */ int OH_Rdb_CreateTransaction(OH_Rdb_Store *store, const OH_RDB_TransOptions *options, OH_Rdb_Transaction **trans); +/** + * @brief Attaches a database file to the currently linked database. + * + * @param store Represents a pointer to an OH_Rdb_Store instance. + * @param config Represents a pointer to an OH_Rdb_ConfigV2 configuration of the database related to this RDB store. + * @param attachName Represents the alias of the database. + * @param waitTime Represents the maximum time allowed for attaching the database, vaild range is 1 to 300. + * @param attachedNumber Represents the number of attached databases, It is an output parameter. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_NOT_SUPPORTED} - The error code for not support. + * Returns {@link RDB_E_DATABASE_BUSY} database does not respond. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. + * @since 20 + */ +int OH_Rdb_Attach(OH_Rdb_Store *store, const OH_Rdb_ConfigV2 *config, const char *attachName, int64_t waitTime, + size_t *attachedNumber); + +/** + * @brief Detaches a database from this database. + * + * @param store Represents a pointer to an OH_Rdb_Store instance. + * @param attachName Represents the alias of the database. + * @param waitTime Represents the maximum time allowed for detaching the database, vaild range is 1 to 300. + * @param attachedNumber Represents the number of attached databases, It is an output parameter. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_NOT_SUPPORTED} - The error code for not support. + * Returns {@link RDB_E_DATABASE_BUSY} database does not respond. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. + * @see OH_Rdb_Store, OH_Rdb_ErrCode. + * @since 20 + */ +int OH_Rdb_Detach(OH_Rdb_Store *store, const char *attachName, int64_t waitTime, size_t *attachedNumber); + +/** + * @brief Support for collations in different languages. + * + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. + * @param locale Language related to the locale, for example, zh. The value complies with the ISO 639 standard. + * @return Returns a specific error code. + * {@link RDB_OK} if the execution is successful. + * {@link RDB_ERR} - Indicates that the function execution exception. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * {@link RDB_E_ALREADY_CLOSED} database already closed. + * {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Specific error codes can be referenced {@link OH_Rdb_ErrCode}. + * @see OH_Rdb_Store. + * @since 20 + */ +int OH_Rdb_SetLocale(OH_Rdb_Store *store, const char *locale); + #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 5d4110e08..b050b7673 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -526,5 +526,97 @@ { "first_introduced": "18", "name":"OH_Cursor_GetFloatVector" + }, + { + "first_introduced": "20", + "name":"OH_Predicates_NotLike" + }, + { + "first_introduced": "20", + "name":"OH_Predicates_Glob" + }, + { + "first_introduced": "20", + "name":"OH_Predicates_NotGlob" + }, + { + "first_introduced": "20", + "name":"OH_Predicates_Having" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_CreateCryptoParam" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_DestroyCryptoParam" + }, + { + "first_introduced": "20", + "name":"OH_Crypto_SetEncryptionKey" + }, + { + "first_introduced": "20", + "name":"OH_Crypto_SetIteration" + }, + { + "first_introduced": "20", + "name":"OH_Crypto_SetEncryptionAlgo" + }, + { + "first_introduced": "20", + "name":"OH_Crypto_SetHmacAlgo" + }, + { + "first_introduced": "20", + "name":"OH_Crypto_SetKdfAlgo" + }, + { + "first_introduced": "20", + "name":"OH_Crypto_SetCryptoPageSize" + }, + { + "first_introduced": "20", + "name":"OH_RdbTrans_InsertWithConflictResolution" + }, + { + "first_introduced": "20", + "name":"OH_RdbTrans_UpdateWithConflictResolution" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_SetCustomDir" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_SetReadOnly" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_SetPlugins" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_SetCryptoParam" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_InsertWithConflictResolution" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_UpdateWithConflictResolution" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_Attach" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_Detach" + }, + { + "first_introduced": "20", + "name":"OH_Rdb_SetLocale" } ] \ No newline at end of file -- Gitee From 64bb916c3d5b615fa0c9b5cd7c7493aa00b02271 Mon Sep 17 00:00:00 2001 From: wangweiyuan Date: Wed, 7 May 2025 10:48:34 +0800 Subject: [PATCH 35/35] RotateAngle CAPI Signed-off-by: wangweiyuan --- arkui/ace_engine/native/native_node.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index b2d484739..0e8667948 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1963,6 +1963,25 @@ typedef enum { */ NODE_TRANSLATE_WITH_PERCENT = 103, + /** + * @brief Sets component rotation with multi-axis angle control. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: x-axis rotation angle. The default value is 0. \n + * .value[1].f32: y-axis rotation angle. The default value is 0. \n + * .value[2].f32: z-axis rotation angle. The default value is 0. \n + * .value[3].f32: perspective distance from the viewpoint to the z=0 plane, in vp. The default value is 0. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: x-axis rotation angle. The default value is 0. + * .value[1].f32: y-axis rotation angle. The default value is 0. \n + * .value[2].f32: z-axis rotation angle. The default value is 0. \n + * .value[3].f32: perspective distance from the viewpoint to the z=0 plane, in vp. The default value is 0. \n + * + * @since 20 + */ + NODE_ROTATE_ANGLE = 104, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * -- Gitee