X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c6182d489c7cf71c9dba511e3f68671f5b17d50d..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/include/wx/richtext/richtextxml.h diff --git a/include/wx/richtext/richtextxml.h b/include/wx/richtext/richtextxml.h index 44a933cb48..14ce5236d8 100644 --- a/include/wx/richtext/richtextxml.h +++ b/include/wx/richtext/richtextxml.h @@ -16,6 +16,7 @@ * Includes */ +#include "wx/hashmap.h" #include "wx/richtext/richtextbuffer.h" #include "wx/richtext/richtextstyles.h" @@ -97,6 +98,17 @@ public: wxString GetText(wxXmlNode *node, const wxString& param = wxEmptyString, bool translate = false); static wxXmlNode* FindNode(wxXmlNode* node, const wxString& name); + /** + 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: #if wxUSE_STREAMS virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); @@ -108,6 +120,8 @@ protected: wxMBConv* m_convMem; wxMBConv* m_convFile; #endif + + static wxStringToStringHashMap sm_nodeNameToClassMap; }; #endif