]> git.saurik.com Git - wxWidgets.git/blame - include/wx/xtixml.h
regenerate the makefiles with correct new test name (iostreams.cpp, iostream.cpp...
[wxWidgets.git] / include / wx / xtixml.h
CommitLineData
9c8046dd
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/xtixml.h
3// Purpose: xml streaming runtime metadata information (extended class info)
4// Author: Stefan Csomor
cab1a605 5// Modified by:
9c8046dd
SC
6// Created: 27/07/03
7// RCS-ID: $Id$
8// Copyright: (c) 2003 Stefan Csomor
65571936 9// Licence: wxWindows licence
9c8046dd
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_XTIXMLH__
13#define _WX_XTIXMLH__
14
9c8046dd
SC
15#include "wx/wx.h"
16
17#if wxUSE_EXTENDED_RTTI
18
19#include "wx/xtistrm.h"
20
b5dbe15d 21class WXDLLIMPEXP_FWD_XML wxXmlNode ;
9c8046dd 22
1c263d56 23class WXDLLIMPEXP_XML wxXmlWriter : public wxWriter
9c8046dd
SC
24{
25public :
26
27 wxXmlWriter( wxXmlNode * parent ) ;
d3c7fc99 28 virtual ~wxXmlWriter() ;
9c8046dd
SC
29
30 //
31 // streaming callbacks
32 //
33 // these callbacks really write out the values in the stream format
34 //
35
36 //
37 // streaming callbacks
38 //
39 // these callbacks really write out the values in the stream format
40
41 // begins writing out a new toplevel entry which has the indicated unique name
42 virtual void DoBeginWriteTopLevelEntry( const wxString &name ) ;
43
44 // ends writing out a new toplevel entry which has the indicated unique name
45 virtual void DoEndWriteTopLevelEntry( const wxString &name ) ;
46
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 ) ;
49
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 ) ;
52
53 // writes a simple property in the stream format
54 virtual void DoWriteSimpleType( wxxVariant &value ) ;
55
56 // start of writing a complex property into the stream (
57 virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ) ;
58
59 // end of writing a complex property into the stream
60 virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ) ;
61
62 virtual void DoBeginWriteElement() ;
63 virtual void DoEndWriteElement() ;
64
cab1a605 65 // insert an object reference to an already written object
9c8046dd
SC
66 virtual void DoWriteRepeatedObject( int objectID ) ;
67
68 // insert a null reference
69 virtual void DoWriteNullObject() ;
70
71 // writes a delegate in the stream format
cab1a605 72 virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo , const wxPropertyInfo *propInfo ,
9c8046dd
SC
73 const wxObject *eventSink , int sinkObjectID , const wxClassInfo* eventSinkClassInfo , const wxHandlerInfo* handlerIndo ) ;
74private :
75 struct wxXmlWriterInternal ;
76 wxXmlWriterInternal* m_data ;
77} ;
78
79/*
80wxXmlReader handles streaming in a class from XML
81*/
82
1c263d56 83class WXDLLIMPEXP_XML wxXmlReader : public wxReader
9c8046dd
SC
84{
85public:
86 wxXmlReader(wxXmlNode *parent) { m_parent = parent ; }
d3c7fc99 87 virtual ~wxXmlReader() {}
9c8046dd
SC
88
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
91
92 virtual int ReadObject( const wxString &name , wxDepersister *depersist ) ;
93
94private :
95 int ReadComponent(wxXmlNode *parent, wxDepersister *callbacks);
96
97 // read the content of this node (simple type) and return the corresponding value
98 wxxVariant ReadValue(wxXmlNode *Node,
99 const wxTypeInfo *type );
100
101 wxXmlNode * m_parent ;
102};
103
104#endif // wxUSE_EXTENDED_RTTI
105
106#endif