1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: xml streaming runtime metadata information (extended class info)
4 // Author: Stefan Csomor
8 // Copyright: (c) 2003 Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 #if wxUSE_EXTENDED_RTTI
19 #include "wx/xtistrm.h"
21 class WXDLLIMPEXP_FWD_XML wxXmlNode
;
23 class WXDLLIMPEXP_XML wxXmlWriter
: public wxWriter
27 wxXmlWriter( wxXmlNode
* parent
) ;
28 virtual ~wxXmlWriter() ;
31 // streaming callbacks
33 // these callbacks really write out the values in the stream format
37 // streaming callbacks
39 // these callbacks really write out the values in the stream format
41 // begins writing out a new toplevel entry which has the indicated unique name
42 virtual void DoBeginWriteTopLevelEntry( const wxString
&name
) ;
44 // ends writing out a new toplevel entry which has the indicated unique name
45 virtual void DoEndWriteTopLevelEntry( const wxString
&name
) ;
47 // start of writing an object having the passed in ID
48 virtual void DoBeginWriteObject(const wxObject
*object
, const wxClassInfo
*classInfo
, int objectID
, wxxVariantArray
&metadata
) ;
50 // end of writing an toplevel object name param is used for unique identification within the container
51 virtual void DoEndWriteObject(const wxObject
*object
, const wxClassInfo
*classInfo
, int objectID
) ;
53 // writes a simple property in the stream format
54 virtual void DoWriteSimpleType( wxxVariant
&value
) ;
56 // start of writing a complex property into the stream (
57 virtual void DoBeginWriteProperty( const wxPropertyInfo
*propInfo
) ;
59 // end of writing a complex property into the stream
60 virtual void DoEndWriteProperty( const wxPropertyInfo
*propInfo
) ;
62 virtual void DoBeginWriteElement() ;
63 virtual void DoEndWriteElement() ;
65 // insert an object reference to an already written object
66 virtual void DoWriteRepeatedObject( int objectID
) ;
68 // insert a null reference
69 virtual void DoWriteNullObject() ;
71 // writes a delegate in the stream format
72 virtual void DoWriteDelegate( const wxObject
*object
, const wxClassInfo
* classInfo
, const wxPropertyInfo
*propInfo
,
73 const wxObject
*eventSink
, int sinkObjectID
, const wxClassInfo
* eventSinkClassInfo
, const wxHandlerInfo
* handlerIndo
) ;
75 struct wxXmlWriterInternal
;
76 wxXmlWriterInternal
* m_data
;
80 wxXmlReader handles streaming in a class from XML
83 class WXDLLIMPEXP_XML wxXmlReader
: public wxReader
86 wxXmlReader(wxXmlNode
*parent
) { m_parent
= parent
; }
87 virtual ~wxXmlReader() {}
89 // Reads a component from XML. The return value is the root object ID, which can
90 // then be used to ask the depersister about that object
92 virtual int ReadObject( const wxString
&name
, wxDepersister
*depersist
) ;
95 int ReadComponent(wxXmlNode
*parent
, wxDepersister
*callbacks
);
97 // read the content of this node (simple type) and return the corresponding value
98 wxxVariant
ReadValue(wxXmlNode
*Node
,
99 const wxTypeInfo
*type
);
101 wxXmlNode
* m_parent
;
104 #endif // wxUSE_EXTENDED_RTTI