2003-08-23 15:40:04 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/xtixml.h
|
|
|
|
// Purpose: xml streaming runtime metadata information (extended class info)
|
|
|
|
// Author: Stefan Csomor
|
2004-09-24 10:32:35 -04:00
|
|
|
// Modified by:
|
2003-08-23 15:40:04 -04:00
|
|
|
// Created: 27/07/03
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2003 Stefan Csomor
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2003-08-23 15:40:04 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_XTIXMLH__
|
|
|
|
#define _WX_XTIXMLH__
|
|
|
|
|
|
|
|
#include "wx/wx.h"
|
|
|
|
|
|
|
|
#if wxUSE_EXTENDED_RTTI
|
|
|
|
|
|
|
|
#include "wx/xtistrm.h"
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_XML wxXmlNode ;
|
2003-08-23 15:40:04 -04:00
|
|
|
|
2003-08-24 11:22:07 -04:00
|
|
|
class WXDLLIMPEXP_XML wxXmlWriter : public wxWriter
|
2003-08-23 15:40:04 -04:00
|
|
|
{
|
|
|
|
public :
|
|
|
|
|
|
|
|
wxXmlWriter( wxXmlNode * parent ) ;
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxXmlWriter() ;
|
2003-08-23 15:40:04 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// streaming callbacks
|
|
|
|
//
|
|
|
|
// these callbacks really write out the values in the stream format
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
// streaming callbacks
|
|
|
|
//
|
|
|
|
// 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 ) ;
|
|
|
|
|
|
|
|
// ends writing out a new toplevel entry which has the indicated unique 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 ) ;
|
|
|
|
|
|
|
|
// 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 ) ;
|
|
|
|
|
|
|
|
// start of writing a complex property into the stream (
|
|
|
|
virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ) ;
|
|
|
|
|
|
|
|
// end of writing a complex property into the stream
|
|
|
|
virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ) ;
|
|
|
|
|
|
|
|
virtual void DoBeginWriteElement() ;
|
|
|
|
virtual void DoEndWriteElement() ;
|
|
|
|
|
2004-09-24 10:32:35 -04:00
|
|
|
// insert an object reference to an already written object
|
2003-08-23 15:40:04 -04:00
|
|
|
virtual void DoWriteRepeatedObject( int objectID ) ;
|
|
|
|
|
|
|
|
// insert a null reference
|
|
|
|
virtual void DoWriteNullObject() ;
|
|
|
|
|
|
|
|
// writes a delegate in the stream format
|
2004-09-24 10:32:35 -04:00
|
|
|
virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo , const wxPropertyInfo *propInfo ,
|
2003-08-23 15:40:04 -04:00
|
|
|
const wxObject *eventSink , int sinkObjectID , const wxClassInfo* eventSinkClassInfo , const wxHandlerInfo* handlerIndo ) ;
|
|
|
|
private :
|
|
|
|
struct wxXmlWriterInternal ;
|
|
|
|
wxXmlWriterInternal* m_data ;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxXmlReader handles streaming in a class from XML
|
|
|
|
*/
|
|
|
|
|
2003-08-24 11:22:07 -04:00
|
|
|
class WXDLLIMPEXP_XML wxXmlReader : public wxReader
|
2003-08-23 15:40:04 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxXmlReader(wxXmlNode *parent) { m_parent = parent ; }
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxXmlReader() {}
|
2003-08-23 15:40:04 -04:00
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
virtual int ReadObject( const wxString &name , wxDepersister *depersist ) ;
|
|
|
|
|
|
|
|
private :
|
|
|
|
int ReadComponent(wxXmlNode *parent, wxDepersister *callbacks);
|
|
|
|
|
|
|
|
// read the content of this node (simple type) and return the corresponding value
|
|
|
|
wxxVariant ReadValue(wxXmlNode *Node,
|
|
|
|
const wxTypeInfo *type );
|
|
|
|
|
|
|
|
wxXmlNode * m_parent ;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // wxUSE_EXTENDED_RTTI
|
|
|
|
|
|
|
|
#endif
|