6#ifndef _ZFI_ZFUIImage_h_
7#define _ZFI_ZFUIImage_h_
192 ,
ZF_IN const
void *oldValue
202 zffinal void _ZFP_ZFUIImage_imageScaleOnUpdate(
void);
260 _ZFP_ZFUIImagePrivate *d;
265typedef
zfbool (*_ZFP_ZFUIImageSerializeFromCallback)(
272extern
ZFLIB_ZFUIKit void _ZFP_ZFUIImageSerializeTypeRegister(
274 ,
ZF_IN _ZFP_ZFUIImageSerializeFromCallback fromCallback
308#define ZFUIIMAGE_SERIALIZE_TYPE_DEFINE(registerSig, typeName) \
309 static zfbool _ZFP_ZFUIImageSerializeFromCallback_##registerSig(ZF_IN_OUT ZFUIImage *ret, \
310 ZF_IN const ZFSerializableData &serializableData, \
311 ZF_OUT_OPT zfstring *outErrorHint , \
312 ZF_OUT_OPT ZFSerializableData *outErrorPos ); \
313 ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL(ZFUIImageSerializeReg_##registerSig, ZFLevelZFFrameworkHigh) { \
314 _ZFP_ZFUIImageSerializeTypeRegister(typeName, _ZFP_ZFUIImageSerializeFromCallback_##registerSig); \
316 ZF_GLOBAL_INITIALIZER_DESTROY(ZFUIImageSerializeReg_##registerSig) { \
317 _ZFP_ZFUIImageSerializeTypeUnregister(typeName); \
319 ZF_GLOBAL_INITIALIZER_END(ZFUIImageSerializeReg_##registerSig) \
320 static zfbool _ZFP_ZFUIImageSerializeFromCallback_##registerSig(ZF_IN_OUT ZFUIImage *ret, \
321 ZF_IN const ZFSerializableData &serializableData, \
322 ZF_OUT_OPT zfstring *outErrorHint , \
323 ZF_OUT_OPT ZFSerializableData *outErrorPos )
337#define ZFSerializableKeyword_ZFUIImage_imageType "imageType"
339#define ZFSerializableKeyword_ZFUIImage_imageBin "imageBin"
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:192
#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 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:180
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
_zft_zffloat zffloat
same as float, see zfindex
Definition ZFCoreTypeDef_CoreType.h:183
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
ZFCompareResult
compare result of two ZFObjects
Definition ZFCoreTypeDef_OtherType.h:28
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFENUM_SEPARATOR()
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:158
#define ZFENUM_VALUE_REGISTER(Value)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:168
#define ZFENUM_REG(ZFLIB_, EnumName,...)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:186
#define ZFENUM_VALUE(Value)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:151
#define ZFENUM_BEGIN(ZFLIB_, EnumName)
macros to define reflectable enum type
Definition ZFEnumDeclare.h:147
#define ZFENUM_END(ZFLIB_, EnumName)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:172
#define ZFMP_IN_OPT(ParamType, paramName, DefaultValue)
see ZFMP_IN
Definition ZFMethod.h:108
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_DECLARE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:693
#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 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:126
#define ZFOBJECT_PRIVATE_ALLOC(...)
mark this object can not be allocated directly
Definition ZFObjectDeclare.h:245
#define ZFEVENT(YourEvent)
see ZFObject::observerNotify
Definition ZFObjectObserver.h:328
#define ZFPROPERTY_ASSIGN(Type, Name,...)
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:128
#define ZFPROPERTY_ON_ATTACH_DECLARE(Type, Name)
see ZFPROPERTY_ON_INIT_DECLARE
Definition ZFPropertyDeclare.h:248
global style for ui elements
v_ZFUIImageStateImplAction::ZFEnumType ZFUIImageStateImplAction
see v_ZFUIImageStateImplAction
Definition ZFUIImage.h:351
void ZFUIImageSerializeTypeGetAllT(ZFCoreArray< zfstring > &ret)
see ZFUIImageSerializeTypeGetAll
ZFCoreArray< zfstring > ZFUIImageSerializeTypeGetAll(void)
usually for debug use only
Definition ZFUIImage.h:330
#define ZFLIB_ZFUIKit
used to export symbols
Definition ZFUIKitDef.h:16
light weight array
Definition ZFCoreArray.h:331
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
void observerNotify(zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
notify the observer with eventId
info for a property for ZFObject, see ZFPROPERTY_RETAIN for more info
Definition ZFProperty.h:28
ZFSerializable's data container, see ZFSerializable.
Definition ZFSerializableData.h:74
virtual void * nativeImage()
get native image object
virtual zfautoT< ZFUIImage > imageStateUpdate()
see imageState
virtual void imageSerializeType(const zfstring &typeName)
see ZFUIIMAGE_SERIALIZE_TYPE_DEFINE
virtual ZFCompareResult objectCompareValueImpl(ZFObject *anotherObj)
see objectCompareValue
virtual void objectOnInitFinish(void)
called after objectOnInit, safe to call virtual functions here
virtual zfbool serializableOnSerializeToData(ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
corresponding to serializableOnSerializeFromData, return whether the task is success,...
virtual void objectInfoImplAppend(zfstring &ret)
see objectInfo
virtual void styleableOnCopyFrom(ZFObject *anotherStyleable)
for subclass to achieve custom style copy step, called by styleableCopyFrom, see ZFStyleable
virtual void imageStateImpl(const ZFListener &impl)
for impl to implement stateful image logic
virtual const ZFUISize & imageSize()
get size of the image
virtual void imageSerializeData(const ZFSerializableData &serializableData)
see ZFUIIMAGE_SERIALIZE_TYPE_DEFINE
virtual void imageScaleOnUpdate(void)
see E_ImageScaleOnUpdate
Definition ZFUIImage.h:205
virtual zffloat const & imageScaleFixed()
util method to access actual scale
virtual const ZFUISize & imageSizeFixed()
get raw size of the image without scale (in pixel unit)
virtual void imageSerializeDataGetter(const ZFListener &impl)
see ZFUIIMAGE_SERIALIZE_TYPE_DEFINE
virtual void objectPropertyValueOnUpdate(const ZFProperty *property, const void *oldValue)
see E_ObjectPropertyValueOnUpdate
virtual void imageStateAttach(const ZFListener &callback)
for impl to attach image state update observer
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 s...
virtual void imageStateDetach(const ZFListener &callback)
see imageStateAttach
virtual void objectOnDealloc(void)
override this to destroy your object
static zfidentity E_ImageStateOnUpdate(void)
see ZFObject::observerNotify
static zfidentity E_ImageScaleOnUpdate(void)
see ZFObject::observerNotify
virtual void objectOnDeallocPrepare(void)
called before objectOnDealloc, safe to call virtual functions here
virtual zfautoT< ZFUIImage > imageState()
return current image state
virtual void imageSerializeDisable(zfbool disable)
see ZFSerializeDisable
virtual ZFUIMargin & imageNinePatch()
nine patch described by a margin value, disabled if zero margin or margin exceeds image size
Definition ZFUIImage.h:84
virtual void imageStateOnUpdate(void)
see E_ImageStateOnUpdate
Definition ZFUIImage.h:210
virtual void objectOnInit(void)
override this to init your object
virtual zffloat & imageScale()
image's scale, 1 by default
Definition ZFUIImage.h:78
virtual void imageStateImplNotifyUpdate(ZFUIImage *imageState)
see imageStateImpl
margin
Definition ZFUITypeDef.h:147
2D size
Definition ZFUITypeDef.h:397
type restrict version of zfauto
Definition zfautoFwd.h:110