X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5d7836c47de679f03b1b7e738c77164c11bd3689..5b464d6bbd088e122bca53f2a4a4ce1f09378de4:/include/wx/richtext/richtextxml.h diff --git a/include/wx/richtext/richtextxml.h b/include/wx/richtext/richtextxml.h index be318f9f3a..493511f802 100644 --- a/include/wx/richtext/richtextxml.h +++ b/include/wx/richtext/richtextxml.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richeditxml.h +// Name: wx/richtext/richeditxml.h // Purpose: XML and HTML I/O for wxRichTextCtrl // Author: Julian Smart -// Modified by: +// Modified by: // Created: 2005-09-30 -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -16,19 +16,18 @@ * Includes */ -#include "wx/defs.h" - -#if wxUSE_RICHTEXT - #include "wx/richtext/richtextbuffer.h" +#include "wx/richtext/richtextstyles.h" + +#if wxUSE_RICHTEXT && wxUSE_XML /*! * wxRichTextXMLHandler */ -class WXDLLIMPEXP_XML wxXmlNode; +class WXDLLIMPEXP_FWD_XML wxXmlNode; -class WXDLLIMPEXP_ADV wxRichTextXMLHandler: public wxRichTextFileHandler +class WXDLLIMPEXP_RICHTEXT wxRichTextXMLHandler: public wxRichTextFileHandler { DECLARE_CLASS(wxRichTextXMLHandler) public: @@ -37,20 +36,19 @@ public: { } #if wxUSE_STREAMS - virtual bool LoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); - virtual bool SaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); - /// Recursively export an object bool ExportXML(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextObject& obj, int level); + bool ExportStyleDefinition(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextStyleDefinition* def, int level); /// Recursively import an object bool ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node); + bool ImportStyleDefinition(wxRichTextStyleSheet* sheet, wxXmlNode* node); /// Create style parameters - wxString CreateStyle(const wxTextAttrEx& attr, bool isPara = false); + wxString CreateStyle(const wxTextAttr& attr, bool isPara = false); /// Get style parameters - bool GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool isPara = false); + bool GetStyle(wxTextAttr& attr, wxXmlNode* node, bool isPara = false); #endif /// Can we save using this handler? @@ -68,47 +66,14 @@ public: wxString GetText(wxXmlNode *node, const wxString& param = wxEmptyString, bool translate = false); protected: - -}; - -/*! - * wxRichTextHTMLHandler - */ - -class WXDLLIMPEXP_ADV wxRichTextHTMLHandler: public wxRichTextFileHandler -{ - DECLARE_CLASS(wxRichTextHTMLHandler) -public: - wxRichTextHTMLHandler(const wxString& name = wxT("HTML"), const wxString& ext = wxT("html"), int type = wxRICHTEXT_TYPE_HTML) - : wxRichTextFileHandler(name, ext, type) - { } - #if wxUSE_STREAMS - virtual bool LoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); - virtual bool SaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); + virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); + virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); #endif - - /// Can we save using this handler? - virtual bool CanSave() const { return true; } - - /// Can we load using this handler? - virtual bool CanLoad() const { return false; } - - /// Can we handle this filename (if using files)? By default, checks the extension. - virtual bool CanHandle(const wxString& filename) const; - - /// Output character formatting - virtual void OutputCharacterFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, wxOutputStream& stream, bool start); - - /// Output paragraph formatting - virtual void OutputParagraphFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, wxOutputStream& stream, bool start); - -protected: - }; #endif - // wxUSE_RICHTEXT + // wxUSE_RICHTEXT && wxUSE_XML #endif // _WX_RICHTEXTXML_H_