// Purpose: interface of wxRichTextXMLHandler
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
/**
Constructor.
*/
- wxRichTextXMLHandler(const wxString& name = wxT("XML"),
- const wxString& ext = wxT("xml"),
- int type = wxRICHTEXT_TYPE_XML) const;
+ wxRichTextXMLHandler(const wxString& name = "XML",
+ const wxString& ext = "xml",
+ int type = wxRICHTEXT_TYPE_XML);
/**
Returns @true.
*/
virtual bool CanSave() const;
- /**
- Creates XML code for a given character or paragraph style.
- */
- wxString CreateStyle(const wxTextAttr& attr, bool isPara = false);
-
- /**
- Loads buffer context from the given stream.
- */
- bool DoLoadFile(wxRichTextBuffer* buffer, wxInputStream& stream);
-
- /**
- Saves buffer context to the given stream.
- */
- bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream);
-
/**
Recursively exports an object to the stream.
*/
- bool ExportXML(wxOutputStream& stream, wxMBConv* convMem,
- wxMBConv* convFile,
- wxRichTextObject& obj,
- int level);
+ bool ExportXML(wxOutputStream& stream, wxRichTextObject& obj, int level);
/**
Helper function: gets node context.
*/
wxString GetParamValue(wxXmlNode* node, const wxString& param);
- /**
- Helper function: gets style parameters from the given XML node.
- */
- bool GetStyle(wxTextAttr& attr, wxXmlNode* node,
- bool isPara = false);
-
/**
Helper function: gets text from the node.
*/
/**
Recursively imports an object.
*/
- bool ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node);
+ bool ImportXML(wxRichTextBuffer* buffer, wxRichTextObject* obj, wxXmlNode* node);
+
+ /**
+ Call with XML node name, C++ class name so that wxRTC can read in the node.
+ If you add a custom object, call this.
+ */
+ static void RegisterNodeName(const wxString& nodeName, const wxString& className) { sm_nodeNameToClassMap[nodeName] = className; }
+
+ /**
+ Cleans up the mapping between node name and C++ class.
+ */
+ static void ClearNodeToClassMap() { sm_nodeNameToClassMap.clear(); }
+
+protected:
+
+ /**
+ Loads buffer context from the given stream.
+ */
+ virtual bool DoLoadFile(wxRichTextBuffer* buffer, wxInputStream& stream);
+
+ /**
+ Saves buffer context to the given stream.
+ */
+ virtual bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream);
};