diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 2e089f3e4f4450068d8e54293efeabd2cc7c6fe9..b120adb1d474d0513f08cfc7c41ce100d8211a36 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4178,6 +4178,18 @@ typedef enum { * The parameter type is {@link ArkUI_ListItemAlignment}. \n */ NODE_LIST_ALIGN_LIST_ITEM, + /** + * @brief Set the size information of the sub components of the List component or ListItem Group component in + * the main axis direction, support property setting, property reset, and property acquisition interface。 + * + * Attribute setting method parameter {@link ArkUI_AttributeItem} format:\n + * .object content filling method, constructed using the {@link ArkUI_ListitemMainSizeAdapter} class.\n + * \n + * The return value of the attribute acquisition method {@link ArkUI_AttributeItem} format:\n + *.object content filling method, constructed using the {@link ArkUI_ListitemMainSizeAdapter} class\n + * + */ + NODE_LIST_ITEM_MAIN_SIZE, /** * @brief Defines whether to enable loop playback for the swiper. @@ -4486,6 +4498,18 @@ typedef enum { * */ NODE_LIST_ITEM_GROUP_SET_DIVIDER, + /** + * @brief: Set the delineation component of the ListItem, supporting property settings, property resets, and + * property acquisition interfaces. + * + * Attribute setting method parameter {@link ArkUI_AttributeItem} format: \n + * .object: Construct using the {@link ArkUI_ListitemSwipeActionOption} object. \n + * \n + * The return value of the attribute acquisition method {@link ArkUI_AttributeItem} format: \n + * .object: Construct using the {@link ArkUI_ListitemSwipeActionOption} object. \n + * + */ + NODE_LIST_ITEM_SWIPE_ACTION, /** * @brief Defines the horizontal alignment mode of child components in the column. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 71a268f5efec8b46bebb91d323d7629739860823..e3f963e302291cebfac3d1f1a9a67128a427265b 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -98,6 +98,27 @@ typedef struct ArkUI_NativeDialog* ArkUI_NativeDialogHandle; */ typedef struct ArkUI_WaterFlowSectionOption ArkUI_WaterFlowSectionOption; +/** + * @brief Define the configuration information of the Item within the ListitemSwipeActionOption method. + * + * @since 12 + */ +typedef struct ArkUI_ListItemSwipeActionItem ArkUI_ListItemSwipeActionItem; + +/** + * @brief Define the configuration information for the ListitemSwipeActionOption method. + * + * @since 12 + */ +typedef struct ArkUI_ListItemSwipeActionOption ArkUI_ListItemSwipeActionOption; + +/** + * @brief Define the configuration information for ListitemMainSizeAdapter. + * + * @since 12 + */ +typedef struct ArkUI_ListItemMainSizeAdapter ArkUI_ListItemMainSizeAdapter; + /** * @brief Defines the ArkUI native context object. * @@ -1770,6 +1791,24 @@ typedef enum { ARKUI_SWIPER_INDICATOR_TYPE_DIGIT, } ArkUI_SwiperIndicatorType; +typedef enum { + /** In the folded state, when the ListItem slides in the opposite direction to the main axis, + * the operation item is hidden.*/ + ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_COLLAPSED = 0, + /** In the folded state, when the ListItem slides in the opposite direction to the spindle, + * the operation item is displayed.*/ + ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_EXPANDED, + /** Long distance state, the state of deleting a ListItem after it enters the long distance deletion area.*/ + ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_ACTIONING, +} ArkUI_ListItemSwipeActionState; + +typedef enum { + /** The ListItem can continue to be scratched after the distance exceeds the size of the scratched component.*/ + ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_SPRING = 0, + /** The sliding distance of the ListItem cannot exceed the size of the scratched component.*/ + ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_NONE, +} ArkUI_ListItemSwipeEdgeEffect; + /** * @brief Creates a size constraint. * @@ -2692,6 +2731,195 @@ float OH_ArkUI_AlignmentRuleOption_GetBiasHorizontal(ArkUI_AlignmentRuleOption* * @since 12 */ float OH_ArkUI_AlignmentRuleOption_GetBiasVertical(ArkUI_AlignmentRuleOption* option); +/** + * @brief Create a configuration item for the ListitemMainSizeAdapter interface settings. + * + * @param defaultChildrenSize The default size of the sub components in the spindle direction. + * @return List Item MainSizeAdapter configuration item instance. + * @since 12 + */ +ArkUI_ListItemMainSizeAdapter* OH_ArkUI_ListItemMainSizeAdapter_Create(float defaultChildrenSize); + +/** +* @brief Destroy the ListitemMainSizeAdapter instance. +* +* @param adapter List Item MainSizeAdapter instance to be destroyed. +* @since 12 +*/ +void OH_ArkUI_ListItemMainSizeAdapter_Dispose(ArkUI_ListItemMainSizeAdapter* adapter); + +/** + * @brief Modify the default size of subcomponents in the spindle direction. + * + * @param adapter List Item MainSizeAdapter configuration item instance. + * @param defaultChildrenSize The size of the spindle direction. + * @since 12 +*/ +void OH_ArkUI_ListItemMainSizeAdapter_SetDefaultSize(ArkUI_ListItemMainSizeAdapter* adapter, float defaultChildrenSize); + +/** + * @brief Obtain the default size of the sub components in the spindle direction. + * + * @param adapter List Item MainSizeAdapter configuration item instance. + * @return The default size of the sub components in the spindle direction. Return value on exception: 0. + * @since 12 +*/ +float OH_ArkUI_ListItemMainSizeAdapter_GetDefaultSize(ArkUI_ListItemMainSizeAdapter* adapter); + +/** + * @brief Batch adding, deleting, and modifying the size information of sub components in the spindle direction. + * + * @param adapter List Item MainSizeAdapter configuration item instance. + * @param getMainSize Callback interface. + * Index array position. +* return The height of the item at the corresponding position. + * @since 12 +*/ +void OH_ArkUI_ListItemMainSizeAdapter_RegisterGetMainSizeCallback(ArkUI_ListItemMainSizeAdapter* adapter, float (*getMainSize)(int32_t index)); + +/** + * @brief Create a configuration item for the ListitemSwipeActionItem interface settings. + * + * @return List Item SwipeActionItem configuration item instance. + * @since 12 +*/ +ArkUI_ListItemSwipeActionItem* OH_ArkUI_ListItemSwipeActionItem_Create(); + +/** +* @brief Destroy the ListitemSwipeActionItem instance. +* +* @param option List Item SwipeActionItem instance to be destroyed. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionItem_Dispose(ArkUI_ListItemSwipeActionItem* option); + +/** +* @brief Set the layout content of ListItem SwipeActionItem. +* +* @param option List Item SwipeActionItem instance. +* @param builder Layout information. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionItem_SetContent(ArkUI_ListItemSwipeActionItem* option, ArkUI_NodeHandle builder); + +/** +* @brief Set the threshold for long-distance sliding deletion distance of components. +* +* @param option List Item SwipeActionItem instance. +* @param distance Component long-distance sliding deletion distance threshold. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionItem_SetActionAreaDistance(ArkUI_ListItemSwipeActionItem* option, float distance); + +/** +* @brief Obtain the threshold for long-distance sliding deletion distance of components. +* +* @param option List Item SwipeActionItem instance. +* @return Component long-distance sliding deletion distance threshold. Return value on exception: 0. +* @since 12 +*/ +float OH_ArkUI_ListItemSwipeActionItem_GetActionAreaDistance(ArkUI_ListItemSwipeActionItem* option); + +/** +* @brief Set the event to be called when a sliding entry enters the deletion area. +* +* @param option List Item SwipeActionItem instance. +* @param callback Callback Events. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionArea(ArkUI_ListItemSwipeActionItem* option, void (*callback)()); + +/** +* @brief Set the event to be called when a component enters the long-range deletion area and deletes a ListItem. +* +* @param option List Item SwipeActionItem instance. +* @param callback Callback Events. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionItem_SetOnAction(ArkUI_ListItemSwipeActionItem* option, void (*callback)()); + +/** +* @brief Set the event to be called when a sliding entry exits the deletion area. +* +* @param option List Item SwipeActionItem instance. +* @param callback Callback Events. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionArea(ArkUI_ListItemSwipeActionItem* option, void (*callback)()); + +/** +* @brief Set the event triggered when the sliding state of a list item changes. +* +* @param option List Item SwipeActionItem instance. +* @param callback Callback Events. +* swipeActionState The changed state. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionItem_SetOnStateChange(ArkUI_ListItemSwipeActionItem* option, void (*callback)(ArkUI_ListItemSwipeActionState swipeActionState)); + +/** + * @brief Create a configuration item for the ListitemSwipeActionOption interface settings. + * + * @return List Item SwipeActionOption configuration item instance. + * @since 12 +*/ +ArkUI_ListItemSwipeActionOption* OH_ArkUI_ListItemSwipeActionOption_Create(); + +/** +* @brief Destroy the ListitemSwipeActionOption instance. +* +* @param option List Item SwipeActionOption instance to be destroyed. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionOption_Dispose(ArkUI_ListItemSwipeActionOption* option); + +/** +* @brief Set the layout content on the left (vertical layout) or top (horizontal layout) +* of the ListItem SwipeActionItem. +* +* @param option List Item SwipeActionItem instance. +* @param builder Layout information. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionOption_SetStart(ArkUI_ListItemSwipeActionOption* option, ArkUI_ListItemSwipeActionItem item); + +/** +* @brief Set the layout content on the right (vertical layout) or bottom (horizontal layout) +* of the ListItem SwipeActionItem. +* +* @param option List Item SwipeActionItem instance. +* @param builder Layout information. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionOption_SetEnd(ArkUI_ListItemSwipeActionOption* option, ArkUI_ListItemSwipeActionItem item); + +/** +* @brief Set the sliding effect. +* +* @param option List Item SwipeActionItem instance. +* @param edgeEffect Sliding effect. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionOption_SetEdgeEffect(ArkUI_ListItemSwipeActionItem* option, ArkUI_ListItemSwipeEdgeEffect edgeEffect); + +/** +* @brief Get the sliding effect. +* +* @param option List Item SwipeActionItem instance. +* @return Sliding effect. The default return value is ARKUI-LIST-ITEM-SWIPE-EDGE-EFFECT SPRING. +* @since 12 +*/ +int32_t OH_ArkUI_ListItemSwipeActionOption_GetEdgeEffect(ArkUI_ListItemSwipeActionItem* option); + +/** +* @brief The event called when the sliding operation offset changes. +* +* @param option List Item SwipeActionItem instance. +* @param callback Callback Events. +* offset Slide offset. +* @since 12 +*/ +void OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChange(ArkUI_ListItemSwipeActionItem* option, void (*callback)(float offset)); #ifdef __cplusplus }; #endif