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
12// ============================================================
13zfclassFwd _ZFP_ZFStyleListPrivate;
17zfclass ZFLIB_ZFCore ZFStyleList : zfextend ZFStyle {
18 ZFOBJECT_DECLARE(ZFStyleList, ZFStyle)
19
20public:
25 , ZFMP_IN(zfindex, index)
26 )
28 ZFMETHOD_DECLARE_1(ZFStyleable *, itemValueAt
29 , ZFMP_IN(zfindex, index)
30 )
33 , ZFMP_IN(const zfstring &, key)
34 , ZFMP_IN(ZFStyleable *, value)
35 )
36
37protected:
39 virtual void objectOnInit(void);
41 virtual void objectOnDealloc(void);
42
43protected:
46 ZF_IN const ZFSerializableData &serializableData
47 , ZF_OUT_OPT zfstring *outErrorHint = zfnull
48 , ZF_OUT_OPT ZFSerializableData *outErrorPos = zfnull
49 );
52 ZF_IN_OUT ZFSerializableData &serializableData
53 , ZF_OUT_OPT zfstring *outErrorHint = zfnull
54 , ZF_IN_OPT ZFSerializable *refOwner = zfnull
55 );
56
57private:
58 _ZFP_ZFStyleListPrivate *d;
59};
60
61extern ZFLIB_ZFCore void _ZFP_ZFStyleLoadErrorCallbackForConsole(ZF_IN const ZFArgs &zfargs);
63#define ZFStyleLoadErrorCallbackForConsole() ZFCallbackForFunc(_ZFP_ZFStyleLoadErrorCallbackForConsole)
68 , ZFMP_IN_OUT(const ZFOutput &, output)
69 , ZFMP_IN(const ZFArgs &, zfargs)
70 )
71
72// ============================================================
108 , ZFMP_IN(const ZFPathInfo &, pathInfo)
109 , ZFMP_IN_OPT(const ZFListener &, errorCallback, ZFStyleLoadErrorCallbackDefault())
111
126 , ZFMP_IN(const ZFSerializableData &, serializableData)
127 , ZFMP_IN_OPT(const ZFListener &, errorCallback, ZFStyleLoadErrorCallbackDefault())
129
134 , ZFMP_IN(ZFStyleList *, styleList)
135 , ZFMP_IN_OPT(const ZFListener &, errorCallback, ZFStyleLoadErrorCallbackDefault())
137
139#endif // #ifndef _ZFI_ZFStyleLoad_h_
140
#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:192
#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
_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 ZFEXPORT_VAR_DECLARE(ZFLIB_, Type, Name)
util to export global variable
Definition ZFExport.h:68
#define ZFMP_IN_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:117
#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 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
high level object IO
void ZFStyleLoadErrorHint(const ZFOutput &output, const ZFArgs &zfargs)
util for impl to output error hint
zfbool ZFStyleLoad(const ZFPathInfo &pathInfo, const ZFListener &errorCallback=(ZFStyleLoadErrorCallbackDefault()))
util to load multiple styles from directory
ZFListener & ZFStyleLoadErrorCallbackDefault(void)
default error callback for ZFStyleLoad
Definition ZFStyleLoad.h:65
listener data used by ZFListener
Definition ZFArgs.h:20
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
general output callback
Definition ZFIOCallback_output.h:37
path related info storage for impl, actual meaning of the info depends on impl
Definition ZFPathInfo.h:35
ZFSerializable's data container, see ZFSerializable.
Definition ZFSerializableData.h:74
see ZFStyleLoad
Definition ZFStyleLoad.h:17
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