---@meta
---@class ccui.ListView :ccui.ScrollView
local ListView={ }
ccui.ListView=ListView
---* Set the gravity of ListView.
---* see `ListViewGravity`
---@param gravity int
---@return self
function ListView:setGravity (gravity) end
---* Removes the last item of ListView.
---@return self
function ListView:removeLastItem () end
---* Get the left padding in ListView
---* return Left padding in float
---@return float
function ListView:getLeftPadding () end
---* brief Query the center item
---* return An item instance.
---@return ccui.Widget
function ListView:getCenterItemInCurrentView () end
---* brief Query current selected widget's index.
---* return An index of a selected item.
---@return int
function ListView:getCurSelectedIndex () end
---* Get the time in seconds to scroll between items.
---* return The time in seconds to scroll between items
---* see setScrollDuration(float)
---@return float
function ListView:getScrollDuration () end
---* Query whether the magnetic out of boundary is allowed.
---@return boolean
function ListView:getMagneticAllowedOutOfBoundary () end
---* brief Query margin between each item in ListView.
---* return A margin in float.
---@return float
function ListView:getItemsMargin () end
---@overload fun(int:int,vec2_table:vec2_table,vec2_table:vec2_table,float:float):self
---@overload fun(int:int,vec2_table:vec2_table,vec2_table:vec2_table):self
---@param itemIndex int
---@param positionRatioInView vec2_table
---@param itemAnchorPoint vec2_table
---@param timeInSec float
---@return self
function ListView:scrollToItem (itemIndex,positionRatioInView,itemAnchorPoint,timeInSec) end
---* brief Jump to specific item
---* param itemIndex Specifies the item's index
---* param positionRatioInView Specifies the position with ratio in list view's content size.
---* param itemAnchorPoint Specifies an anchor point of each item for position to calculate distance.
---@param itemIndex int
---@param positionRatioInView vec2_table
---@param itemAnchorPoint vec2_table
---@return self
function ListView:jumpToItem (itemIndex,positionRatioInView,itemAnchorPoint) end
---* Change padding with top padding
---* param t Top padding in float
---@param t float
---@return self
function ListView:setTopPadding (t) end
---* Return the index of specified widget.
---* param item A widget pointer.
---* return The index of a given widget in ListView.
---@param item ccui.Widget
---@return int
function ListView:getIndex (item) end
---* Insert a custom item into the end of ListView.
---* param item An item in `Widget*`.
---@param item ccui.Widget
---@return self
function ListView:pushBackCustomItem (item) end
---* brief Set current selected widget's index and call TouchEventType::ENDED event.
---* param itemIndex A index of a selected item.
---@param itemIndex int
---@return self
function ListView:setCurSelectedIndex (itemIndex) end
---* Insert a default item(create by cloning model) into listview at a give index.
---* param index An index in ssize_t.
---@param index int
---@return self
function ListView:insertDefaultItem (index) end
---* Set magnetic type of ListView.
---* see `MagneticType`
---@param magneticType int
---@return self
function ListView:setMagneticType (magneticType) end
---* Set magnetic allowed out of boundary.
---@param magneticAllowedOutOfBoundary boolean
---@return self
function ListView:setMagneticAllowedOutOfBoundary (magneticAllowedOutOfBoundary) end
---* Add an event click callback to ListView, then one item of Listview is clicked, the callback will be called.
---* param callback A callback function with type of `ccListViewCallback`.
---@param callback function
---@return self
function ListView:addEventListener (callback) end
---*
---@return self
function ListView:doLayout () end
---* brief Query the topmost item in horizontal list
---* return An item instance.
---@return ccui.Widget
function ListView:getTopmostItemInCurrentView () end
---* Change padding with left, top, right, and bottom padding.
---* param l Left padding in float.
---* param t Top margin in float.
---* param r Right margin in float.
---* param b Bottom margin in float.
---@param l float
---@param t float
---@param r float
---@param b float
---@return self
function ListView:setPadding (l,t,r,b) end
---* brief Remove all items in current ListView.
---@return self
function ListView:removeAllItems () end
---* Get the right padding in ListView
---* return Right padding in float
---@return float
function ListView:getRightPadding () end
---* brief Query the bottommost item in horizontal list
---* return An item instance.
---@return ccui.Widget
function ListView:getBottommostItemInCurrentView () end
---* Return all items in a ListView.
---* returns A vector of widget pointers.
---@return array_table
function ListView:getItems () end
---* brief Query the leftmost item in horizontal list
---* return An item instance.
---@return ccui.Widget
function ListView:getLeftmostItemInCurrentView () end
---* Set the margin between each item in ListView.
---* param margin A margin in float.
---@param margin float
---@return self
function ListView:setItemsMargin (margin) end
---* Get magnetic type of ListView.
---@return int
function ListView:getMagneticType () end
---* Return an item at a given index.
---* param index A given index in ssize_t.
---* return A widget instance.
---@param index int
---@return ccui.Widget
function ListView:getItem (index) end
---* Remove an item at given index.
---* param index A given index in ssize_t.
---@param index int
---@return self
function ListView:removeItem (index) end
---* Get the top padding in ListView
---* return Top padding in float
---@return float
function ListView:getTopPadding () end
---* Insert a default item(create by a cloned model) at the end of the listview.
---@return self
function ListView:pushBackDefaultItem () end
---* Change padding with left padding
---* param l Left padding in float.
---@param l float
---@return self
function ListView:setLeftPadding (l) end
---* brief Query the closest item to a specific position in inner container.
---* param targetPosition Specifies the target position in inner container's coordinates.
---* param itemAnchorPoint Specifies an anchor point of each item for position to calculate distance.
---* return An item instance if list view is not empty. Otherwise, returns null.
---@param targetPosition vec2_table
---@param itemAnchorPoint vec2_table
---@return ccui.Widget
function ListView:getClosestItemToPosition (targetPosition,itemAnchorPoint) end
---* Change padding with bottom padding
---* param b Bottom padding in float
---@param b float
---@return self
function ListView:setBottomPadding (b) end
---* Set the time in seconds to scroll between items.
---* Subsequent calls of function 'scrollToItem', will take 'time' seconds for scrolling.
---* param time The seconds needed to scroll between two items. 'time' must be >= 0
---* see scrollToItem(ssize_t, const Vec2&, const Vec2&)
---@param time float
---@return self
function ListView:setScrollDuration (time) end
---* brief Query the closest item to a specific position in current view.
---* For instance, to find the item in the center of view, call 'getClosestItemToPositionInCurrentView(Vec2::ANCHOR_MIDDLE, Vec2::ANCHOR_MIDDLE)'.
---* param positionRatioInView Specifies the target position with ratio in list view's content size.
---* param itemAnchorPoint Specifies an anchor point of each item for position to calculate distance.
---* return An item instance if list view is not empty. Otherwise, returns null.
---@param positionRatioInView vec2_table
---@param itemAnchorPoint vec2_table
---@return ccui.Widget
function ListView:getClosestItemToPositionInCurrentView (positionRatioInView,itemAnchorPoint) end
---* brief Query the rightmost item in horizontal list
---* return An item instance.
---@return ccui.Widget
function ListView:getRightmostItemInCurrentView () end
---* Change padding with right padding
---* param r Right padding in float
---@param r float
---@return self
function ListView:setRightPadding (r) end
---* Set an item model for listview.
---* When calling `pushBackDefaultItem`, the model will be used as a blueprint and new model copy will be inserted into ListView.
---* param model Model in `Widget*`.
---@param model ccui.Widget
---@return self
function ListView:setItemModel (model) end
---* Get the bottom padding in ListView
---* return Bottom padding in float
---@return float
function ListView:getBottomPadding () end
---* brief Insert a custom widget into ListView at a given index.
---* param item A widget pointer to be inserted.
---* param index A given index in ssize_t.
---@param item ccui.Widget
---@param index int
---@return self
function ListView:insertCustomItem (item,index) end
---* Create an empty ListView.
---* return A ListView instance.
---@return self
function ListView:create () end
---*
---@return cc.Ref
function ListView:createInstance () end
---@overload fun(cc.Node:cc.Node,int:int):self
---@overload fun(cc.Node:cc.Node):self
---@overload fun(cc.Node:cc.Node,int:int,string2:int):self
---@overload fun(cc.Node:cc.Node,int:int,string:string):self
---@param child cc.Node
---@param zOrder int
---@param name string
---@return self
function ListView:addChild (child,zOrder,name) end
---* Override functions
---@return self
function ListView:jumpToBottom () end
---*
---@return boolean
function ListView:init () end
---* Changes scroll direction of scrollview.
---* Direction Direction::VERTICAL means vertical scroll, Direction::HORIZONTAL means horizontal scroll.
---* param dir Set the list view's scroll direction.
---@param dir int
---@return self
function ListView:setDirection (dir) end
---*
---@return self
function ListView:jumpToTopRight () end
---*
---@return self
function ListView:jumpToLeft () end
---*
---@param cleanup boolean
---@return self
function ListView:removeAllChildrenWithCleanup (cleanup) end
---*
---@return self
function ListView:requestDoLayout () end
---*
---@return self
function ListView:removeAllChildren () end
---*
---@return self
function ListView:jumpToTopLeft () end
---*
---@param child cc.Node
---@param cleanup boolean
---@return self
function ListView:removeChild (child,cleanup) end
---*
---@return self
function ListView:jumpToBottomRight () end
---*
---@return self
function ListView:jumpToTop () end
---*
---@return self
function ListView:jumpToBottomLeft () end
---*
---@param percent vec2_table
---@return self
function ListView:jumpToPercentBothDirection (percent) end
---*
---@param percent float
---@return self
function ListView:jumpToPercentHorizontal (percent) end
---*
---@return self
function ListView:jumpToRight () end
---*
---@return string
function ListView:getDescription () end
---*
---@param percent float
---@return self
function ListView:jumpToPercentVertical (percent) end
---* Default constructor
---* js ctor
---* lua new
---@return self
function ListView:ListView () end