ZFFramework
 
Loading...
Searching...
No Matches
ZFStyleLoad.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFStyleLoad_h_
7#define _ZFI_ZFStyleLoad_h_
8
9#include "ZFObjectIO.h"
11
19ZFEVENT_GLOBAL(ZFLIB_ZFCore, ZFStyleLoadItemBegin)
28ZFEVENT_GLOBAL(ZFLIB_ZFCore, ZFStyleLoadItemEnd)
36ZFEVENT_GLOBAL(ZFLIB_ZFCore, ZFStyleLoadItemError)
38
39// ============================================================
40zfclassFwd _ZFP_ZFStyleListPrivate;
44zfclass ZFLIB_ZFCore ZFStyleList : zfextend ZFStyle {
45 ZFOBJECT_DECLARE(ZFStyleList, ZFStyle)
46
47public:
52 , ZFMP_IN(zfindex, index)
53 )
55 ZFMETHOD_DECLARE_1(ZFStyleable *, itemValueAt
56 , ZFMP_IN(zfindex, index)
57 )
60 , ZFMP_IN(const zfstring &, key)
61 , ZFMP_IN(ZFStyleable *, value)
62 )
63
64protected:
66 virtual void objectOnInit(void);
68 virtual void objectOnDealloc(void);
69
70protected:
73 ZF_IN const ZFSerializableData &serializableData
74 , ZF_OUT_OPT zfstring *outErrorHint = zfnull
75 , ZF_OUT_OPT ZFSerializableData *outErrorPos = zfnull
76 );
79 ZF_IN_OUT ZFSerializableData &serializableData
80 , ZF_OUT_OPT zfstring *outErrorHint = zfnull
81 , ZF_IN_OPT ZFSerializable *refOwner = zfnull
82 );
83
84private:
85 _ZFP_ZFStyleListPrivate *d;
86};
87
88// ============================================================
101 , ZFMP_IN(const zfstring &, fileName)
103
108 , ZFMP_IN(const ZFPathInfo &, pathInfo)
109 , ZFMP_IN_OPT(const zfstring &, childPath, zfnull)
115 , ZFMP_IN(ZFIOImpl *, ioImpl)
116 , ZFMP_IN(const zfstring &, pathData)
117 , ZFMP_IN_OPT(const zfstring &, childPath, zfnull)
119
134 , ZFMP_IN(const ZFSerializableData &, serializableData)
136
141 , ZFMP_IN(ZFStyleList *, styleList)
143
144// ============================================================
176 , ZFMP_IN(const ZFPathInfo &, pathInfo)
178
180#endif // #ifndef _ZFI_ZFStyleLoad_h_
181
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:196
#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:184
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
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:200
#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 zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#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 ZFMETHOD_FUNC_DECLARE_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:763
#define ZFMETHOD_FUNC_DECLARE_3(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:910
#define ZFMETHOD_FUNC_DECLARE_1(ZFLIB_, ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:624
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_END(NameSpace)
end namespace
Definition ZFNamespace.h:60
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define ZF_NAMESPACE_BEGIN(NameSpace)
begin namespace
Definition ZFNamespace.h:40
#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
high level object IO
#define ZFEVENT_GLOBAL(ZFLIB_, YourEvent)
declare a observer event in global scope, see ZFEVENT
Definition ZFObjectObserver.h:357
zfbool ZFStyleLoad(const ZFPathInfo &pathInfo)
util to load multiple styles from directory
zfbool ZFStyleLoadCheck(const zfstring &fileName)
check whether the item should be load as style
zfbool ZFStyleLoadItem(const ZFPathInfo &pathInfo, const zfstring &childPath=(zft_zfnull))
explicitly load specified file (bypass ZFStyleLoadCheck), see ZFStyleLoad
see ZFIOImplForPathType
Definition ZFIODef_fwd.h:298
path related info storage for impl, actual meaning of the info depends on impl
Definition ZFPathInfo.h:34
ZFSerializable's data container, see ZFSerializable.
Definition ZFSerializableData.h:74
see ZFStyleLoad
Definition ZFStyleLoad.h:44
virtual void objectOnInit(void)
override this to init your object
virtual zfindex itemCount()
style count
virtual zfbool serializableOnSerializeToData(ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
corresponding to serializableOnSerializeFromData, return whether the task is success,...
virtual void objectOnDealloc(void)
override this to destroy your object
virtual ZFStyleable * itemValueAt(zfindex index)
style value
virtual void itemForKey(const zfstring &key, ZFStyleable *value)
style value
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 const zfstring & itemKeyAt(zfindex index)
style key
Definition ZFApp.h:13