---
--- Generated by MLN Team (https://www.immomo.com)
--- Created by MLN Team.
--- DateTime: 15-01-2020 17:35
---

---
---  数据源及事件回调适配器
---
---
---  数据源方法
---
---@note  继承了CollectionViewAdapter所有方法
---@class WaterfallAdapter @parent class
---@public field name string 
---@type WaterfallAdapter
local _class = {
	_priveta_class_name = "WaterfallAdapter"}

---
---  构造方法
---
---
---  返回适配器的实例对象
---
---@return WaterfallAdapter 
function WaterfallAdapter()
	return _class
end

---
---  设置初始化Header的回调
---
---@param callback fun(header:table):void
---	 function(table header) ... end 
---		 header: 视图header, 类型为Lua中的table，表中仅存在一个元素contentView
---@return WaterfallAdapter 
---@note  WaterfallView 只有一个header
function _class:initHeader(callback)
	return self
end

---
---  设置初始化header数据的回调
---
---@param callback fun(header:table, section:number, row:number):void
---	 function(table header, number section, number row) ... end 
---		 header: 视图header, 类型为Lua中的table，表中仅存在一个元素contentView 
---		 section&row:header的section以及row
---@return WaterfallAdapter 
---@note  WaterfallView 只有一个header
function _class:fillHeaderData(callback)
	return self
end

---
---  回调header高度
---
---
---  回调首个header高度，WaterfallView只能有一个header
---
---@param callback fun(section:number):void
---	 回调格式：
---		 ``` 
---		 function(number section) 
---		 	 ---section: 分组数 
---		  end
---		```
---@return WaterfallAdapter 
---@note  用的时候记得这些参数索引都是从1开始
function _class:heightForHeader(callback)
	return self
end

---
---  回调header是否有效
---
---
---  回调首个header高度，WaterfallView只能有一个header
---
---@param callback fun(section:number):void
---	 回调格式：
---		 ``` 
---		 function(number section) 
---		 	 ---section: 分组数 
---		  	 return true or false 
---		 end
---		```
---@return WaterfallAdapter 
function _class:headerValid(callback)
	return self
end

---
---  回调cell高度
---
---
---  根据组数和行数，回调每个Item的高度
---
---@param callback fun(section:number, row:number):void
---	 回调格式：
---		 ``` 
---		 function(number section, number row) 
---		 	 ---section: 分组数 
---		 	 ---row:行数 
---		 end
---		```
---@return WaterfallAdapter 
---@note  用的时候记得这些参数索引都是从1开始
function _class:heightForCell(callback)
	return self
end

---
---  header视图将要显示的回调
---
---
---  header将要展示时候的回调，回调没有任何参数
---
---@param callback fun():void
---	 回调格式：
---		 ``` 
---		 function() 
---		 end
---		```
---@return WaterfallAdapter 
function _class:headerWillAppear(callback)
	return self
end

---
---  header已经消失的回调
---
---
---  header已经消失的回调
---
---@param callback fun():void
---	 回调格式：
---		 ``` 
---		 function() 
---		 end
---		```
---@return WaterfallAdapter 
function _class:headerDidDisappear(callback)
	return self
end

---
---  设置section数量回调
---
---@param sectionCountCallback fun():void
---	 function()...end
---@return WaterfallAdapter 
function _class:sectionCount(sectionCountCallback)
	return self
end

---
---  根据section设置row数量回调
---
---@param rowCountCallback fun(section:number):void
---	 function(number section) ... end
---@return WaterfallAdapter 
function _class:rowCount(rowCountCallback)
	return self
end

---
---  设置不同类型cell的id回调
---
---@param reuseIdCallback fun(section:number, row:number):void
---	 function(number section, number row) ... end 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
---@note  当存在多种类型cell时，reuseId方法与initCellByReusedId、fillCellDataByReuseId等方法配合使用
function _class:reuseId(reuseIdCallback)
	return self
end

---
---  根据reuseId设置初始化cell的回调
---
---@param reuseId string  reuseId:cell类型
---@param initCellByReuseIdCallback fun(cell:table):void
---	 function(table cell) ... end 
---		 cell: 视图cell
---@return WaterfallAdapter 
---@note  当存在多种类型cell时，此方法与reuseId方法配合使用；注意：方法中获取cell中控件宽/高是不准确的
function _class:initCellByReuseId(reuseId, initCellByReuseIdCallback)
	return self
end

---
---  根据reuseId设置初始化cell数据的回调
---
---@param reuseId string  reuseId:cell类型
---@param fillCellDataByReuseIdCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
---@note  当存在多种类型cell时，此方法与reuseId方法配合使用;注意：方法中获取cell中控件宽/高是不准确的
function _class:fillCellDataByReuseId(reuseId, fillCellDataByReuseIdCallback)
	return self
end

---
---  设置初始化cell的回调
---
---@param initCellCallback fun(cell:table):void
---	 function(table cell) ... end 
---		 cell: 视图cell
---@return WaterfallAdapter 
---@note  当仅存在一种cell时，使用此方法；注意：方法中获取cell中控件宽/高是不准确的
function _class:initCell(initCellCallback)
	return self
end

---
---  设置初始化cell数据的回调
---
---@param fillCellDataCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
---@note  当仅存在一种cell时，使用此方法；注意：方法中获取cell中控件宽/高是不准确的
function _class:fillCellData(fillCellDataCallback)
	return self
end

---
---  根据reuseid设置点击cell的回调
---
---@param reuseId string  reuseId: cell类型
---@param selectedRowByReuseIdCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
function _class:selectedRowByReuseId(reuseId, selectedRowByReuseIdCallback)
	return self
end

---
---  设置点击cell的回调
---
---@param selectedRowCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
function _class:selectedRow(selectedRowCallback)
	return self
end

---
---  设置某个reuseID对应cell的长按回调
---
---
---  设置某个reuseID对应cell的长按回调,触发时长0.5s
---
---@param reuseId string  reuseId：复用ID
---@param longPressRowByReuseIdCallback fun(cell:table, section:number, row:number):void
---	 回调格式：
---		 ``` 
---		 function(table cell,number section,number row) 
---		 	 ---cell：cell视图表, 类型为Lua中的table，表中仅存在一个元素contentView 
---		 	 ---section：组数 
---		 	 ---row：行数 
---		 end
---		```
---@return WaterfallAdapter 
function _class:longPressRowByReuseId(reuseId, longPressRowByReuseIdCallback)
	return self
end

---
---  设置cell的长按回调
---
---
---  设置cell的长按回调,触发时长0.5s
---
---@param longPressRowCallback fun(cell:table, section:number, row:number):void
---	 回调格式：
---		 ``` 
---		 function(table cell,number section,number row) 
---		 	 ---cell：cell视图表, 类型为Lua中的table，表中仅存在一个元素contentView 
---		 	 ---section：组数 
---		 	 ---row：行数 
---		 end
---		```
---@return WaterfallAdapter 
function _class:longPressRow(longPressRowCallback)
	return self
end

---
---  设置cell大小的回调
---
---@param sizeForCellCallback fun(section:number, row:number):void
---	 function(number section, number row) ... end 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
function _class:sizeForCell(sizeForCellCallback)
	return self
end

---
---  根据reuseid设置cell大小的回调
---
---@param reuseId string  reuseId:cell类型
---@param sizeForCellByReuseIdCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
function _class:sizeForCellByReuseId(reuseId, sizeForCellByReuseIdCallback)
	return self
end

---
---  设置cell将要显示的回调
---
---@param appearCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
function _class:cellWillAppear(appearCallback)
	return self
end

---
---  设置cell消失回调
---
---@param disappearCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
function _class:cellDidDisappear(disappearCallback)
	return self
end

---
---  设置指定类型cell将要显示的回调
---
---@param reuseId string  reuseId:重用Id 
---@param appearByReuseIdCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
function _class:cellWillAppearByReuseId(reuseId, appearByReuseIdCallback)
	return self
end

---
---  设置指定类型cell消失回调
---
---@param reuseId string  reuseId:重用Id 
---@param disappearByReuseIdCallback fun(cell:table, section:number, row:number):void
---	 function(table cell, number section, number row) ... end 
---		 cell: 视图cell 
---		 section&row:cell的section以及row
---@return WaterfallAdapter 
function _class:cellDidDisappearByReuseId(reuseId, disappearByReuseIdCallback)
	return self
end

return _class