From 752e3407037e0f791c6b236e5b4fe87a98095fa3 Mon Sep 17 00:00:00 2001 From: AnBetter Date: Fri, 7 Feb 2025 14:46:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5Progress=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81strokeWidth/strokeRadius/enableSmoothEffect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: AnBetter --- arkui/ace_engine/native/libace.ndk.json | 40 ++++++++++ arkui/ace_engine/native/native_node.h | 14 ++++ arkui/ace_engine/native/native_type.h | 99 +++++++++++++++++++++++++ 3 files changed, 153 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index efa04cfe7..4cf724909 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2469,5 +2469,45 @@ { "first_introduced": "14", "name": "OH_ArkUI_KeyEvent_SetConsumed" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_Create" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_Destroy" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_SetScanEffectEnabled" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_SetSmoothEffectEnabled" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_SetStrokeWidth" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_SetStrokeRadius" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_GetScanEffectEnabled" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_GetSmoothEffectEnabled" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_GetStrokeWidth" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_ProgressLinearStyleOption_GetStrokeRadius" } ] \ 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 6e5863525..dcff808b5 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3336,6 +3336,20 @@ typedef enum { * */ NODE_PROGRESS_TYPE, + /** + * @brief Sets the style of the linear progress indicator. + * This attribute can be set, reset, and obtained as required through APIs. + * If the progress indicator type is not linear, it will not take effect. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .object: Use the {@link ArkUI_ProgressLinearStyleOption} object to set the style. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: Use the {@link ArkUI_ProgressLinearStyleOption} object to get the style. \n + * + * @since 15 + */ + NODE_PROGRESS_LINEAR_STYLE, /** * @brief Defines whether the check box is selected. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index e0945dc96..b08f2f342 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -207,6 +207,13 @@ typedef struct ArkUI_CustomProperty ArkUI_CustomProperty; */ typedef struct ArkUI_ActiveChildrenInfo ArkUI_ActiveChildrenInfo; +/** + * @brief Set the linear progress indicator style. + * + * @since 15 + */ +typedef struct ArkUI_ProgressLinearStyleOption ArkUI_ProgressLinearStyleOption; + /** * @brief Defines the event callback type. * @@ -3938,6 +3945,98 @@ ArkUI_NodeHandle OH_ArkUI_ActiveChildrenInfo_GetNodeByIndex(ArkUI_ActiveChildren * @since 14 */ int32_t OH_ArkUI_ActiveChildrenInfo_GetCount(ArkUI_ActiveChildrenInfo* handle); + +/** + * @brief Create linear progress indicator style information. + * + * @return Returns a ProgressLinearStyleOption instance. + *
If the result returns nullptr, there may be out of memory. + * @since 15 + */ +ArkUI_ProgressLinearStyleOption* OH_ArkUI_ProgressLinearStyleOption_Create(void); + +/** + * @brief Destroy linear progress indicator style information. + * + * @param option Linear progress indicator style information. + * @since 15 + */ +void OH_ArkUI_ProgressLinearStyleOption_Destroy(ArkUI_ProgressLinearStyleOption* option); + +/** + * @brief Set whether the scan effect is enabled. + * + * @param option Linear progress indicator style information. + * @param enabled Whether to enable the scan effect. Default value: false. + * @since 15 + */ +void OH_ArkUI_ProgressLinearStyleOption_SetScanEffectEnabled(ArkUI_ProgressLinearStyleOption* option, bool enabled); + +/** + * @brief Set whether smoothing effect is enabled. + * + * @param option Linear progress indicator style information. + * @param enabled Whether to enable the smooth effect. When this effect is enabled, the progress change to + * the set value takes place gradually. Otherwise, it takes place immediately. Default value: true. + * @since 15 + */ +void OH_ArkUI_ProgressLinearStyleOption_SetSmoothEffectEnabled(ArkUI_ProgressLinearStyleOption* option, bool enabled); + +/** + * @brief Set linear progress indicator stroke width. + * + * @param option Linear progress indicator style information. + * @param strokeWidth Stroke width of the progress indicator. It cannot be set in percentage. + * Default value: 4.0vp. + * @since 15 + */ +void OH_ArkUI_ProgressLinearStyleOption_SetStrokeWidth(ArkUI_ProgressLinearStyleOption* option, float strokeWidth); + +/** + * @brief Set linear progress indicator stroke radius. + * + * @param option Linear progress indicator style information. + * @param strokeRadius Rounded corner radius of the progress indicator. Value range: [0, strokeWidth/2]. + * Default value: strokeWidth/2. + * @since 15 + */ +void OH_ArkUI_ProgressLinearStyleOption_SetStrokeRadius(ArkUI_ProgressLinearStyleOption* option, float strokeRadius); + +/** + * @brief Get whether scan effect is enable. + * + * @param option Linear progress indicator style information. + * @return Whether to enable the scan effect. + * @since 15 + */ +bool OH_ArkUI_ProgressLinearStyleOption_GetScanEffectEnabled(ArkUI_ProgressLinearStyleOption* option); + +/** + * @brief Get whether smoothing effect is enabled. + * + * @param option Linear progress indicator style information. + * @return Whether to enable the smooth effect. + * @since 15 + */ +bool OH_ArkUI_ProgressLinearStyleOption_GetSmoothEffectEnabled(ArkUI_ProgressLinearStyleOption* option); + +/** + * @brief Get linear progress indicator stroke width. + * + * @param option Linear progress indicator style information. + * @return Stroke width of the progress indicator. + * @since 15 + */ +float OH_ArkUI_ProgressLinearStyleOption_GetStrokeWidth(ArkUI_ProgressLinearStyleOption* option); + +/** + * @brief Get linear progress indicator stroke radius. + * + * @param option Linear progress indicator style information. + * @return Rounded corner radius of the progress indicator. + * @since 15 + */ +float OH_ArkUI_ProgressLinearStyleOption_GetStrokeRadius(ArkUI_ProgressLinearStyleOption* option); #ifdef __cplusplus }; #endif -- Gitee