X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5e6e278dc129b31a0aa3ce5d9eda41c0dc5e1fe7..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/interface/wx/richtext/richtextxml.h?ds=sidebyside diff --git a/interface/wx/richtext/richtextxml.h b/interface/wx/richtext/richtextxml.h index 74fc2a2bc4..b5a838c6ea 100644 --- a/interface/wx/richtext/richtextxml.h +++ b/interface/wx/richtext/richtextxml.h @@ -3,7 +3,7 @@ // Purpose: interface of wxRichTextXMLHandler // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -35,8 +35,8 @@ public: /** Constructor. */ - wxRichTextXMLHandler(const wxString& name = wxT("XML"), - const wxString& ext = wxT("xml"), + wxRichTextXMLHandler(const wxString& name = "XML", + const wxString& ext = "xml", int type = wxRICHTEXT_TYPE_XML); /** @@ -49,18 +49,10 @@ public: */ virtual bool CanSave() const; - /** - Creates XML code for a given character or paragraph style. - */ - wxString CreateStyle(const wxTextAttr& attr, bool isPara = false); - /** 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. @@ -77,12 +69,6 @@ public: */ 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. */ @@ -98,7 +84,18 @@ public: /** 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: