6#ifndef _ZFI_ZFUIAutoLayout_h_
7#define _ZFI_ZFUIAutoLayout_h_
46 return this->
target() || this->_ZFP_AL_targetId;
52 this->_ZFP_AL_targetId.removeAll();
69 && this->target() == ref.target()
70 && this->targetPos() == ref.targetPos()
74 return !this->operator == (ref);
234 _ZFP_Data(
void) : ruleList(), posAttached(), posReset(
zffalse) {}
245 return zfsuper::child(view, atIndex);
251#define ZFSerializableKeyword_ZFUIAutoLayoutParam_rule "rule"
253#define ZFSerializableKeyword_ZFUIAutoLayoutParam_target_parent "@parent"
255#define ZFSerializableKeyword_ZFUIAutoLayoutParam_target_self "@self"
380 _ZFP_ZFUIAutoLayoutPrivate *d;
#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 zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#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_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:188
#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
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
#define zfindexMax()
(zfindex)-1, indicate a max index value, see zfindex
Definition ZFCoreTypeDef_CoreType.h:159
_zft_zffloat zffloat
same as float, see zfindex
Definition ZFCoreTypeDef_CoreType.h:183
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
#define ZFOUTPUT_TYPE(T_Type, outputAction)
declare your custom type conversion to string, convenient for debug
Definition ZFCoreTypeDef_OtherType.h:221
ZFCompareResult
compare result of two ZFObjects
Definition ZFCoreTypeDef_OtherType.h:28
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFCORE_PARAM_DECLARE_SELF(T_self)
see ZFCORE_PARAM
Definition ZFCoreUtilMacro.h:495
#define ZFCORE_PARAM(T_ParamType, paramName,...)
a util macro to generate setter and getter for POD like object
Definition ZFCoreUtilMacro.h:523
#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(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_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 ZFCORE_PARAM_WEAK(T_ParamType, paramName,...)
ZFObject weak version of ZFCORE_PARAM.
Definition ZFObjectClassTypeFwd.h:48
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#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
ZFSerializablePropertyType
serializable property type, see ZFSerializable::serializableOnCheckPropertyType
Definition ZFSerializable.h:40
#define ZFSTYLE_DEFAULT_DECLARE(YourStyle)
used to declare a default style, see ZFStyleable
Definition ZFStyleable.h:262
#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
v_ZFUIAutoLayoutPos::ZFEnumType ZFUIAutoLayoutPos
see v_ZFUIAutoLayoutPos
Definition ZFUIAutoLayout.h:30
v_ZFUIViewChildLayer::ZFEnumType ZFUIViewChildLayer
see v_ZFUIViewChildLayer
Definition ZFUIViewType.h:511
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
see v_ZFUIAlign, ZFUIAlignFlagsToString, ZFUIAlignFlagsFromString
Definition ZFUITypeDef.h:1075
auto layout with constraint rule
Definition ZFUIAutoLayout.h:326
virtual void objectOnDealloc(void)
override this to destroy your object
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 layoutOnMeasure(ZFUISize &ret, const ZFUISize &sizeHint, const ZFUISizeParam &sizeParam)
called by layoutMeasure to decide the view's size
virtual void styleableOnCopyFrom(ZFObject *anotherStyleable)
for a view, copy style would also copy all of it's children
virtual void viewChildOnRemove(ZFUIView *child, ZFUIViewChildLayer layer)
see E_ViewChildOnRemove
virtual const ZFClass * layoutParamClass(void)
see layoutParamCreate
Definition ZFUIAutoLayout.h:350
virtual void objectOnInit(void)
override this to init your object
virtual void layoutOnLayout(const ZFUIRect &bounds)
called by viewFrame to layout the view and children
see ZFUIAutoLayout
Definition ZFUIAutoLayout.h:89
virtual zffloat & biasY()
see ZFUIAutoLayout
Definition ZFUIAutoLayout.h:95
virtual void toParentTop()
see ZFUIAutoLayout
virtual zfbool serializableOnSerializeToData(ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
corresponding to serializableOnSerializeFromData, return whether the task is success,...
virtual void top()
see ZFUIAutoLayout
static const ZFClass * ClassData(void)
get class info
Definition ZFUIAutoLayout.h:90
virtual void toParentRight()
see ZFUIAutoLayout
virtual void left()
see ZFUIAutoLayout
virtual ZFSerializablePropertyType serializableOnCheckPropertyType(const ZFProperty *property)
check the property type that serializable should do what while serializing
virtual void toParent()
see ZFUIAutoLayout
virtual void toTop(const zfstring &viewId)
see ZFUIAutoLayout
virtual void ruleRemove(ZFUIAutoLayoutPos pos)
see ZFUIAutoLayout
virtual void toParentLeft()
see ZFUIAutoLayout
virtual void ruleRemoveAll()
see ZFUIAutoLayout
virtual void toLeft(const zfstring &viewId)
see ZFUIAutoLayout
virtual void toParentHeight()
see ZFUIAutoLayout
virtual void width()
see ZFUIAutoLayout
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 toParentWidth()
see ZFUIAutoLayout
virtual void styleableOnCopyFrom(ZFObject *anotherStyleable)
for subclass to achieve custom style copy step, called by styleableCopyFrom, see ZFStyleable
virtual ZFCompareResult objectCompareValueImpl(ZFObject *anotherObj)
see objectCompareValue
virtual void bottom()
see ZFUIAutoLayout
virtual const ZFUIAutoLayoutRule & rule(ZFUIAutoLayoutPos pos)
see ZFUIAutoLayout
virtual void toParentBottom()
see ZFUIAutoLayout
virtual void toBottom(const zfstring &viewId)
see ZFUIAutoLayout
virtual zffloat & biasX()
see ZFUIAutoLayout
Definition ZFUIAutoLayout.h:93
virtual void toWidth(const zfstring &viewId)
see ZFUIAutoLayout
virtual void toRight(const zfstring &viewId)
see ZFUIAutoLayout
virtual void right()
see ZFUIAutoLayout
virtual void toHeight(const zfstring &viewId)
see ZFUIAutoLayout
virtual void edges()
util to setup left + top + right + bottom
virtual void height()
see ZFUIAutoLayout
virtual void to(const zfstring &viewId)
see ZFUIAutoLayout
see ZFUIAutoLayout
Definition ZFUIAutoLayout.h:34
ZFUIAutoLayoutPos & targetPos(void)
see ZFUIAutoLayout
Definition ZFUIAutoLayout.h:41
void objectInfoT(zfstring &ret) const
see objectInfo
void removeAll(void)
remove all contents
Definition ZFUIAutoLayout.h:49
zfstring objectInfo(void) const
return object info
Definition ZFUIAutoLayout.h:59
zfanyT< ZFUIView > const & target(void) const
see ZFUIAutoLayout
Definition ZFUIAutoLayout.h:39
zfbool valid(void) const
true if contains valid rule
Definition ZFUIAutoLayout.h:45
virtual ZFUIAlignFlags & align()
see ZFUILayoutParam, default is (v_ZFUIAlign::e_Left | v_ZFUIAlign::e_Top)
Definition ZFUIViewType.h:153
2D rectangle
Definition ZFUITypeDef.h:636
2D size
Definition ZFUITypeDef.h:397
2D size
Definition ZFUIViewType.h:41
base class of all UI views
Definition ZFUIView.h:93
zfanyT< ZFUILayoutParam > child(const zfany &view, zfindex atIndex=((zfindex) -1))
add child and return child's layoutParam, see childWithParam
see ZFUIAutoLayout
Definition ZFUIAutoLayout.h:14
@ e_None
Definition ZFUIAutoLayout.h:15
@ ZFEnumCount
max enum value
Definition ZFUIAutoLayout.h:22
util method to cast ZFObject types freely
Definition zfany.h:35
see zfany
Definition zfany.h:106