diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 888ce7b94e85dba6ba3550544d92e5bf27e9253b..2424c0297a0d2827eb622153401cc81ad3d59b1b 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -5066,16 +5066,19 @@ typedef enum { NODE_SWIPER_INDEX, /** - * @brief Defines the number of elements to display per page. - * 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: index value of the child component. \n - * \n - * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].i32: index value of the child component. \n - * - */ + * @brief Defines the number of elements to display per page. + * 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: number of elements to display per page. \n + * .value[1]?.i32: whether to turn pages by group. The value 0 means to turn pages by child element, + * and 1 means to turn pages by group. This parameter is supported since API version 16. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: number of elements to display per page. \n + * .value[1].i32: whether to turn pages by group. This parameter is supported since API version 16. \n + * + */ NODE_SWIPER_DISPLAY_COUNT, /** @@ -5094,20 +5097,24 @@ typedef enum { NODE_SWIPER_DISABLE_SWIPE, /** - * @brief Defines whether to show the arrow when the mouse pointer hovers over the navigation point indicator. - * 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 show the arrow when the mouse pointer hovers over the navigation point indicator. - * The parameter type is {@link ArkUI_SwiperArrow}.\n - * The default value is ARKUI_SWIPER_ARROW_HIDE. \n - * \n - * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].i32: whether to show the arrow when the mouse pointer hovers over the navigation point indicator. - * The parameter type is {@link ArkUI_SwiperArrow}.\n - * The default value is ARKUI_SWIPER_ARROW_HIDE. \n - * - */ + * @brief Defines whether to show the arrow when the mouse pointer hovers over the navigation point indicator. + * 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 show the arrow when the mouse pointer hovers over the navigation point indicator. + * The parameter type is {@link ArkUI_SwiperArrow}.\n + * The default value is ARKUI_SWIPER_ARROW_HIDE. \n + * .?object: arrow style. The parameter type is {@link ArkUI_SwiperArrowStyle}. \n + * This parameter is supported since API version 16. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to show the arrow when the mouse pointer hovers over the navigation point indicator. + * The parameter type is {@link ArkUI_SwiperArrow}.\n + * The default value is ARKUI_SWIPER_ARROW_HIDE. \n + * .object: arrow style. The parameter type is {@link ArkUI_SwiperArrowStyle}. \n + * This parameter is supported since API version 16. \n + * + */ NODE_SWIPER_SHOW_DISPLAY_ARROW, /** @@ -5140,6 +5147,14 @@ typedef enum { * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n * .value[0].i32: number of cached items in the swiper adapter. \n + * .value[1]?.i32: whether the cached items will be displayed. \n + * The value 0 indicates that cached items will not be displayed, \n + * and 1 indicates that cached nodes will be displayed. The default value is 0. \n + * This parameter is supported from API version 16. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: number of cached items in the swiper adapter. \n + * .value[1].i32: whether the cached items will be displayed. This parameter is supported from API version 16. \n */ NODE_SWIPER_CACHED_COUNT, @@ -5174,18 +5189,26 @@ typedef enum { NODE_SWIPER_NEXT_MARGIN, /** - * @brief Defines the navigation indicator type of the swiper. - * The 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: navigation indicator type, the parameter type is {@link ArkUI_SwiperIndicatorType}.\n - * .object: The parameter type is {@link ArkUI_SwiperIndicator}.\n - * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].i32: navigation indicator type, the parameter type is {@link ArkUI_SwiperIndicatorType}.\n - * .object: The parameter type is {@link ArkUI_SwiperIndicator}.\n - * - */ + * @brief Defines the navigation indicator type of the swiper. + * The 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: navigation indicator type, the parameter type is {@link ArkUI_SwiperIndicatorType}.\n + * .object: The parameter type is {@link ArkUI_SwiperIndicator} when the indicator type \n + * is ARKUI_SWIPER_INDICATOR_TYPE_DOT. The parameter type is {@link ArkUI_SwiperDigitIndicator} + * when the indicator type is ARKUI_SWIPER_INDICATOR_TYPE_DIGIT. \n + * {@link ArkUI_SwiperDigitIndicator} is supported since API version 16. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: navigation indicator type, the parameter type is {@link ArkUI_SwiperIndicatorType}.\n + * .object: The parameter type is {@link ArkUI_SwiperIndicator} when the indicator type \n + * is ARKUI_SWIPER_INDICATOR_TYPE_DOT. The parameter type is {@link ArkUI_SwiperDigitIndicator} + * when the indicator type is ARKUI_SWIPER_INDICATOR_TYPE_DIGIT. \n + * {@link ArkUI_SwiperDigitIndicator} is supported since API version 16. \n + * + */ NODE_SWIPER_INDICATOR, + /** * @brief Set the nested scrolling mode for the Swiper component and parent component. * @@ -5234,6 +5257,23 @@ typedef enum { */ NODE_SWIPER_PAGE_FLIP_MODE, + /** + * @brief Defines the minimum main axis size of child element for swiper to works out the display count. + * 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: minimum main axis size of the child element, Unit: vp. \n + * .value[1]?.i32: whether to turn pages by group. The value 0 means to turn pages by child element, + * and 1 means to turn pages by group. The default value is 0. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: minimum main axis size of the child element, Unit: vp. \n + * .value[1].i32: whether to turn pages by group. \n + * + * @since 16 + */ + NODE_SWIPER_AUTO_FILL, + /** * @brief: Set the delineation component of the ListItem, supporting property settings, property resets, and * property acquisition interfaces. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 18f28994eb731b308c791c5dc8343607b4c09755..93b83fb1368463fdfe7a619f930ac78e21c5cb51 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2812,6 +2812,341 @@ int32_t OH_ArkUI_SwiperIndicator_SetMaxDisplayCount(ArkUI_SwiperIndicator* indic */ int32_t OH_ArkUI_SwiperIndicator_GetMaxDisplayCount(ArkUI_SwiperIndicator* indicator); +/** + * @brief Creates a digital indicator. + * + * @return Returns the pointer to the new indicator. + * @since 16 + */ +ArkUI_SwiperDigitIndicator *OH_ArkUI_SwiperDigitIndicator_Create(); + +/** + * @brief Sets the distance between the digital indicator and the start of the swiper. + * + * @param indicator The pointer to the digital indicator. + * @param value Indicates the distance between the digital indicator and the start of the swiper. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetStartPosition(ArkUI_SwiperDigitIndicator* indicator, float value); + +/** + * @brief Gets the distance between the digital indicator and the start of the swiper. + * + * @param indicator The pointer to the digital indicator. + * @return Returns the distance between the digital indicator and the start of the swiper. + * @since 16 + */ +float OH_ArkUI_SwiperDigitIndicator_GetStartPosition(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the distance between the digital indicator and the top of the swiper. + * + * @param indicator The pointer to the digital indicator. + * @param value Indicates the distance between the digital indicator and the top of the swiper. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetTopPosition(ArkUI_SwiperDigitIndicator* indicator, float value); + +/** + * @brief Gets the distance between the digital indicator and the top of the swiper. + * + * @param indicator The pointer to the digital indicator. + * @return Returns the distance between the digital indicator and the top of the swiper. + * @since 16 + */ +float OH_ArkUI_SwiperDigitIndicator_GetTopPosition(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the distance between the digital indicator and the end of the swiper. + * + * @param indicator The pointer to the digital indicator. + * @param value Indicates the distance between the digital indicator and the end of the swiper. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetEndPosition(ArkUI_SwiperDigitIndicator* indicator, float value); + +/** + * @brief Gets the distance between the digital indicator and the end of the swiper. + * + * @param indicator The pointer to the digital indicator. + * @return Returns the distance between the digital indicator and the end of the swiper. + * @since 16 + */ +float OH_ArkUI_SwiperDigitIndicator_GetEndPosition(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the distance between the digital indicator and the bottom of the swiper. + * + * @param indicator The pointer to the digital indicator. + * @param value Returns the distance between the digital indicator and the bottom of the swiper. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetBottomPosition(ArkUI_SwiperDigitIndicator* indicator, float value); + +/** + * @brief Gets the distance between the digital indicator and the bottom of the swiper. + * + * @param indicator The pointer to the digital indicator. + * @return Returns the distance between the digital indicator and the bottom of the swiper. + * @since 16 + */ +float OH_ArkUI_SwiperDigitIndicator_GetBottomPosition(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the font color of total count in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @param color font color, in 0xARGB format. Default value: 0xFF182431. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetFontColor(ArkUI_SwiperDigitIndicator* indicator, uint32_t color); + +/** + * @brief Gets the font color of total count in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @return font color, in 0xARGB format. + * @since 16 + */ +uint32_t OH_ArkUI_SwiperDigitIndicator_GetFontColor(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the font color of selected index in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @param selectedColor font color, in 0xARGB format. Default value: 0xFF182431. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetSelectedFontColor(ArkUI_SwiperDigitIndicator* indicator, uint32_t selectedColor); + +/** + * @brief Gets the font color of selected index in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @return font color, in 0xARGB format. + * @since 16 + */ +uint32_t OH_ArkUI_SwiperDigitIndicator_GetSelectedFontColor(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the font size of total count in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @param size font size, in fp. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetFontSize(ArkUI_SwiperDigitIndicator* indicator, float size); + +/** + * @brief Gets the font size of total count in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @return font size, in fp. + * @since 16 + */ +float OH_ArkUI_SwiperDigitIndicator_GetFontSize(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the font size of selected index in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @param size font size, in fp. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetSelectedFontSize(ArkUI_SwiperDigitIndicator* indicator, float size); + +/** + * @brief Gets the font size of selected index in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @return font size, in fp. + * @since 16 + */ +float OH_ArkUI_SwiperDigitIndicator_GetSelectedFontSize(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the font weight of total count in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @param fontWeight font weight {@link ArkUI_FontWeight}. The default value is ARKUI_FONT_WEIGHT_NORMAL. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetFontWeight(ArkUI_SwiperDigitIndicator *indicator, ArkUI_FontWeight fontWeight); + +/** + * @brief Gets the font weight of total count in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @return font weight {@link ArkUI_FontWeight}. + * @since 16 + */ +ArkUI_FontWeight OH_ArkUI_SwiperDigitIndicator_GetFontWeight(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Sets the font weight of selected index in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @param selectedFontWeight font weight {@link ArkUI_FontWeight}. The default value is ARKUI_FONT_WEIGHT_NORMAL. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_SetSelectedFontWeight( + ArkUI_SwiperDigitIndicator *indicator, ArkUI_FontWeight selectedFontWeight); + +/** + * @brief Gets the font weight of selected index in the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @return font weight {@link ArkUI_FontWeight}. + * @since 16 + */ +ArkUI_FontWeight OH_ArkUI_SwiperDigitIndicator_GetSelectedFontWeight(ArkUI_SwiperDigitIndicator* indicator); + +/** + * @brief Destroys the digital indicator. + * + * @param indicator The pointer to the digital indicator. + * @since 16 + */ +void OH_ArkUI_SwiperDigitIndicator_Destroy(ArkUI_SwiperDigitIndicator *indicator); + +/** + * @brief Creates a arrow style for swiper. + * + * @return Returns the pointer to the new arrow style. + * @since 16 + */ +ArkUI_SwiperArrowStyle *OH_ArkUI_SwiperArrowStyle_Create(); + +/** + * @brief Sets whether to show the background for the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @param showBackground whether to show the background for the arrow. + * The value 1 means to show the background, and 0 means the opposite. + * The default value is 0. + * @since 16 + */ +void OH_ArkUI_SwiperArrowStyle_SetShowBackground(ArkUI_SwiperArrowStyle *arrowStyle, int32_t showBackground); + +/** + * @brief Gets whether to show the background for the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @return whether to show the background for the arrow. + * The value 1 means to show the background, and 0 means the opposite. + * @since 16 + */ +int32_t OH_ArkUI_SwiperArrowStyle_GetShowBackground(ArkUI_SwiperArrowStyle* arrowStyle); + +/** + * @brief Sets the display position of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @param showSidebarMiddle the display position of the arrow. + * The value 1 means to display on boths sides of the swiper, + * and 0 means display on boths sides of the swiper indicator. + * The default value is 0. + * @since 16 + */ +void OH_ArkUI_SwiperArrowStyle_SetShowSidebarMiddle(ArkUI_SwiperArrowStyle* arrowStyle, int32_t showSidebarMiddle); + +/** + * @brief Gets the display position of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @return the display position of the arrow. The value 1 means to display on boths sides of the swiper, + * and 0 means display on boths sides of the swiper indicator. + * @since 16 + */ +int32_t OH_ArkUI_SwiperArrowStyle_GetShowSidebarMiddle(ArkUI_SwiperArrowStyle* arrowStyle); + +/** + * @brief Sets the background size of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @param backgroundSize the background size of the arrow. The unit is vp. + * The default value is 24 when the arrow displays on both sides of the swiper indicator. + * The default value is 32 when the arrow displays on both sides of the swiper. + * @since 16 + */ +void OH_ArkUI_SwiperArrowStyle_SetBackgroundSize(ArkUI_SwiperArrowStyle* arrowStyle, float backgroundSize); + +/** + * @brief Gets the background size of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @return Returns the background size of the arrow. The unit is vp. + * @since 16 + */ +float OH_ArkUI_SwiperArrowStyle_GetBackgroundSize(ArkUI_SwiperArrowStyle *arrowStyle); + +/** + * @brief Destroys the arrow style. + * + * @param arrowStyle The pointer to the arrow style. + * @since 16 + */ +void OH_ArkUI_SwiperArrowStyle_Destroy(ArkUI_SwiperArrowStyle *arrowStyle); + +/** + * @brief Sets the background color of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @param backgroundColor the background color of the arrow, in 0xARGB format. + * The default value is 0x00000000 when the arrow displays on both sides of the swiper indicator. + * The default value is 0x19182431 when the arrow displays on both sides of the swiper. + * @since 16 + */ +void OH_ArkUI_SwiperArrowStyle_SetBackgroundColor(ArkUI_SwiperArrowStyle *arrowStyle, uint32_t backgroundColor); + +/** + * @brief Gets the background color of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @return Returns the background color of the arrow, in 0xARGB format. + * @since 16 + */ +uint32_t OH_ArkUI_SwiperArrowStyle_GetBackgroundColor(ArkUI_SwiperArrowStyle* arrowStyle); + +/** + * @brief Sets the size of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @param arrowSize the size of the arrow. The unit is vp. + * The default value is 18 when the arrow displays on both sides of the swiper indicator. + * The default value is 24 when the arrow displays on both sides of the swiper. + * The arrow size is fixed to 3/4 of the background size when the background is shown. + * @since 16 + */ +void OH_ArkUI_SwiperArrowStyle_SetArrowSize(ArkUI_SwiperArrowStyle* arrowStyle, float arrowSize); + +/** + * @brief Gets the size of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @return the size of the arrow. The unit is vp. + * @since 16 + */ +float OH_ArkUI_SwiperArrowStyle_GetArrowSize(ArkUI_SwiperArrowStyle* arrowStyle); + +/** + * @brief Sets the color of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @param arrowColor the color of the arrow, in 0xARGB format. The default value is 0x00182431. + * @since 16 + */ +void OH_ArkUI_SwiperArrowStyle_SetArrowColor(ArkUI_SwiperArrowStyle* arrowStyle, uint32_t arrowColor); + +/** + * @brief Gets the color of the arrow. + * + * @param arrowStyle The pointer to the arrow style. + * @return Returns the color of the arrow, in 0xARGB format. + * @since 16 + */ +uint32_t OH_ArkUI_SwiperArrowStyle_GetArrowColor(ArkUI_SwiperArrowStyle* arrowStyle); + /** * @brief Create auxiliary line information in the RelativeContaine container. *