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 ZFOutputFormatBasic ZFStyleList ZFTypeIdWrapper ZFUIButtonGroup ZFUICellAdapterBasic ZFUICellArray ZFUIDialog ZFUIGlobalStyle ZFUIImage ZFUILayoutParam ZFUIListViewCellUpdater ZFUIScrollThumbDefault ZFUITextConfig ZFUIView

Public Member Functions

virtual zfanyT< ZFStyleabledefaultStyle (void)
 return default style of this instance
 
void styleableCopyFrom (ZFObject *anotherStyleable)
 copy style from another styleable, see ZFStyleable
 
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
 
- 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 styleableCopyFrom, see ZFStyleable
 

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::styleableCopyFrom
for how styleable would be copied, see styleableOnCopyPropertyFrom

Member Function Documentation

◆ 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

◆ styleableCopyFrom()

void ZFStyleable::styleableCopyFrom ( ZFObject * anotherStyleable)

copy style from another styleable, see ZFStyleable

usually you should not override this method, override styleableOnCopyFrom instead

◆ styleableOnCopyFrom()

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

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

Reimplemented in ZFTypeIdWrapper, ZFUIAutoLayout, ZFUIAutoLayoutParam, ZFUIImage, and ZFUIView.


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