X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c263d56675aa7e75115d2380515a7a539f5a880..b8f0ac88a51be909c0e5b87657ea0a5dc9bbb721:/include/wx/xtixml.h?ds=sidebyside diff --git a/include/wx/xtixml.h b/include/wx/xtixml.h index 7ddda9032e..d40e0e036e 100644 --- a/include/wx/xtixml.h +++ b/include/wx/xtixml.h @@ -2,7 +2,7 @@ // Name: wx/xtixml.h // Purpose: xml streaming runtime metadata information (extended class info) // Author: Stefan Csomor -// Modified by: +// Modified by: // Created: 27/07/03 // RCS-ID: $Id$ // Copyright: (c) 2003 Stefan Csomor @@ -12,24 +12,29 @@ #ifndef _WX_XTIXMLH__ #define _WX_XTIXMLH__ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "xtixml.h" -#endif - -#include "wx/wx.h" +#include "wx/defs.h" #if wxUSE_EXTENDED_RTTI +#include "wx/string.h" #include "wx/xtistrm.h" -class WXDLLIMPEXP_XML wxXmlNode ; +/* +class WXDLLIMPEXP_XML wxXmlNode; +class WXDLLIMPEXP_BASE wxPropertyInfo; +class WXDLLIMPEXP_BASE wxObject; +class WXDLLIMPEXP_BASE wxClassInfo; +class WXDLLIMPEXP_BASE wxAnyList; +class WXDLLIMPEXP_BASE wxHandlerInfo; +class WXDLLIMPEXP_BASE wxObjectWriterCallback; +*/ -class WXDLLIMPEXP_XML wxXmlWriter : public wxWriter +class WXDLLIMPEXP_XML wxObjectXmlWriter: public wxObjectWriter { -public : +public: - wxXmlWriter( wxXmlNode * parent ) ; - ~wxXmlWriter() ; + wxObjectXmlWriter( wxXmlNode * parent ); + virtual ~wxObjectXmlWriter(); // // streaming callbacks @@ -43,66 +48,71 @@ public : // these callbacks really write out the values in the stream format // begins writing out a new toplevel entry which has the indicated unique name - virtual void DoBeginWriteTopLevelEntry( const wxString &name ) ; + virtual void DoBeginWriteTopLevelEntry( const wxString &name ); // ends writing out a new toplevel entry which has the indicated unique name - virtual void DoEndWriteTopLevelEntry( const wxString &name ) ; + virtual void DoEndWriteTopLevelEntry( const wxString &name ); // start of writing an object having the passed in ID - virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID , wxxVariantArray &metadata ) ; + virtual void DoBeginWriteObject(const wxObject *object, + const wxClassInfo *classInfo, int objectID, const wxStringToAnyHashMap &metadata ); - // end of writing an toplevel object name param is used for unique identification within the container - virtual void DoEndWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID ) ; + // end of writing an toplevel object name param is used for unique + // identification within the container + virtual void DoEndWriteObject(const wxObject *object, + const wxClassInfo *classInfo, int objectID ); // writes a simple property in the stream format - virtual void DoWriteSimpleType( wxxVariant &value ) ; + virtual void DoWriteSimpleType( const wxAny &value ); // start of writing a complex property into the stream ( - virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ) ; + virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ); // end of writing a complex property into the stream - virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ) ; + virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ); - virtual void DoBeginWriteElement() ; - virtual void DoEndWriteElement() ; + virtual void DoBeginWriteElement(); + virtual void DoEndWriteElement(); - // insert an object reference to an already written object - virtual void DoWriteRepeatedObject( int objectID ) ; + // insert an object reference to an already written object + virtual void DoWriteRepeatedObject( int objectID ); // insert a null reference - virtual void DoWriteNullObject() ; + virtual void DoWriteNullObject(); // writes a delegate in the stream format - virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo , const wxPropertyInfo *propInfo , - const wxObject *eventSink , int sinkObjectID , const wxClassInfo* eventSinkClassInfo , const wxHandlerInfo* handlerIndo ) ; -private : - struct wxXmlWriterInternal ; - wxXmlWriterInternal* m_data ; -} ; + virtual void DoWriteDelegate( const wxObject *object, + const wxClassInfo* classInfo, const wxPropertyInfo *propInfo, + const wxObject *eventSink, int sinkObjectID, + const wxClassInfo* eventSinkClassInfo, const wxHandlerInfo* handlerIndo ); + +private: + struct wxObjectXmlWriterInternal; + wxObjectXmlWriterInternal* m_data; +}; /* -wxXmlReader handles streaming in a class from XML +wxObjectXmlReader handles streaming in a class from XML */ -class WXDLLIMPEXP_XML wxXmlReader : public wxReader +class WXDLLIMPEXP_XML wxObjectXmlReader: public wxObjectReader { public: - wxXmlReader(wxXmlNode *parent) { m_parent = parent ; } - ~wxXmlReader() {} + wxObjectXmlReader(wxXmlNode *parent) { m_parent = parent; } + virtual ~wxObjectXmlReader() {} // Reads a component from XML. The return value is the root object ID, which can - // then be used to ask the depersister about that object + // then be used to ask the readercallback about that object - virtual int ReadObject( const wxString &name , wxDepersister *depersist ) ; + virtual int ReadObject( const wxString &name, wxObjectReaderCallback *readercallback ); -private : - int ReadComponent(wxXmlNode *parent, wxDepersister *callbacks); +private: + int ReadComponent(wxXmlNode *parent, wxObjectReaderCallback *callbacks); // read the content of this node (simple type) and return the corresponding value - wxxVariant ReadValue(wxXmlNode *Node, - const wxTypeInfo *type ); + wxAny ReadValue(wxXmlNode *Node, const wxTypeInfo *type ); - wxXmlNode * m_parent ; + wxXmlNode * m_parent; }; #endif // wxUSE_EXTENDED_RTTI