ZFFramework
Loading...
Searching...
No Matches
ZFUICellAdapterBasic.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFUICellAdapterBasic_h_
7#define _ZFI_ZFUICellAdapterBasic_h_
8
9#include "ZFUICellAdapter.h"
11
13zfclass ZFLIB_ZFUIWidget ZFUICellAdapterBasicParam : zfextend ZFObject {
14 ZFOBJECT_DECLARE(ZFUICellAdapterBasicParam, ZFObject)
15
16public:
23};
24
25// ============================================================
58zfclass ZFLIB_ZFUIWidget ZFUICellAdapterBasic : zfextend ZFStyle, zfimplement ZFUICellAdapter {
59 ZFOBJECT_DECLARE(ZFUICellAdapterBasic, ZFStyle)
60 ZFIMPLEMENT_DECLARE(ZFUICellAdapter)
61
62public:
63 // ============================================================
64 // events
71 ZFEVENT(CellCount)
78 ZFEVENT(CellAt)
85 ZFEVENT(CellSizeAt)
92 ZFEVENT(CellCacheOnAccess)
93
94public:
97 this->observerNotify(zfself::E_CellCount(), ZFArgs().param0(ret));
98 return ret->zfv;
99 }
101 , ZFMP_IN(zfindex, index)
102 ) {
104 param->cellIndex(index);
105 this->observerNotify(zfself::E_CellAt(), ZFArgs().param0(param));
106 return param->cell();
107 }
109 , ZFMP_IN(zfindex, index)
110 , ZFMP_IN(ZFUICell *, cell)
111 ) {
114 param->cellIndex(index);
115 param->cell(cell);
116 this->observerNotify(zfself::E_CellSizeAt(), ZFArgs().param0(param));
117 return param->cellSize();
118 }
119 else {
120 return zfsuperI(ZFUICellAdapter)::cellSizeAt(index, cell);
121 }
122 }
123
124protected:
129 param->cellIndex(index);
130 this->observerNotify(zfself::E_CellCacheOnAccess(), ZFArgs().param0(param));
131 return param->cell();
132 }
133 else {
134 return zfsuperI(ZFUICellAdapter)::cellCacheOnAccess(index);
135 }
136 }
137};
138
140#endif // #ifndef _ZFI_ZFUICellAdapterBasic_h_
141
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:198
_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 ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_OVERRIDE_INLINE_2(ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMethod
Definition ZFMethodInterfaceDeclare.h:278
#define ZFMETHOD_OVERRIDE_INLINE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodInterfaceDeclare.h:113
#define ZFMETHOD_OVERRIDE_INLINE_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodInterfaceDeclare.h:193
#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 zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:122
#define zfsuperI(T_SuperType)
class ref to proper super type, see ZFObject for more info
Definition ZFObjectDeclare.h:26
#define ZFIMPLEMENT_DECLARE(ImplementedInterfaces,...)
see ZFINTERFACE_DECLARE
Definition ZFObjectInterface.h:168
#define zfimplement
shows class implement from interface, see ZFInterface
Definition ZFObjectInterface.h:24
#define ZFEVENT(YourEvent)
see ZFObject::observerNotify
Definition ZFObjectObserver.h:312
#define ZFPROPERTY_RETAIN(Type, Name,...)
declare a retain property
Definition ZFPropertyDeclare.h:103
#define ZFPROPERTY_ASSIGN(Type, Name,...)
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:120
abstract cell adpater to supply cells for container view
#define ZFLIB_ZFUIWidget
used to export symbols
Definition ZFUIWidgetDef.h:17
listener data used by ZFListener
Definition ZFArgs.h:20
void observerNotify(zfidentity eventId, const ZFArgs &zfargs=ZFArgs())
notify the observer with eventId
zfbool observerHasAdd(void)
true if any observer has been added
virtual zffloat cellSizeAt(zfindex index, ZFUICell *cell)
check cell size at index
Definition ZFUICellAdapterBasic.h:111
virtual zfauto cellCacheOnAccess(zfindex index)
try access cached cell, return null means no cache available, by default, no cache logic support
Definition ZFUICellAdapterBasic.h:126
virtual zfindex cellCount()
cell count
Definition ZFUICellAdapterBasic.h:95
static zfidentity E_CellCount(void)
see ZFObject::observerNotify
static zfidentity E_CellAt(void)
see ZFObject::observerNotify
static zfidentity E_CellSizeAt(void)
see ZFObject::observerNotify
static zfidentity E_CellCacheOnAccess(void)
see ZFObject::observerNotify
virtual zfindex & cellIndex()
see ZFUICellAdapterBasic::E_CellAt
Definition ZFUICellAdapterBasic.h:20
virtual zfanyT< ZFUICell > const & cell()
see ZFUICellAdapterBasic::E_CellAt
Definition ZFUICellAdapterBasic.h:18
virtual zffloat & cellSize()
see ZFUICellAdapterBasic::E_CellAt
Definition ZFUICellAdapterBasic.h:22
utility class to hold cell
Definition ZFUICell.h:21
see zfany
Definition zfany.h:113
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
type restrict version of zfauto
Definition zfautoFwd.h:108
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:72