ZFFramework
Loading...
Searching...
No Matches
ZFUIListView Class Reference

list view that layout children in linear by specified orientation More...

#include <ZFUIListView.h>

Inheritance diagram for ZFUIListView:
ZFUIScrollView ZFUIView ZFStyle ZFObject ZFStyleable ZFSerializable ZFCopyable ZFInterface ZFInterface ZFInterface

Public Types

enum  
Public Types inherited from ZFUIScrollView
enum  
Public Types inherited from ZFUIView
enum  
Public Types inherited from ZFStyle
enum  
Public Types inherited from ZFObject
enum  

Public Member Functions

virtual const ZFClassclassData (void)
 get instance's class info
virtual zfanyT< ZFUICellAdapter > & cellAdapter ()
 list adapter
virtual void cellAdapter (zfanyT< ZFUICellAdapter > const &propertyValue)
 see cellAdapter
virtual void cellAdapterAutoRetain (ZFUICellAdapter *cellAdapter)
 set and retain the list adapter
virtual zfboolcellAdapterSerializable ()
 whether the cellAdapter is serializable, false by default
virtual void cellAdapterSerializable (zfbool const &propertyValue)
 see cellAdapterSerializable
virtual zfanyT< ZFArray > const & cellUpdater ()
 list updater to update list cells, holds ZFUICellUpdater
virtual ZFUIOrientationorientation ()
 direction to layout children, v_ZFUIOrientation::e_Top by default
virtual void orientation (ZFUIOrientation const &propertyValue)
 see orientation
virtual zfboolbounceable ()
 whether auto update ZFUIScrollView::scrollBounceVertical series according to orientation, true by default
virtual void bounceable (zfbool const &propertyValue)
 see bounceable
virtual void reload ()
 reload entire list cells
virtual zfbool reloadRequested ()
 true if list need reload
virtual void reloadCellAt (zfindex index)
 reload cell at index immediately, do nothing if index not in visible range or reloadRequested
virtual ZFCoreArray< ZFUICell * > visibleCells ()
 return a list of current visible cells, valid only if reloadRequested is not true
virtual const ZFIndexRangevisibleCellRange ()
 return first visible cell's index, valid only if reloadRequested is not true
virtual void scrollCellToHead (zfindex cellIndex, zffloat offset=(0), zfbool animated=(_ZFT_t_zftrue))
 scroll cell to top, do nothing if invalid or no need to scroll
virtual void scrollCellToTail (zfindex cellIndex, zffloat offset=(0), zfbool animated=(_ZFT_t_zftrue))
 scroll cell to bottom, see scrollCellToHead
Public Member Functions inherited from ZFUIScrollView
virtual zfboolscrollEnable ()
 whether the scroll view is scrollable, zftrue by default
virtual void scrollEnable (zfbool const &propertyValue)
 see scrollEnable
virtual zfboolscrollBounceHorizontal ()
 if content is larger than scroll view, make it scrollable even if reaches edge, true by default
virtual void scrollBounceHorizontal (zfbool const &propertyValue)
 see scrollBounceHorizontal
virtual zfboolscrollBounceVertical ()
 if content is larger than scroll view, make it scrollable even if reaches edge, true by default
virtual void scrollBounceVertical (zfbool const &propertyValue)
 see scrollBounceVertical
virtual zfboolscrollBounceHorizontalAlways ()
 scrollable even if content is not larger than scrollview, false by default
virtual void scrollBounceHorizontalAlways (zfbool const &propertyValue)
 see scrollBounceHorizontalAlways
virtual zfboolscrollBounceVerticalAlways ()
 scrollable even if content is not larger than scrollview, false by default
virtual void scrollBounceVerticalAlways (zfbool const &propertyValue)
 see scrollBounceVerticalAlways
virtual zfboolscrollAlignToAxis ()
 whether limit scroll horizontal or vertical only, false by default
virtual void scrollAlignToAxis (zfbool const &propertyValue)
 see scrollAlignToAxis
virtual zfboolscrollAlignToPageHorizontal ()
 whether align to page when scroll, false by default
virtual void scrollAlignToPageHorizontal (zfbool const &propertyValue)
 see scrollAlignToPageHorizontal
virtual zfboolscrollAlignToPageVertical ()
 whether align to page when scroll, false by default
virtual void scrollAlignToPageVertical (zfbool const &propertyValue)
 see scrollAlignToPageVertical
virtual ZFUIRectscrollContentFrame ()
 scroll view's content frame
virtual void scrollContentFrame (ZFUIRect const &propertyValue)
 see scrollContentFrame
virtual void scrollToFitRange ()
 cancel over scroll and ensure content offset in range
virtual void scrollChildToVisible (ZFUIView *child, const ZFUIMargin &margin=(ZFUIMarginCreate(ZFUIGlobalStyle::DefaultStyle() ->itemMargin())), zfbool scrollWithAni=(_ZFT_t_zftrue))
 scroll child to proper position so that it's visible to user
virtual void scrollAreaMarginAdd (const ZFUIMargin &margin)
 margin for impl to modify scrollable area, ZFUIMarginZero by default
virtual void scrollAreaMarginRemove (const ZFUIMargin &margin)
 see scrollAreaMarginAdd
virtual const ZFUIMarginscrollAreaMargin ()
 see scrollAreaMarginAdd
virtual const ZFUIRectscrollArea ()
 scrollable frame excluding scrollAreaMargin, valid only if layouted
virtual void scrollThumbHorizontalClass (const ZFClass *cls)
 change current scroll thumb, null to disable
virtual const ZFClassscrollThumbHorizontalClass ()
 see scrollThumbHorizontalClass
virtual void scrollThumbVerticalClass (const ZFClass *cls)
 see scrollThumbHorizontalClass
virtual const ZFClassscrollThumbVerticalClass ()
 see scrollThumbHorizontalClass
virtual const ZFClassscrollerClass ()
 class for internal scroller, must be type of ZFUIScroller, ZFUIScrollerClass by default
virtual zffloat scrollContentOffsetLeft ()
 util method to get offset of the scroll content
virtual zffloat scrollContentOffsetTop ()
 see scrollContentOffsetLeft
virtual zffloat scrollContentOffsetRight ()
 see scrollContentOffsetLeft
virtual zffloat scrollContentOffsetBottom ()
 see scrollContentOffsetLeft
virtual void scrollContentFrameAnimated (const ZFUIRect &scrollContentFrame)
 animated change scroll content frame
virtual void scrollContentFrameUpdate (const ZFUIRect &scrollContentFrame)
 change scroll content frame without interrupt current scroll animation
virtual void scrollByPoint (zffloat xPos, zffloat yPos)
 animated scroll to desired position
virtual ZFUIPoint scrollByPointEndPoint ()
 return end point of scrollByPoint, or current content offset if not scrolling
virtual void scrollBySpeed (zffloat xSpeedInPixelsPerSecond, zffloat ySpeedInPixelsPerSecond)
 scroll by desired initial speed, in pixels per second
virtual zffloat scrollBySpeedCurrentSpeedX ()
 return current speed of scrollBySpeed
virtual zffloat scrollBySpeedCurrentSpeedY ()
 return current speed of scrollBySpeed
virtual ZFUIPoint scrollBySpeedEndPointPredicted ()
 return predicted end point of scrollBySpeed, or current content offset if not scrolling, valid only if isn't bouncing and won't bouncing when stop
virtual ZFUIPoint scrollEndPointPredicted ()
 scrollByPointEndPoint or scrollBySpeedEndPointPredicted depending on scroll type
virtual void autoScrollStartX (zffloat speedInPixelsPerSecond)
 start an auto scroll with specified speed
virtual void autoScrollStartY (zffloat speedInPixelsPerSecond)
 see autoScrollStartX
virtual void autoScrollStopX ()
 see autoScrollStartX
virtual void autoScrollStopY ()
 see autoScrollStartX
virtual zffloat autoScrollSpeedX ()
 current auto scroll speed, 0 means not auto scrolling, see autoScrollStartX
virtual zffloat autoScrollSpeedY ()
 current auto scroll speed, 0 means not auto scrolling, see autoScrollStartX
virtual void scrollSimulateDragBegin (const ZFUIPoint &mousePos, zftimet mouseTime)
 simulate drag
virtual void scrollSimulateDrag (const ZFUIPoint &mousePos, zftimet mouseTime)
 simulate drag
virtual void scrollSimulateDragEnd (zftimet mouseTime, zfbool needScrollAni=(_ZFT_t_zftrue))
 simulate drag
virtual ZFUIScrollViewState scrollViewState ()
 current state for the scroll view
Public Member Functions inherited from ZFUIView
virtual void serializableRefLayoutParam (ZFUILayoutParam *serializableRefLayoutParam)
 store ref layout param for this view for reducing serialization output size
virtual ZFUILayoutParamserializableRefLayoutParam (void)
 see serializableRefLayoutParam
virtual zfstringviewId ()
 used to identify a view, empty by default
virtual void viewId (zfstring const &propertyValue)
 see viewId
virtual zfboolvisible ()
 visible or not, zftrue by default
virtual void visible (zfbool const &propertyValue)
 see visible
virtual zfbool viewTreeInWindow ()
 true if added to ZFUIRootWindow
virtual zfbool viewTreeVisible ()
 true only if added to ZFUIRootWindow and all of parents are visible
virtual zffloatalpha ()
 view's alpha, 1 by default
virtual void alpha (zffloat const &propertyValue)
 see alpha
virtual zfboolviewUIEnable ()
 whether the view should receive user interaction (doesn't affect children, see viewUIEnableTree)
virtual void viewUIEnable (zfbool const &propertyValue)
 see viewUIEnable
virtual zfboolviewUIEnableTree ()
 whether the view as well as all its children should receive user interaction, see viewUIEnable
virtual void viewUIEnableTree (zfbool const &propertyValue)
 see viewUIEnableTree
virtual zfbool viewUIEnableFixed ()
 true if viewUIEnable and all of parents are viewUIEnableTree
virtual zfbool viewUIEnableTreeFixed ()
 true if viewUIEnableTree and all of parents are viewUIEnableTree
virtual zfboolmouseHoverEnable ()
 whether enable mouse hover event, see ZFUIView::viewEventOnMouseEvent, false by default
virtual void mouseHoverEnable (zfbool const &propertyValue)
 see mouseHoverEnable
virtual zfboolfocusable ()
 whether the view can be focused, false by default
virtual void focusable (zfbool const &propertyValue)
 see focusable
virtual zfboolfocusObtainWhenClick ()
 whether try to obtain focus when clicked down, true by default
virtual void focusObtainWhenClick (zfbool const &propertyValue)
 see focusObtainWhenClick
virtual ZFUIRect const & viewFrame ()
 the view's frame
virtual void viewFrame (ZFUIRect const &viewFrame)
 see viewFrame
virtual const ZFUIRectviewFramePrev ()
 previous viewFrame
virtual zfbool viewFrameOverrided ()
 true if viewFrame changed by user, use viewFrameReset to reset
virtual void viewFrameReset ()
 see viewFrame
virtual zffloat x ()
 see viewFrame
virtual void x (zffloat const &propertyValue)
 see viewFrame
virtual zffloat y ()
 see viewFrame
virtual void y (zffloat const &propertyValue)
 see viewFrame
virtual zffloat width ()
 see viewFrame
virtual void width (zffloat const &propertyValue)
 see viewFrame
virtual zffloat height ()
 see viewFrame
virtual void height (zffloat const &propertyValue)
 see viewFrame
virtual zffloat centerX ()
 see viewFrame
virtual void centerX (zffloat const &propertyValue)
 see viewFrame
virtual zffloat centerY ()
 see viewFrame
virtual void centerY (zffloat const &propertyValue)
 see viewFrame
virtual void viewSizeFixed (const ZFUISize &size)
 util method to set fixed size, by setting both of viewSizeMin and viewSizeMax
virtual void viewSizeFixed (zffloat width, zffloat height)
 see viewSizeFixed
virtual ZFUISizeviewSizeMin ()
 min size, ZFUISizeZero by default
virtual void viewSizeMin (ZFUISize const &propertyValue)
 see viewSizeMin
virtual ZFUISizeviewSizeMax ()
 max size, negative value means not set, ZFUISizeInvalid by default
virtual void viewSizeMax (ZFUISize const &propertyValue)
 see viewSizeMax
virtual ZFUIColorbgColor ()
 background color, ZFUIColorZero by default
virtual void bgColor (ZFUIColor const &propertyValue)
 see bgColor
virtual zffloattranslateX ()
 see transformAvailable
virtual void translateX (zffloat const &propertyValue)
 see translateX
virtual zffloattranslateY ()
 see transformAvailable
virtual void translateY (zffloat const &propertyValue)
 see translateY
virtual zffloattranslateZ ()
 see transformAvailable
virtual void translateZ (zffloat const &propertyValue)
 see translateZ
virtual zffloatscaleX ()
 see transformAvailable
virtual void scaleX (zffloat const &propertyValue)
 see scaleX
virtual zffloatscaleY ()
 see transformAvailable
virtual void scaleY (zffloat const &propertyValue)
 see scaleY
virtual zffloatscaleZ ()
 see transformAvailable
virtual void scaleZ (zffloat const &propertyValue)
 see scaleZ
virtual zffloatrotateX ()
 see transformAvailable
virtual void rotateX (zffloat const &propertyValue)
 see rotateX
virtual zffloatrotateY ()
 see transformAvailable
virtual void rotateY (zffloat const &propertyValue)
 see rotateY
virtual zffloatrotateZ ()
 see transformAvailable
virtual void rotateZ (zffloat const &propertyValue)
 see rotateZ
virtual void bind (ZFObject *owner, const zfstring &propertyName)
 util method to bind this view to owner's property, and auto setup viewId if not set
virtual void bindEvent (const zfstring &eventName, ZFObject *owner, const zfstring &methodName)
 util method to bind this view's event to owner's method
virtual void bindEvent (zfidentity eventId, ZFObject *owner, const zfstring &methodName)
 util method to bind this view's event to owner's method, see bindEvent
virtual void * nativeImplView ()
 native implementation view
virtual const ZFUIMarginnativeImplViewMargin ()
 inner margin between ZFUIView and the internal nativeImplView
virtual void nativeImplViewMarginUpdate ()
 see nativeImplViewMargin, layoutRequest if the final value actually changed
virtual const ZFUIRectnativeImplViewFrame ()
 frame of nativeImplView
virtual void * nativeView ()
 native container view
virtual zfbool focused ()
 whether the view currently focused
virtual void focusRequest (zfbool focus)
 request to obtain or resign focus, result can be checked by focused
virtual zfanyT< ZFUIViewfocusFind ()
 recursively to find focused child, take care of performance
virtual zfanyT< ZFUIViewparent ()
 parent view or null if none
virtual void removeFromParent ()
 remove this view from parent or do nothing if no parent
virtual zffloatUIScale ()
 UI scale for view tree.
virtual void UIScale (zffloat const &propertyValue)
 see UIScale
virtual zffloat UIScaleInherited ()
 see UIScale
virtual zffloat UIScaleForImpl ()
 see UIScale
virtual zffloat UIScaleForPixel ()
 see UIScale
virtual zffloat UIScaleFixed ()
 see UIScale
virtual zfautoT< ZFUILayoutParamlayoutParamCreate ()
 create layout param, calling layoutParamClass to create instance and layoutParamOnUpdate to update
virtual void layoutParam (ZFUILayoutParam *layoutParam)
 manually set layout param
virtual zfanyT< ZFUILayoutParamlayoutParam ()
 get self's layout param, valid only while the view has parent
virtual void layoutRequest ()
 set need layout
virtual zfbool layoutRequested ()
 true if need layout
virtual zfbool layouting ()
 true if currently being layouted
virtual const ZFUISizelayoutMeasure (const ZFUISize &sizeHintOrig, const ZFUISizeParam &sizeParam)
 measure the view
virtual const ZFUISizelayoutMeasuredSize ()
 get measured size, invalid if not measured
virtual void layoutIfNeed ()
 force to layout if need
virtual ZFUIPoint layoutChildOffset ()
 get child offset to this view
virtual zfanyT< ZFUIViewchildFindById (const zfstring &viewId, zfbool findRecursively=(_ZFT_t_zftrue), zfbool includeInternalViews=(_ZFT_t_zffalse))
 find view by viewId, return the view or null if not found
virtual zfanyT< ZFUIViewchildFindByClass (const ZFClass *cls, zfbool findRecursively=(_ZFT_t_zftrue), zfbool includeInternalViews=(_ZFT_t_zffalse))
 find view by class, return the view or null if not found
virtual zfauto childForEach (const ZFListener &impl, zfbool findRecursively=(_ZFT_t_zftrue), zfbool includeInternalViews=(_ZFT_t_zffalse))
 call custom impl for each child
virtual zfanyT< ZFUILayoutParamchildWithParam (ZFUIView *view, ZFUILayoutParam *layoutParam, zfindex atIndex=(((zfindex) -1)))
 add view with layout param, param must be created by layoutParamCreate
zfanyT< ZFUILayoutParamchild (const zfany &view, zfindex atIndex=((zfindex) -1))
 add child and return child's layoutParam, see childWithParam
virtual void childRemove (ZFUIView *view)
 remove view or do nothing if view isn't added to this view
virtual void childRemoveAt (zfindex index)
 remove view at index or assert fail if index out of range
virtual void childRemoveAll ()
 remove all child view
virtual void childMove (zfindex fromIndex, zfindex toIndexOrIndexMax)
 move view, make toIndexOrIndexMax as zfindexMax() to move to top most, and 0 to bottom most, do nothing if index invalid or have no change
virtual void childMove (ZFUIView *child, zfindex toIndexOrIndexMax)
 see childMove
virtual void childReplaceAt (zfindex atIndex, ZFUIView *toReplace)
 replace child at index, assert fail if index out of range or view to replace already has parent
virtual zfindex childCount ()
 get child view count
virtual zfanyT< ZFUIViewchildAt (zfindex index)
 get child view at index or assert fail if out of range
virtual zfindex childFind (ZFUIView *view)
 return index of view or zfindexMax() if not child of this view
virtual ZFCoreArray< zfautoT< ZFUIView > > childArray ()
 get the child view array
virtual ZFUIViewChildLayer viewLayer ()
 this view belongs to which layer of parent, valid only if parent is not null
virtual ZFCoreArray< zfautoT< ZFUIView > > childRawArray ()
 return all children including internal views, see childArray
virtual zfanyT< ZFUILayoutParaminternalImplViewAdd (ZFUIView *view, ZFUILayoutParam *layoutParam=(zft_zfnull), zfbool addAsTopMost=(_ZFT_t_zftrue))
 see internalBgViewAdd
virtual void internalImplViewRemove (ZFUIView *view)
 see internalBgViewAdd
virtual ZFCoreArray< zfautoT< ZFUIView > > internalImplViewArray ()
 see internalBgViewAdd
virtual zfanyT< ZFUILayoutParaminternalBgViewAdd (ZFUIView *view, ZFUILayoutParam *layoutParam=(zft_zfnull), zfbool addAsTopMost=(_ZFT_t_zftrue))
 internal view which is independent from normal view
virtual void internalBgViewRemove (ZFUIView *view)
 see internalBgViewAdd
virtual ZFCoreArray< zfautoT< ZFUIView > > internalBgViewArray ()
 usually for debug use only, try to avoid use this in your app for other purpose
virtual zfanyT< ZFUILayoutParaminternalFgViewAdd (ZFUIView *view, ZFUILayoutParam *layoutParam=(zft_zfnull), zfbool addAsTopMost=(_ZFT_t_zftrue))
 see internalBgViewAdd
virtual void internalFgViewRemove (ZFUIView *view)
 see internalBgViewAdd
virtual ZFCoreArray< zfautoT< ZFUIView > > internalFgViewArray ()
 see internalBgViewAdd
virtual void internalViewAutoSerializeTagAdd (const zfstring &tag)
 used to apply auto serialize logic to internal views
virtual void internalViewAutoSerializeTagRemove (const zfstring &tag)
 see internalViewAutoSerializeTagAdd
virtual void internalViewAutoSerializeTagRemoveAll ()
 see internalViewAutoSerializeTagAdd
virtual void internalViewAutoSerializeTagGetAllT (ZFCoreArray< zfstring > &ret)
 see internalViewAutoSerializeTagAdd
virtual ZFCoreArray< zfstringinternalViewAutoSerializeTagGetAll ()
 see internalViewAutoSerializeTagAdd
virtual void viewEventSend (ZFUIEvent *event)
 directly send a event, use with caution
Public Member Functions inherited from ZFObject
const ZFClassclassDynamic (void)
 dynamic class of this object, see ZFClassDynamicRegister
zfindex objectRetainCount (void)
 return the object's retain count
void objectInfoOfInstanceT (zfstring &ret)
 see objectInfoOfInstance
zfstring objectInfoOfInstance (void)
 return a short string describe the object instance
void objectInfoT (zfstring &ret)
 see objectInfo
zfstring objectInfo (void)
 return object info
zfidentity objectHash (void)
 get hash of this object
ZFCompareResult objectCompare (ZFObject *anotherObj)
 compare with anotherObj
ZFCompareResult objectCompareValue (ZFObject *anotherObj)
 explicitly compare object by logical value, see objectCompare
virtual zfauto invoke (const zfstring &methodName)
 util method to perform ZFDI_invoke, do nothing if fail
virtual zfauto invoke (const zfstring &methodName, ZFObject *param0, ZFObject *param1=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param2=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param3=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param4=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param5=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param6=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param7=((ZFObject *const &) _ZFP_ZFMP_DEF))
 util method to perform ZFDI_invoke, do nothing if fail
virtual zfbool invokeT (zfauto &ret, zfstring *errorHint, const zfstring &methodName, ZFObject *param0=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param1=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param2=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param3=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param4=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param5=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param6=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param7=((ZFObject *const &) _ZFP_ZFMP_DEF))
 util method to perform ZFDI_invoke, do nothing if fail
virtual zfauto invokeDetail (const zfstring &methodName, const ZFCoreArray< zfauto > &params, zfbool *success=zft_zfnull, zfstring *errorHint=zft_zfnull)
 util method to perform ZFDI_invoke, do nothing if fail
zfbool objectTagExist (void)
 see objectTag, true if this object has tag, and tag can be checked by objectTagGetAllKeyValue
void objectTag (const zfstring &key, ZFObject *tag)
 used to hold a object for app's use, auto retained
zfany objectTag (const zfstring &key)
 see objectTag
void objectTagGetAllKeyValue (ZFCoreArray< zfstring > &allKey, ZFCoreArray< zfauto > &allValue)
 get all key value
void objectTagRemove (const zfstring &key)
 remove tag, same as set tag to null
zfauto objectTagRemoveAndGet (const zfstring &key)
 remove tag, return removed tag or null if not exist
void objectTagRemoveAll (void)
 remove all tag
void observerAdd (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 see observerNotify
void observerAddForOnce (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 see observerNotify
void observerRemove (zfidentity eventId, const ZFListener &callback)
 see observerNotify
void observerRemoveAll (zfidentity eventId)
 see observerNotify
void observerRemoveAll (void)
 see observerNotify
zfbool observerHasAdd (void)
 true if any observer has been added
zfbool observerHasAdd (zfidentity eventId)
 true if any observer with eventId has been added
void observerNotify (zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
 notify the observer with eventId
void observerNotifyWithSender (ZFObject *customSender, zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
 see observerNotify
void observerNotifyReversely (zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
 see observerNotify
void observerNotifyReverselyWithSender (ZFObject *customSender, zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
 see observerNotify
ZFObserverobserverHolder (void)
 access the internal observer holder
void on (const zfstring &eventName, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 util to observerAdd
void on (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 util to observerAdd
void onInit (const ZFListener &impl)
 util for script to achieve chained call
void onDealloc (const ZFListener &impl)
 util for script to achieve chained call
zfbool objectInstanceStateCheck (ZFObjectInstanceState state)
 object instance's state
zfbool objectInitRunning (void)
 util method to check whether ZFObjectInstanceStateOnInit or ZFObjectInstanceStateOnInitFinish running
zfbool objectDeallocRunning (void)
 util method to check whether ZFObjectInstanceStateOnDeallocPrepare or ZFObjectInstanceStateOnDealloc running
virtual zfbool objectIsInternal (void)
 whether this object is internal object or its class is ZFClass::classIsInternal
virtual zfbool objectIsInternalPrivate (void)
 whether this object is internal private object or its class is ZFClass::classIsInternalPrivate
Public Member Functions inherited from ZFStyleable
virtual zfanyT< ZFStyleabledefaultStyle (void)
 return default style of this instance
void styleableCopyFrom (ZFObject *anotherStyleable)
 copy style from another styleable, see ZFStyleable
virtual zfbool styleableIsDefaultStyle (void)
 true if this object is defaultStyle
void styleablePropertyGetAllT (ZFCoreArray< const ZFProperty * > &ret)
 return a list of styleable property, for debug use only
ZFCoreArray< const ZFProperty * > styleablePropertyGetAll (void)
 return a list of styleable property, for debug use only
void styleKey (const zfstring &styleKey)
 see ZFStyleSet
const zfstringstyleKey (void)
 see ZFStyleSet
void propStyle (const zfstring &propertyName, const zfstring &styleKey)
 see ZFStyleSet
const zfstringpropStyle (const zfstring &propertyName)
 see ZFStyleSet
Public Member Functions inherited from ZFInterface
virtual ZFObjecttoObject (void)=0
 convert to ZFObject type
Public Member Functions inherited from ZFSerializable
zfbool serializable (void)
 true if object is currently serializable, see ZFSerializable
zfbool serializeFromData (const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 serialize from data, see ZFSerializable
zfbool serializeToData (ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
 serialize to data, see ZFSerializable
zfbool serializeFromString (const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 serialize from string, return false by default
zfbool serializeToString (zfstring &ret, zfstring *errorHint=zft_zfnull)
 see serializeFromString
void serializablePropertyTypeGetAll (ZFCoreArray< const ZFProperty * > &notSerializableProperty, ZFCoreArray< const ZFProperty * > &serializableProperty, ZFCoreArray< const ZFProperty * > &embededProperty)
 return a list of each type of property, for debug use only
zfstring serializablePropertyTypeInfo (void)
 return info of serializablePropertyTypeGetAll, for debug use only
void serializableGetAllSerializablePropertyT (ZFCoreArray< const ZFProperty * > &ret)
 see serializableGetAllSerializableProperty
ZFCoreArray< const ZFProperty * > serializableGetAllSerializableProperty (void)
 get all serializable property, usually for debug only, see serializableOnCheckPropertyType
void serializableGetAllSerializableEmbededPropertyT (ZFCoreArray< const ZFProperty * > &ret)
 see serializableGetAllSerializableEmbededProperty
ZFCoreArray< const ZFProperty * > serializableGetAllSerializableEmbededProperty (void)
 get all serializable embeded property, usually for debug only, see serializableOnCheckPropertyType
virtual void serializableInfoT (zfstring &ret)
 get info as a serializable
virtual zfstring serializableInfo (void)
 see serializableInfoT
Public Member Functions inherited from ZFCopyable
zfautoT< ZFCopyablecopy (void)
 return a copy of this object
void copyFrom (ZFObject *anotherObj)
 see copy, anotherObj must be same type as this object (by classData), otherwise, do nothing

Static Public Member Functions

static const ZFClassClassData (void)
 get class info
static zfanyT< ZFUIListViewDefaultStyle (void)
static zfidentity E_CellOnAttach (void)
 see ZFObject::observerNotify
static zfidentity E_CellOnDetach (void)
 see ZFObject::observerNotify
static zfidentity E_ListVisibleCellOnUpdate (void)
 see ZFObject::observerNotify
Static Public Member Functions inherited from ZFUIScrollView
static const ZFClassClassData (void)
 get class info
static zfanyT< ZFUIScrollViewDefaultStyle (void)
static zfidentity E_ScrollOnDragBegin (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollOnDrag (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollOnDragEnd (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollOnScrollBegin (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollOnScroll (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollOnScrollEnd (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollAreaOnUpdate (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollContentFrameOnUpdate (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollAutoScrollOnStart (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollAutoScrollOnStop (void)
 see ZFObject::observerNotify
static zfidentity E_ScrollOnScrolledByUser (void)
 see ZFObject::observerNotify
Static Public Member Functions inherited from ZFUIView
static const ZFClassClassData (void)
 get class info
static zfanyT< ZFUIViewDefaultStyle (void)
static zfidentity E_ViewTreeInWindowOnUpdate (void)
 see ZFObject::observerNotify
static zfidentity E_ViewTreeVisibleOnUpdate (void)
 see ZFObject::observerNotify
static zfidentity E_ViewChildOnUpdate (void)
 see ZFObject::observerNotify
static zfidentity E_ViewChildOnAdd (void)
 see ZFObject::observerNotify
static zfidentity E_ViewChildOnRemove (void)
 see ZFObject::observerNotify
static zfidentity E_ViewOnAddToParent (void)
 see ZFObject::observerNotify
static zfidentity E_ViewOnRemoveFromParent (void)
 see ZFObject::observerNotify
static zfidentity E_UIScaleOnUpdate (void)
 see ZFObject::observerNotify
static zfidentity E_ViewFocusOnUpdate (void)
 see ZFObject::observerNotify
static zfidentity E_ViewOnEvent (void)
 see ZFObject::observerNotify
static zfidentity E_ViewLayoutOnLayoutRequest (void)
 see ZFObject::observerNotify
static zfidentity E_ViewLayoutOnMeasurePrepare (void)
 see ZFObject::observerNotify
static zfidentity E_ViewLayoutOnMeasure (void)
 see ZFObject::observerNotify
static zfidentity E_ViewLayoutOnLayoutPrepare (void)
 see ZFObject::observerNotify
static zfidentity E_ViewLayoutOnLayout (void)
 see ZFObject::observerNotify
static zfidentity E_ViewLayoutOnLayoutFinish (void)
 see ZFObject::observerNotify
static zfidentity E_NativeImplViewMarginOnUpdate (void)
 see ZFObject::observerNotify
static ZFUITransformFlags transformAvailable ()
 whether transform is supported
Static Public Member Functions inherited from ZFStyle
static const ZFClassClassData (void)
 get class info
Static Public Member Functions inherited from ZFObject
static const ZFClassClassData (void)
 get class info
static zfidentity E_ObjectBeforeAlloc (void)
 see ZFObject::observerNotify
static zfidentity E_ObjectAfterAlloc (void)
 see ZFObject::observerNotify
static zfidentity E_ObjectBeforeDealloc (void)
 see ZFObject::observerNotify
static zfidentity E_ObjectPropertyValueOnUpdate (void)
 see ZFObject::observerNotify
static zfidentity E_ObjectPropertyValueOnReset (void)
 see ZFObject::observerNotify
Static Public Member Functions inherited from ZFStyleable
static const ZFClassClassData (void)
 get class info
Static Public Member Functions inherited from ZFInterface
static const ZFClassClassData (void)
 get class info
Static Public Member Functions inherited from ZFSerializable
static const ZFClassClassData (void)
 get class info
Static Public Member Functions inherited from ZFCopyable
static const ZFClassClassData (void)
 get class info

Protected Types

typedef ZFUIScrollView zfsuper
 class ref to super
typedef ZFUIListView zfself
 class ref to self
Protected Types inherited from ZFUIScrollView
typedef ZFUIView zfsuper
 class ref to super
typedef ZFUIScrollView zfself
 class ref to self
Protected Types inherited from ZFUIView
typedef ZFStyle zfsuper
 class ref to super
typedef ZFUIView zfself
 class ref to self
Protected Types inherited from ZFStyle
typedef ZFObject zfsuper
 class ref to super
typedef ZFStyle zfself
 class ref to self
Protected Types inherited from ZFObject
typedef _ZFP_Obj_Base zfsuper
 class ref to super
typedef ZFObject zfself
 class ref to self
Protected Types inherited from ZFStyleable
typedef ZFInterface zfsuper
 typedef for super (always ZFInterface for an interface type)
typedef ZFStyleable zfself
 typedef for self
Protected Types inherited from ZFInterface
typedef _ZFP_ObjI_Base zfsuper
 typedef for super (always ZFInterface for an interface type)
typedef ZFInterface zfself
 typedef for self
Protected Types inherited from ZFSerializable
typedef ZFInterface zfsuper
 typedef for super (always ZFInterface for an interface type)
typedef ZFSerializable zfself
 typedef for self
Protected Types inherited from ZFCopyable
typedef ZFInterface zfsuper
 typedef for super (always ZFInterface for an interface type)
typedef ZFCopyable zfself
 typedef for self

Protected Member Functions

virtual void cellUpdater (zfanyT< ZFArray > const &propertyValue)
 see cellUpdater
virtual void objectOnInit (void)
 override this to init your object
virtual void objectOnDealloc (void)
 override this to destroy your object
virtual void objectOnDeallocPrepare (void)
 called before objectOnDealloc, safe to call virtual functions here
virtual ZFSerializablePropertyType serializableOnCheckPropertyType (const ZFProperty *property)
 see ZFSerializable::serializableOnCheckPropertyType
virtual zfbool serializableOnCheckNeedSerializeChildren (void)
 all child views would be ignored from serializable
virtual zfbool serializableOnSerializeFromData (const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 for serializable data that has "category" attribute, ZFSerializable would ignore it and leave it to subclass to resolve, see ZFSerializable
virtual zfbool serializableOnSerializeToData (ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
 corresponding to serializableOnSerializeFromData, return whether the task is success, see ZFSerializable
virtual void layoutOnLayoutPrepare (const ZFUIRect &bounds)
 see E_ViewLayoutOnLayoutPrepare
virtual void layoutOnLayout (const ZFUIRect &bounds)
 override ZFUIView to layout scroll view's internal view and content view
virtual void viewChildOnAdd (ZFUIView *child, ZFUIViewChildLayer layer)
 see E_ViewChildOnAdd
virtual void viewChildOnRemove (ZFUIView *child, ZFUIViewChildLayer layer)
 see E_ViewChildOnRemove
virtual void scrollAreaOnUpdate (void)
 see E_ScrollAreaOnUpdate
virtual void scrollContentFrameOnUpdate (void)
 see E_ScrollContentFrameOnUpdate
virtual void scrollOnScrolledByUser (void)
 see E_ScrollOnScrolledByUser
virtual void scrollOnScrollEnd (void)
 see E_ScrollOnScrollEnd
virtual void cellOnAttach (ZFUICell *cell)
 see E_CellOnAttach
virtual void cellOnDetach (ZFUICell *cell)
 see E_CellOnDetach
virtual void visibleCellsOnUpdate (void)
 see E_ListVisibleCellOnUpdate
Protected Member Functions inherited from ZFUIScrollView
virtual void objectInfoImplAppend (zfstring &ret)
 see objectInfo
virtual void implChildOnAdd (ZFUIView *child, zfindex virtualIndex, ZFUIViewChildLayer childLayer, zfindex childLayerIndex)
 called to add or remove view to impl
virtual void implChildOnRemove (ZFUIView *child, zfindex virtualIndex, ZFUIViewChildLayer childLayer, zfindex childLayerIndex)
 see implChildOnAdd, implChildOnRemoveAllForDealloc
virtual void implChildOnRemoveAllForDealloc (void)
 called to remove all children during parent dealloc for performance
virtual void layoutOnLayoutFinish (const ZFUIRect &bounds)
 see E_ViewLayoutOnLayoutFinish
virtual void layoutChildOffsetOnUpdate (ZFUIPoint &ret)
 see layoutChildOffset
virtual void viewEventOnMouseEvent (ZFUIMouseEvent *mouseEvent)
 (ZFTAG_LIMITATION) due to implementations limitation, ZFUIScrollView may or may not have mouse event callbacks
virtual void viewEventOnWheelEvent (ZFUIWheelEvent *wheelEvent)
 called when wheel event occurred
virtual void nativeImplViewMarginOnUpdate (void)
 see E_NativeImplViewMarginOnUpdate
virtual void scrollThumbHorizontalOnInit (void)
 called to init scroll thumb
virtual void scrollThumbVerticalOnInit (void)
 called to init scroll thumb
void scrollOverride (zfbool scrollOverride)
 for subclass to supply advanced scroll controll
zfbool scrollOverride (void)
 see scrollOverride
virtual void scrollOnDragBegin (void)
 see E_ScrollOnDragBegin
virtual void scrollOnDrag (void)
 see E_ScrollOnDrag
virtual void scrollOnDragEnd (void)
 see E_ScrollOnDragEnd
virtual void scrollOnScrollBegin (void)
 see E_ScrollOnScrollBegin
virtual void scrollOnScroll (void)
 see E_ScrollOnScroll
virtual void scrollAutoScrollOnStart (void)
 see E_ScrollAutoScrollOnStart
virtual void scrollAutoScrollOnStop (void)
 see E_ScrollAutoScrollOnStop
Protected Member Functions inherited from ZFUIView
virtual void nativeImplView (void *nativeImplView, ZFUIViewNativeImplViewDeleteCallback nativeImplViewDeleteCallback)
 see nativeImplView
virtual void nativeImplViewMarginImplUpdate (ZFUIMargin &nativeImplViewMargin)
 see nativeImplViewMargin, subclass must call super and "append" to existing margin
virtual void nativeImplViewOnLayout (ZFUIRect &ret, const ZFUIRect &bounds, const ZFUIMargin &nativeImplViewMargin)
 called to layout nativeImplView
virtual void focusOnUpdate (void)
 see E_ViewFocusOnUpdate
virtual void UIScaleOnUpdate (void)
 see UIScale, ensured called only when scale value actually changed
virtual const ZFClasslayoutParamClass (void)
 see layoutParamCreate
virtual void layoutParamOnUpdate (ZFUILayoutParam *layoutParam)
 see layoutParamCreate
virtual void layoutOnLayoutRequest (void)
 called during layoutRequest
virtual void layoutOnMeasurePrepare (const ZFUISize &sizeHintOrig, const ZFUISizeParam &sizeParam)
 called during layoutMeasure
virtual void layoutOnMeasure (ZFUISize &ret, const ZFUISize &sizeHint, const ZFUISizeParam &sizeParam)
 called by layoutMeasure to decide the view's size
virtual void layoutOnMeasureFinish (ZFUISize &measuredSize, const ZFUISize &sizeHint, const ZFUISizeParam &sizeParam)
 see E_ViewLayoutOnMeasure
virtual void viewTreeInWindowOnUpdate (void)
 see E_ViewTreeInWindowOnUpdate
virtual void viewTreeVisibleOnUpdate (void)
 see E_ViewTreeVisibleOnUpdate
virtual void viewChildOnUpdate (void)
 see E_ViewChildOnUpdate
virtual void viewOnAddToParent (ZFUIView *parent)
 see E_ViewOnAddToParent
virtual void viewOnRemoveFromParent (ZFUIView *parent)
 see E_ViewOnRemoveFromParent
virtual zfbool internalViewShouldLayout (ZFUIView *internalView)
 called to check whether the internal view should be layouted using default layout logic, return true by default
virtual void internalViewOnLayout (const ZFUIRect &bounds)
 see internalBgViewAdd
virtual void viewEventOnEvent (ZFUIEvent *event)
 notified when a ZFUIEvent occurred
virtual void viewEventOnKeyEvent (ZFUIKeyEvent *keyEvent)
 called when key occurred
virtual void viewEventOnKeyEventResolveFocus (ZFUIKeyEvent *keyEvent)
 called by viewEventOnKeyEvent to resolve focus move key event
virtual void styleableOnCopyFrom (ZFObject *anotherStyleable)
 for a view, copy style would also copy all of it's children
virtual void observerOnAdd (zfidentity eventId)
 called when add first observer
virtual void observerOnRemove (zfidentity eventId)
 called when remove last observer
Protected Member Functions inherited from ZFStyle
virtual void copyableOnCopyFrom (ZFObject *anotherObj)
 called by copy to copy contents from anotherObj
Protected Member Functions inherited from ZFObject
virtual void objectInfoImpl (zfstring &ret)
 see objectInfo
virtual zfidentity objectHashImpl (void)
 see objectHash
virtual ZFCompareResult objectCompareImpl (ZFObject *anotherObj)
 see objectCompare
virtual ZFCompareResult objectCompareValueImpl (ZFObject *anotherObj)
 see objectCompareValue
virtual void observerOnEvent (const ZFArgs &zfargs)
 notified when observerNotify
virtual void objectOnInitFinish (void)
 called after objectOnInit, safe to call virtual functions here
virtual void objectOnRetain (void)
 called to retain object
virtual void objectOnRelease (void)
 called to release object
virtual void objectPropertyValueOnUpdate (const ZFProperty *property, const void *oldValue)
 see E_ObjectPropertyValueOnUpdate
virtual void objectPropertyValueOnReset (const ZFProperty *property)
 see E_ObjectPropertyValueOnReset
Protected Member Functions inherited from ZFStyleable
virtual void styleableOnCopyPropertyFrom (ZFObject *anotherStyleable, const ZFProperty *property)
 copy property with styleable logic
Protected Member Functions inherited from ZFSerializable
virtual zfbool serializableOnCheck (void)
 see serializable
virtual zfbool serializableOnSerializePropertyFromData (const ZFSerializableData &propertyData, const ZFProperty *property, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 see serializableOnCheckPropertyType, usually you have no need to override this method, see ZFSerializable
virtual zfbool serializableOnSerializePropertyToData (ZFSerializableData &ownerData, const ZFProperty *property, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
 see serializableOnCheckPropertyType, usually you have no need to override this method, see ZFSerializable
virtual zfbool serializableOnSerializeEmbededPropertyFromData (const ZFSerializableData &propertyData, const ZFProperty *property, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 see serializableOnCheckPropertyType, usually you have no need to override this method, see ZFSerializable
virtual zfbool serializableOnSerializeEmbededPropertyToData (ZFSerializableData &ownerData, const ZFProperty *property, ZFSerializable *refOwner, zfstring *outErrorHint=zft_zfnull)
 see serializableOnCheckPropertyType, usually you have no need to override this method, see ZFSerializable
virtual zfbool serializableOnSerializeFromString (const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 see serializeFromString
virtual zfbool serializableOnSerializeToString (zfstring &ret, zfstring *errorHint=zft_zfnull)
 see serializeFromString

Detailed Description

list view that layout children in linear by specified orientation

a list layout is a scroll view, you may manage the scroll logic by ZFUIScrollView's methods, while scroll view's content size would be updated automatically and you should not modify it manually

Warning
you must not add or remove normal child to list view, only internal background or foreground view is allowed

to use a list view, you must supply a list adapter which would supply all of list cells, see ZFUICellAdapter for more info
list view itself won't supplly any separator or margins or border radius, you must supply by the list adapter, see ZFUICell for more info

serializable data:

<ZFUIListView>
<CellAdapterClass category="cellAdapter" /> // used only if #cellAdapterSerializable
<ZFArray prop="cellUpdater"> // all cell updater
...
</ZFUIListView>
container of ZFObject, see ZFContainer
Definition ZFArray.h:22

Member Function Documentation

◆ classData()

virtual const ZFClass * ZFUIListView::classData ( void )
inlinevirtual

get instance's class info

Reimplemented from ZFUIScrollView.

◆ DefaultStyle()

zfanyT< ZFUIListView > ZFUIListView::DefaultStyle ( void )
static


default style for ZFUIListView

◆ E_CellOnAttach()

zfidentity ZFUIListView::E_CellOnAttach ( void )
static

see ZFObject::observerNotify

called when list cell attached to this list view, param0 is the list cell

Note
you must not access visibleCells or visibleCellRange during this event, you can only access them during E_ListVisibleCellOnUpdate

◆ E_CellOnDetach()

zfidentity ZFUIListView::E_CellOnDetach ( void )
static

see ZFObject::observerNotify

called when list cell detached from this list view, param0 is the list cell

Note
you must not access visibleCells or visibleCellRange during this event, you can only access them during E_ListVisibleCellOnUpdate

◆ E_ListVisibleCellOnUpdate()

zfidentity ZFUIListView::E_ListVisibleCellOnUpdate ( void )
static

see ZFObject::observerNotify

called when list visible cell changed

◆ cellAdapter()

virtual zfanyT< ZFUICellAdapter > & ZFUIListView::cellAdapter ( )
inlinevirtual

list adapter

no auto retain by default, use cellAdapterAutoRetain if necessary
by default, the list adapter won't be serialized during the list view's serialization, you can enable it by cellAdapterSerializable

◆ cellAdapterAutoRetain()

virtual void ZFUIListView::cellAdapterAutoRetain ( ZFUICellAdapter * cellAdapter)
virtual

set and retain the list adapter

by default, list adapter won't be retained by this list view to prevent recursive retain, you may use this method to retain it automatically

◆ orientation()

virtual ZFUIOrientation & ZFUIListView::orientation ( )
inlinevirtual

direction to layout children, v_ZFUIOrientation::e_Top by default

v_ZFUIOrientation::e_Left means layout children from left to right, while v_ZFUIOrientation::e_Bottom means layout children from bottom to top

◆ objectOnInit()

virtual void ZFUIListView::objectOnInit ( void )
protectedvirtual

override this to init your object

subclass must call superclass's objectOnInit before any other code if override
you may also declare objectOnInit with params like this:

zfclass Parent : ... {
...
protected:
virtual void objectOnInit(void) {...};
};
zfclass Child : Parent {
protected:
// override all parent's objectOnInit is also required,
// because of function hiding of C++
virtual void objectOnInit(void) {
}
// custom init entry
virtual void objectOnInit(Params...) {
// your extra init steps
...
}
};
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
virtual void objectOnInit(void)
override this to init your object
virtual void objectOnInit(void)
override this to init your object
Warning
objectOnInit and objectOnDealloc is called as a virtual function, take good care of other virtual function call, use zfself::func() instead of this->func() if necessary, or use objectOnInitFinish/objectOnDeallocPrepare, or declare your own constructor with ZFOBJECT_DECLARE_WITH_CUSTOM_CTOR
Note
(ZFTAG_LIMITATION) due to limitations of C++, if your parent type declared objectOnInit with different params, and your child type want to override part of those objectOnInit, then your child type must also override all objectOnInit that parent declared, otherwise, some may be hidden
for objects that designed not to be allocated by user, you should use ZFOBJECT_PRIVATE_ALLOC, typically usage:
ZFOBJECT_PRIVATE_ALLOC("should be created by MyObject::instanceForXxx only")
public:
static zfauto instanceForXxx(xxx) {
// can only be allocated by reflection
}
};
static void func(void) {
// MyObject *obj = zfobjAlloc(MyObject); // would compile error
zfauto obj = MyObject::instanceForXxx(xxx); // OK
}
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define ZFOBJECT_PRIVATE_ALLOC(...)
mark this object can not be allocated directly
Definition ZFObjectDeclare.h:245
zfauto newInstance(void) const
make a new instance of ZFObject dynamically, which is described by ZFClass
base class of all objects
Definition ZFObjectCore.h:196
static const ZFClass * ClassData(void)
get class info
Definition ZFUIListView.h:45
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34

Reimplemented from ZFUIScrollView.

◆ objectOnDealloc()

virtual void ZFUIListView::objectOnDealloc ( void )
protectedvirtual

override this to destroy your object

subclass must call superclass's objectOnDealloc after any other code if override
see objectOnInit for more info

Reimplemented from ZFUIScrollView.

◆ objectOnDeallocPrepare()

virtual void ZFUIListView::objectOnDeallocPrepare ( void )
protectedvirtual

called before objectOnDealloc, safe to call virtual functions here

usually used to cleanup resources attached to this object other than self's internal resources

Note
it's ensured safe to retain the object while deallocating, but it's not ensured objectOnDeallocPrepare would only called once for each instance

Reimplemented from ZFUIScrollView.

◆ serializableOnCheckPropertyType()

◆ serializableOnCheckNeedSerializeChildren()

virtual zfbool ZFUIListView::serializableOnCheckNeedSerializeChildren ( void )
inlineprotectedvirtual

all child views would be ignored from serializable

Reimplemented from ZFUIView.

◆ serializableOnSerializeFromData()

virtual zfbool ZFUIListView::serializableOnSerializeFromData ( const ZFSerializableData & serializableData,
zfstring * outErrorHint = zft_zfnull,
ZFSerializableData * outErrorPos = zft_zfnull )
protectedvirtual

for serializable data that has "category" attribute, ZFSerializable would ignore it and leave it to subclass to resolve, see ZFSerializable

while overriding this method, you should call super first, and then check whether super has resolved the data
if subclass should resolve the category, you should mark data as resolved and return whether resolve success
if not, subclass should leave the data unresoved and return true

Reimplemented from ZFUIView.

◆ serializableOnSerializeToData()

virtual zfbool ZFUIListView::serializableOnSerializeToData ( ZFSerializableData & serializableData,
zfstring * outErrorHint = zft_zfnull,
ZFSerializable * refOwner = zft_zfnull )
protectedvirtual

corresponding to serializableOnSerializeFromData, return whether the task is success, see ZFSerializable

Reimplemented from ZFUIView.

◆ layoutOnLayoutPrepare()

virtual void ZFUIListView::layoutOnLayoutPrepare ( const ZFUIRect & bounds)
protectedvirtual

◆ layoutOnLayout()

virtual void ZFUIListView::layoutOnLayout ( const ZFUIRect & bounds)
protectedvirtual

override ZFUIView to layout scroll view's internal view and content view

usually you should not override this method, if necessary, you must call super

Reimplemented from ZFUIScrollView.

◆ viewChildOnAdd()

virtual void ZFUIListView::viewChildOnAdd ( ZFUIView * child,
ZFUIViewChildLayer childLayer )
protectedvirtual

see E_ViewChildOnAdd

Reimplemented from ZFUIView.

◆ viewChildOnRemove()

virtual void ZFUIListView::viewChildOnRemove ( ZFUIView * child,
ZFUIViewChildLayer childLayer )
protectedvirtual

see E_ViewChildOnRemove

Reimplemented from ZFUIView.

◆ scrollAreaOnUpdate()

virtual void ZFUIListView::scrollAreaOnUpdate ( void )
protectedvirtual

see E_ScrollAreaOnUpdate

Reimplemented from ZFUIScrollView.

◆ scrollContentFrameOnUpdate()

virtual void ZFUIListView::scrollContentFrameOnUpdate ( void )
protectedvirtual

◆ scrollOnScrolledByUser()

virtual void ZFUIListView::scrollOnScrolledByUser ( void )
protectedvirtual

see E_ScrollOnScrolledByUser

Reimplemented from ZFUIScrollView.

◆ scrollOnScrollEnd()

virtual void ZFUIListView::scrollOnScrollEnd ( void )
protectedvirtual

see E_ScrollOnScrollEnd

Reimplemented from ZFUIScrollView.

◆ reload()

virtual void ZFUIListView::reload ( )
virtual

reload entire list cells

Note
this method would only schedule an update step, when it would be reloaded is not ensured
this method would reload the entire list, use reloadCellAt for performance

◆ reloadCellAt()

virtual void ZFUIListView::reloadCellAt ( zfindex index)
virtual

reload cell at index immediately, do nothing if index not in visible range or reloadRequested

this method would have higher performance if you want to update specified cell only

◆ visibleCells()

virtual ZFCoreArray< ZFUICell * > ZFUIListView::visibleCells ( )
virtual

return a list of current visible cells, valid only if reloadRequested is not true

returned value should not be stored, since visible cell may change frequently

◆ visibleCellRange()

virtual const ZFIndexRange & ZFUIListView::visibleCellRange ( )
virtual

return first visible cell's index, valid only if reloadRequested is not true

index is ordered by ZFUICellAdapter, so first cell may positioned at bottom according to layout orientation

◆ scrollCellToHead()

virtual void ZFUIListView::scrollCellToHead ( zfindex cellIndex,
zffloat offset = (0),
zfbool animated = (_ZFT_t_zftrue) )
virtual

scroll cell to top, do nothing if invalid or no need to scroll

if animated, scroll task would be canceled if scrolled by user (ZFUIScrollView::scrollOnScrolledByUser)

Note
since list cell may load dynamically, this method would recursively scroll until reached desired position, you should prevent doing other load logic during scroll events, otherwise, dead loop may occurred

The documentation for this class was generated from the following file: