X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..c86b476dd540ac302ad023dc864c7c7d4f9ed823:/interface/wx/richtext/richtextxml.h?ds=sidebyside diff --git a/interface/wx/richtext/richtextxml.h b/interface/wx/richtext/richtextxml.h index f469e5401a..74fc2a2bc4 100644 --- a/interface/wx/richtext/richtextxml.h +++ b/interface/wx/richtext/richtextxml.h @@ -8,13 +8,23 @@ /** @class wxRichTextXMLHandler - @headerfile richtextxml.h wx/richtext/richtextxml.h A handler for loading and saving content in an XML format specific - to wxRichTextBuffer. You can either add the handler to the buffer - and load and save through the buffer or control API, or you can - create an instance of the handler on the stack and call its - functions directly. + to wxRichTextBuffer. + + You can either add the handler to the buffer and load and save through + the buffer or control API, or you can create an instance of the handler + on the stack and call its functions directly. + + + @section richtextxmlhandler_flags Handler flags + + The following flags can be used with this handler, via the handler's SetFlags() + function or the buffer or control's SetHandlerFlags() function: + + - wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET + Include the style sheet in loading and saving operations. + @library{wxrichtext} @category{richtext} @@ -23,36 +33,27 @@ class wxRichTextXMLHandler : public wxRichTextFileHandler { public: /** - , wxString&@e ext = wxT("xml"), @b int@e type = wxRICHTEXT_TYPE_XML) Constructor. */ - wxRichTextXMLHandler() const; + wxRichTextXMLHandler(const wxString& name = wxT("XML"), + const wxString& ext = wxT("xml"), + int type = wxRICHTEXT_TYPE_XML); /** Returns @true. */ - bool CanLoad() const; + virtual bool CanLoad() const; /** Returns @true. */ - bool CanSave() const; + 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. */ @@ -98,5 +99,17 @@ public: Recursively imports an object. */ bool ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node); + +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); };