ZFFramework
 
Loading...
Searching...
No Matches
ZFUICellUpdater.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFUICellUpdater_h_
7#define _ZFI_ZFUICellUpdater_h_
8
9#include "ZFUICell.h"
11
12// ============================================================
29
30// ============================================================
34zfinterface ZFLIB_ZFUIWidget ZFUICellUpdater : zfextend ZFInterface {
35 ZFINTERFACE_DECLARE(ZFUICellUpdater, ZFInterface)
36
37public:
38 // ============================================================
39 // events
46 ZFEVENT(CellOnUpdate)
53 ZFEVENT(CellOnRecycle)
54
55public:
58 this->cellOnUpdate(updateParam);
59 this->toObject()->observerNotify(zfself::E_CellOnUpdate(), zfobj<v_ZFUICellUpdaterParam>(updateParam));
60 }
61
63 this->cellOnRecycle(cell);
64 this->toObject()->observerNotify(zfself::E_CellOnRecycle(), cell);
65 }
66
67protected:
71 virtual inline void cellOnUpdate(ZF_IN const ZFUICellUpdaterParam &updateParam) {
72 }
73
76 virtual inline void cellOnRecycle(ZF_IN ZFUICell *cell) {
77 }
78
79public:
83 ZFMETHOD_DECLARE_1(zfauto, itemCacheAccess
84 , ZFMP_IN(const zfstring &, key)
85 )
88 , ZFMP_IN(const zfstring &, key)
89 , ZFMP_IN(ZFObject *, cache)
90 )
91};
92
94#endif // #ifndef _ZFI_ZFUICellUpdater_h_
95
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define zfclassPOD
shows the class is a POD type
Definition ZFCoreTypeDef_ClassType.h:35
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
_zft_zffloat zffloat
same as float, see zfindex
Definition ZFCoreTypeDef_CoreType.h:183
#define ZFOUTPUT_TYPE_DECLARE(ZFLIB_, T_Type)
see ZFOUTPUT_TYPE
Definition ZFCoreTypeDef_OtherType.h:244
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFCORE_POD_DECLARE(Type)
explicitly declare as POD
Definition ZFCoreUtilTemplate.h:554
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_DECLARE_2(ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMethod
Definition ZFMethodDeclare.h:1025
#define ZFMETHOD_DECLARE_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:854
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfinterface
shows the type is an interface, see ZFInterface
Definition ZFObjectInterface.h:20
#define ZFINTERFACE_DECLARE(InterfaceName, ParentInterface,...)
see ZFInterface
Definition ZFObjectInterface.h:100
#define ZFEVENT(YourEvent)
see ZFObject::observerNotify
Definition ZFObjectObserver.h:328
#define ZFTYPEID_ACCESS_ONLY_REG(ZFLIB_, TypeName, Type,...)
see ZFTYPEID_DECLARE
Definition ZFTypeIdDeclare.h:205
#define ZFTYPEID_ACCESS_ONLY_DECLARE(ZFLIB_, TypeName, Type)
see ZFTYPEID_DECLARE
Definition ZFTypeIdDeclare.h:195
abstract cell to hold content views
v_ZFUIOrientation::ZFEnumType ZFUIOrientation
see v_ZFUIOrientation
Definition ZFUITypeDef.h:1145
#define ZFLIB_ZFUIWidget
used to export symbols
Definition ZFUIWidgetDef.h:17
virtual ZFObject * toObject(void)=0
convert to ZFObject type
base class of all objects
Definition ZFObjectCore.h:209
utility class to hold cell
Definition ZFUICell.h:21
void notifyCellRecycle(ZFUICell *cell)
for impl to notify cell recycle
Definition ZFUICellUpdater.h:62
static zfidentity E_CellOnUpdate(void)
see ZFObject::observerNotify
virtual void cellOnUpdate(const ZFUICellUpdaterParam &updateParam)
called to update cell style
Definition ZFUICellUpdater.h:71
void notifyCellUpdate(const ZFUICellUpdaterParam &updateParam)
for impl to notify cell update
Definition ZFUICellUpdater.h:57
static zfidentity E_CellOnRecycle(void)
see ZFObject::observerNotify
virtual void cellOnRecycle(ZFUICell *cell)
called to recycle cell
Definition ZFUICellUpdater.h:76
virtual void itemCacheRecycle(const zfstring &key, ZFObject *cache)
see itemCacheAccess
update param used by ZFUICellUpdater::cellOnUpdate
Definition ZFUICellUpdater.h:16
ZFUISize containerSize
owner container's size
Definition ZFUICellUpdater.h:22
zfindex cellCount
cell's total count
Definition ZFUICellUpdater.h:20
zfindex cellIndex
cell's index
Definition ZFUICellUpdater.h:19
zfanyT< ZFUICell > cell
the cell
Definition ZFUICellUpdater.h:18
zffloat cellSizeHint
cell's size hint
Definition ZFUICellUpdater.h:23
ZFUIOrientation orientation
owner container's orientation
Definition ZFUICellUpdater.h:21
2D size
Definition ZFUITypeDef.h:397
see zfany
Definition zfany.h:106
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:157