diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index efa04cfe7a0660d4ca481c30baf71e93d384c37b..4cf724909d7a7bd89f172939732195e05c175827 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 6e5863525473bf63fac03ce778dcaabf71f95317..dcff808b50af83278c6935ba4362edd4d5d4e560 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 e0945dc96a09d5e3860cc76f70e7e55520ec7e17..b08f2f34285184359ceaf7f275e407a712756c5c 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