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 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "xtixml.h"
21 #if wxUSE_EXTENDED_RTTI
23 #include "wx/xtistrm.h"
25 class WXDLLIMPEXP_XML wxXmlNode
;
27 class WXDLLIMPEXP_XML wxXmlWriter
: public wxWriter
31 wxXmlWriter( wxXmlNode
* parent
) ;
35 // streaming callbacks
37 // these callbacks really write out the values in the stream format
41 // streaming callbacks
43 // these callbacks really write out the values in the stream format
45 // begins writing out a new toplevel entry which has the indicated unique name
46 virtual void DoBeginWriteTopLevelEntry( const wxString
&name
) ;
48 // ends writing out a new toplevel entry which has the indicated unique name
49 virtual void DoEndWriteTopLevelEntry( const wxString
&name
) ;
51 // start of writing an object having the passed in ID
52 virtual void DoBeginWriteObject(const wxObject
*object
, const wxClassInfo
*classInfo
, int objectID
, wxxVariantArray
&metadata
) ;
54 // end of writing an toplevel object name param is used for unique identification within the container
55 virtual void DoEndWriteObject(const wxObject
*object
, const wxClassInfo
*classInfo
, int objectID
) ;
57 // writes a simple property in the stream format
58 virtual void DoWriteSimpleType( wxxVariant
&value
) ;
60 // start of writing a complex property into the stream (
61 virtual void DoBeginWriteProperty( const wxPropertyInfo
*propInfo
) ;
63 // end of writing a complex property into the stream
64 virtual void DoEndWriteProperty( const wxPropertyInfo
*propInfo
) ;
66 virtual void DoBeginWriteElement() ;
67 virtual void DoEndWriteElement() ;
69 // insert an object reference to an already written object
70 virtual void DoWriteRepeatedObject( int objectID
) ;
72 // insert a null reference
73 virtual void DoWriteNullObject() ;
75 // writes a delegate in the stream format
76 virtual void DoWriteDelegate( const wxObject
*object
, const wxClassInfo
* classInfo
, const wxPropertyInfo
*propInfo
,
77 const wxObject
*eventSink
, int sinkObjectID
, const wxClassInfo
* eventSinkClassInfo
, const wxHandlerInfo
* handlerIndo
) ;
79 struct wxXmlWriterInternal
;
80 wxXmlWriterInternal
* m_data
;
84 wxXmlReader handles streaming in a class from XML
87 class WXDLLIMPEXP_XML wxXmlReader
: public wxReader
90 wxXmlReader(wxXmlNode
*parent
) { m_parent
= parent
; }
93 // Reads a component from XML. The return value is the root object ID, which can
94 // then be used to ask the depersister about that object
96 virtual int ReadObject( const wxString
&name
, wxDepersister
*depersist
) ;
99 int ReadComponent(wxXmlNode
*parent
, wxDepersister
*callbacks
);
101 // read the content of this node (simple type) and return the corresponding value
102 wxxVariant
ReadValue(wxXmlNode
*Node
,
103 const wxTypeInfo
*type
);
105 wxXmlNode
* m_parent
;
108 #endif // wxUSE_EXTENDED_RTTI