X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b71e9aa4e2187a7f6469f68812467f2ecb6a3836..05a98b6d5d201eb8edea04b1ab022e4a9a46e9f0:/include/wx/richtext/richtexthtml.h diff --git a/include/wx/richtext/richtexthtml.h b/include/wx/richtext/richtexthtml.h index 2bb4ca0a8e..23cbefced5 100644 --- a/include/wx/richtext/richtexthtml.h +++ b/include/wx/richtext/richtexthtml.h @@ -22,7 +22,7 @@ * wxRichTextHTMLHandler */ -class WXDLLIMPEXP_ADV wxRichTextHTMLHandler: public wxRichTextFileHandler +class WXDLLIMPEXP_RICHTEXT wxRichTextHTMLHandler: public wxRichTextFileHandler { DECLARE_CLASS(wxRichTextHTMLHandler) public: @@ -30,11 +30,6 @@ public: : wxRichTextFileHandler(name, ext, type) { } -#if wxUSE_STREAMS - 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; } @@ -44,13 +39,64 @@ public: /// Can we handle this filename (if using files)? By default, checks the extension. virtual bool CanHandle(const wxString& filename) const; +protected: + +#if wxUSE_STREAMS + virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); + virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); +#endif + /// Output character formatting - virtual void OutputCharacterFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, wxOutputStream& stream, bool start); + virtual void BeginCharacterFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, const wxTextAttrEx& paraStyle, wxOutputStream& stream ); + virtual void EndCharacterFormatting(const wxTextAttrEx& WXUNUSED(currentStyle), const wxTextAttrEx& thisStyle, const wxTextAttrEx& paraStyle, wxOutputStream& stream ); + + /// Output paragraph formatting + virtual void OutputParagraphFormatting(const wxTextAttrEx& WXUNUSED(currentStyle), const wxTextAttrEx& thisStyle, wxOutputStream& stream/*, bool start*/); + + /// Converts an image to its base64 equivalent + void Image_to_Base64(wxRichTextImage* image, wxOutputStream& stream); + + /// Builds required indentation + void Indent( const wxTextAttrEx& thisStyle, wxTextOutputStream& str ); + + /// Left indent + void LIndent( const wxTextAttrEx& thisStyle, wxTextOutputStream& str ); + + /// Converts from pt to size property compatible height + long Pt_To_Size(long size); + + /// Typical base64 encoder + wxChar* b64enc( unsigned char* input, size_t in_len ); + + /// Gets the mime type of the given wxBITMAP_TYPE + const wxChar* GetMimeType(int imageType); + + /// Gets the html equivalent of the specified value + wxString GetAlignment( const wxTextAttrEx& thisStyle ); - /// Output paragraph formatting - virtual void OutputParagraphFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, wxOutputStream& stream, bool start); + /// Generates   array for indentations + wxString SymbolicIndent(long indent); + + /// Finds the html equivalent of the specified bullet + void TypeOfList( const wxTextAttrEx& thisStyle, wxString& tag ); + + /// Closes existings or Opens new tables for navigation to an item's horizontal position. + void NavigateToListPosition( const wxTextAttrEx& thisStyle, wxTextOutputStream& str ); + + /// Indentation values of the table tags + wxArrayInt m_indents; + + /// Horizontal position of the current table + long m_indent; -protected: + /// Is there any opened font tag + bool m_font; + + /// Is there any opened ul/ol tag + bool m_list; + + /// type of list, ul or ol? + bool m_is_ul; };