abstract cell adpater to supply cells for container view More...
#include <ZFUICellAdapter.h>
Public Member Functions | |
virtual ZFUIOrientation | orientation () |
owner view's orientation | |
virtual const ZFUISize & | containerSize () |
container's size | |
virtual zffloat & | cellSizeHint () |
cell's hint size, use -1 to measure by cell, ZFUIGlobalStyle::itemSizeCell by default | |
virtual void | cellSizeHint (zffloat const &propertyValue) |
see cellSizeHint | |
virtual zfbool & | cellSizeFill () |
if cellSizeHint not set, whether fill cell size to containerSize, false by default | |
virtual void | cellSizeFill (zfbool const &propertyValue) |
see cellSizeFill | |
virtual void | cellAdapterNotifyReload (zfindex atIndexOrMax=(((zfindex) -1))) |
see E_CellAdapterOnReload | |
virtual zfindex | cellCount (void)=0 |
cell count | |
virtual zfautoT< ZFUICell > | cellAt (zfindex index)=0 |
access cell at index, assert fail if return null object | |
virtual zffloat | cellSizeAt (zfindex index, ZFUICell *cell) |
check cell size at index | |
void | notifyContainerUpdate (ZFUIOrientation orientation, const ZFUISize &containerSize) |
for impl to notify state update | |
void | notifyCellAdapterReload (zfindex atIndexOrMax=((zfindex) -1)) |
for impl to notify reload | |
void | notifyCellUpdate (zfindex atIndex, ZFUICell *cell) |
for impl to notify cell update | |
zfauto | notifyCellCacheAccess (zfindex index) |
for impl to notify cell cache access | |
void | notifyCellCacheRecycle (ZFUICell *cell) |
for impl to notify cell cache access | |
virtual zfautoT< ZFUICell > | cellCacheDefaultAccess (const zfstring &key) |
see cellCacheOnRecycle | |
virtual void | cellCacheDefaultRecycle (const zfstring &key, ZFUICell *cell) |
see cellCacheOnRecycle | |
![]() | |
virtual const ZFClass * | classData (void)=0 |
get instance's class info | |
virtual ZFObject * | toObject (void)=0 |
convert to ZFObject type | |
Static Public Member Functions | |
static const ZFClass * | ClassData (void) |
get class info | |
static zfidentity | E_CellAdapterOnReload (void) |
see ZFObject::observerNotify | |
static zfidentity | E_CellOnUpdate (void) |
see ZFObject::observerNotify | |
static zfidentity | E_CellCacheOnRecycle (void) |
see ZFObject::observerNotify | |
![]() | |
static const ZFClass * | ClassData (void) |
get class info | |
Protected Types | |
typedef ZFInterface | zfsuper |
typedef for super (always ZFInterface for an interface type) | |
typedef ZFUICellAdapter | zfself |
typedef for self | |
![]() | |
typedef _ZFP_ObjI_Base | zfsuper |
typedef for super (always ZFInterface for an interface type) | |
typedef ZFInterface | zfself |
typedef for self | |
Protected Member Functions | |
virtual void | cellAdapterOnReload (zfindex atIndexOrMax=((zfindex) -1)) |
see E_CellAdapterOnReload | |
virtual void | cellOnUpdate (zfindex atIndex, ZFUICell *cell) |
see E_CellOnUpdate | |
virtual zfauto | cellCacheOnAccess (zfindex index) |
try access cached cell, return null means no cache available, by default, no cache logic support | |
virtual void | cellCacheOnRecycle (ZFUICell *cell) |
recycle cell or do nothing if you don't need recycle logic | |
abstract cell adpater to supply cells for container view
|
static |
called when cell adapter's content changed and owner container view needs to be updated, param0 is null to update entire container, or a v_zfindex shows which cell to reload
typically, this event would be fired by cellAdapterNotifyReload which would be called by cell adapter impl
|
static |
|
static |
called when recycle cell, param0 is the cell
|
inlinevirtual |
cell's hint size, use -1 to measure by cell, ZFUIGlobalStyle::itemSizeCell by default
setting cellSizeFill would override this property, and use containerSize to layout each cell
|
inlinevirtual |
if cellSizeHint not set, whether fill cell size to containerSize, false by default
this property is useful when combined with ZFUIScrollView::scrollAlignToPageHorizontal series
|
pure virtual |
cell count
Implemented in ZFUICellAdapterBasic, and ZFUICellArray.
access cell at index, assert fail if return null object
Implemented in ZFUICellAdapterBasic, and ZFUICellArray.
check cell size at index
for performance, this method is ensured to be called for visible cells only, to check the cell's actual size
while cell is not visible, a predicted hint size (or previous size) would be used util it's coming to visible
return a -1 size to measure the cell automatically, otherwise, the cell's size is fixed
return cellSizeHint according to cellSizeFill by default
Reimplemented in ZFUICellAdapterBasic.
try access cached cell, return null means no cache available, by default, no cache logic support
see cellCacheOnRecycle for more info
Reimplemented in ZFUICellAdapterBasic, and ZFUICellArray.
|
inlineprotectedvirtual |
recycle cell or do nothing if you don't need recycle logic
to achieve recycle logic, you should:
by default, we have cellCacheDefaultAccess and cellCacheDefaultRecycle that would suit for most case