ZFFramework
Loading...
Searching...
No Matches
ZFStyleable Class Reference

styleable element that can apply style from another object More...

#include <ZFStyleable.h>

Inheritance diagram for ZFStyleable:
ZFInterface ZFStyle ZFAnimation ZFAudio ZFContainer ZFCurve ZFOutputFormat ZFRegExp ZFStruct ZFStyleList ZFTextTemplateRunFilter ZFTime ZFTypeIdWrapper ZFUIButtonGroup ZFUICellAdapterBasic ZFUICellArray ZFUIDialog ZFUIGlobalStyle ZFUIImage ZFUILayoutParam ZFUIListViewCellUpdater ZFUIScrollThumbDefault ZFUIView

Public Member Functions

virtual zfautoT< ZFStyleablecopy (void)
 return a copy of this object
virtual void copyFrom (ZFObject *anotherStyleable)
 copy from another object
virtual zfanyT< ZFStyleabledefaultStyle (void)
 return default style of this instance
virtual zfbool styleableIsDefaultStyle (void)
 true if this object is defaultStyle
void styleablePropertyGetAllT (ZFCoreArray< const ZFProperty * > &ret)
 return a list of styleable property, for debug use only
ZFCoreArray< const ZFProperty * > styleablePropertyGetAll (void)
 return a list of styleable property, for debug use only
void styleKey (const zfstring &styleKey)
 see ZFStyleSet
const zfstringstyleKey (void)
 see ZFStyleSet
void propStyle (const zfstring &propertyName, const zfstring &styleKey)
 see ZFStyleSet
const zfstringpropStyle (const zfstring &propertyName)
 see ZFStyleSet
zfbool progressUpdate (ZFStyleable *from, ZFStyleable *to, zffloat progress)
 update object according to progress
Public Member Functions inherited from ZFInterface
virtual const ZFClassclassData (void)=0
 get instance's class info
virtual ZFObjecttoObject (void)=0
 convert to ZFObject type

Static Public Member Functions

static const ZFClassClassData (void)
 get class info
Static Public Member Functions inherited from ZFInterface
static const ZFClassClassData (void)
 get class info

Protected Types

typedef ZFInterface zfsuper
 typedef for super (always ZFInterface for an interface type)
typedef ZFStyleable zfself
 typedef for self
Protected Types inherited from ZFInterface
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 styleableOnCopyPropertyFrom (ZFObject *anotherStyleable, const ZFProperty *property)
 copy property with styleable logic
virtual void styleableOnCopyFrom (ZFObject *anotherStyleable)
 for subclass to achieve custom style copy step, called by copyFrom, see ZFStyleable
virtual zfbool progressOnUpdate (ZFStyleable *from, ZFStyleable *to, zffloat progress)
 see progressUpdate

Detailed Description

styleable element that can apply style from another object

a styleable typically is a serializable, while serializable process data from and to ZFSerializableData, a styleable process data from and to other styleable object

to use styleable, simply implement from ZFStyleable, if all of your properties are declared as ZFProperty, then every thing's done, and style can be copied by ZFStyleable::copyFrom
for how styleable would be copied, see styleableOnCopyPropertyFrom

Member Function Documentation

◆ copyFrom()

virtual void ZFStyleable::copyFrom ( ZFObject * anotherStyleable)
virtual

copy from another object

do nothing if type mismatch

◆ defaultStyle()

virtual zfanyT< ZFStyleable > ZFStyleable::defaultStyle ( void )
virtual

return default style of this instance

note this method use reflection to find the default style (see ZFSTYLE_DEFAULT_DECLARE), cache it first if necessary

◆ styleableOnCopyFrom()

virtual void ZFStyleable::styleableOnCopyFrom ( ZFObject * anotherStyleable)
protectedvirtual

for subclass to achieve custom style copy step, called by copyFrom, see ZFStyleable

Reimplemented in ZFContainer, ZFEnum, ZFRegExp, ZFTextTemplateRunFilter, ZFTime, ZFTypeIdWrapper, ZFUIAutoLayout, ZFUIAutoLayoutParam, ZFUIImage, and ZFUIView.

◆ progressUpdate()

zfbool ZFStyleable::progressUpdate ( ZFStyleable * from,
ZFStyleable * to,
zffloat progress )

update object according to progress

progress usually ranged in [0.0, 1.0], but may exceed range such as bouncing

◆ progressOnUpdate()


The documentation for this class was generated from the following file: