+// ----------------------------------------------------------------------------
+// wxObjectWriterCallback
+//
+// This class will be asked during the streaming-out process about every single
+// property or object instance. It can veto streaming out by returning false
+// or modify the value before it is streamed-out.
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxObjectWriter;
+class WXDLLIMPEXP_BASE wxObjectReader;
+class WXDLLIMPEXP_BASE wxClassInfo;
+class WXDLLIMPEXP_BASE wxAnyList;
+class WXDLLIMPEXP_BASE wxPropertyInfo;
+class WXDLLIMPEXP_BASE wxAny;
+class WXDLLIMPEXP_BASE wxObjectWriter;
+class WXDLLIMPEXP_BASE wxHandlerInfo;
+
+class WXDLLIMPEXP_BASE wxObjectWriterCallback
+{
+public:
+ virtual ~wxObjectWriterCallback() {}
+
+ // will be called before an object is written, may veto by returning false
+ virtual bool BeforeWriteObject( wxObjectWriter *WXUNUSED(writer),
+ const wxObject *WXUNUSED(object),
+ const wxClassInfo *WXUNUSED(classInfo),
+ const wxStringToAnyHashMap &WXUNUSED(metadata))
+ { return true; }
+
+ // will be called after this object has been written, may be
+ // needed for adjusting stacks
+ virtual void AfterWriteObject( wxObjectWriter *WXUNUSED(writer),
+ const wxObject *WXUNUSED(object),
+ const wxClassInfo *WXUNUSED(classInfo) )
+ {}
+
+ // will be called before a property gets written, may change the value,
+ // eg replace a concrete wxSize by wxSize( wxDefaultCoord, wxDefaultCoord )
+ // or veto writing that property at all by returning false
+ virtual bool BeforeWriteProperty( wxObjectWriter *WXUNUSED(writer),
+ const wxObject *WXUNUSED(object),
+ const wxPropertyInfo *WXUNUSED(propInfo),
+ const wxAny &WXUNUSED(value) )
+ { return true; }
+
+ // will be called before a property gets written, may change the value,
+ // eg replace a concrete wxSize by wxSize( wxDefaultCoord, wxDefaultCoord )
+ // or veto writing that property at all by returning false
+ virtual bool BeforeWriteProperty( wxObjectWriter *WXUNUSED(writer),
+ const wxObject *WXUNUSED(object),
+ const wxPropertyInfo *WXUNUSED(propInfo),
+ const wxAnyList &WXUNUSED(value) )
+ { return true; }
+
+ // will be called after a property has been written out, may be needed
+ // for adjusting stacks
+ virtual void AfterWriteProperty( wxObjectWriter *WXUNUSED(writer),
+ const wxPropertyInfo *WXUNUSED(propInfo) )
+ {}
+
+ // will be called before this delegate gets written
+ virtual bool BeforeWriteDelegate( wxObjectWriter *WXUNUSED(writer),
+ const wxObject *WXUNUSED(object),
+ const wxClassInfo* WXUNUSED(classInfo),
+ const wxPropertyInfo *WXUNUSED(propInfo),
+ const wxObject *&WXUNUSED(eventSink),
+ const wxHandlerInfo* &WXUNUSED(handlerInfo) )
+ { return true; }
+
+ virtual void AfterWriteDelegate( wxObjectWriter *WXUNUSED(writer),
+ const wxObject *WXUNUSED(object),
+ const wxClassInfo* WXUNUSED(classInfo),
+ const wxPropertyInfo *WXUNUSED(propInfo),
+ const wxObject *&WXUNUSED(eventSink),
+ const wxHandlerInfo* &WXUNUSED(handlerInfo) )
+ { }
+};