X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/336d8ae9a3feae7b2c3ecd8f64fe0e16984edfe7..ad259ba5b263acd502b2bad4c73e58e00d353702:/include/wx/richtext/richtextbuffer.h diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index 0db98bc056..b8d2912ed9 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -91,19 +91,19 @@ extern WXDLLIMPEXP_RICHTEXT const wxChar wxRichTextLineBreakChar; * Forward declarations */ -class WXDLLIMPEXP_RICHTEXT wxRichTextCtrl; -class WXDLLIMPEXP_RICHTEXT wxRichTextObject; -class WXDLLIMPEXP_RICHTEXT wxRichTextCacheObject; -class WXDLLIMPEXP_RICHTEXT wxRichTextObjectList; -class WXDLLIMPEXP_RICHTEXT wxRichTextLine; -class WXDLLIMPEXP_RICHTEXT wxRichTextParagraph; -class WXDLLIMPEXP_RICHTEXT wxRichTextFileHandler; -class WXDLLIMPEXP_RICHTEXT wxRichTextStyleSheet; -class WXDLLIMPEXP_RICHTEXT wxTextAttrEx; -class WXDLLIMPEXP_RICHTEXT wxRichTextListStyleDefinition; -class WXDLLIMPEXP_RICHTEXT wxRichTextEvent; -class WXDLLIMPEXP_RICHTEXT wxRichTextRenderer; -class WXDLLIMPEXP_RICHTEXT wxRichTextBuffer; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCtrl; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextObject; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCacheObject; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextObjectList; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextLine; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextParagraph; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFileHandler; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextStyleSheet; +class WXDLLIMPEXP_FWD_RICHTEXT wxTextAttrEx; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextListStyleDefinition; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextEvent; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextRenderer; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer; /*! * Flags determining the available space, passed to Layout @@ -139,6 +139,8 @@ class WXDLLIMPEXP_RICHTEXT wxRichTextBuffer; #define wxRICHTEXT_HITTEST_AFTER 0x04 // The point was on the position returned from HitTest #define wxRICHTEXT_HITTEST_ON 0x08 +// The point was on space outside content +#define wxRICHTEXT_HITTEST_OUTSIDE 0x10 /*! * Flags for GetRangeSize @@ -181,6 +183,9 @@ class WXDLLIMPEXP_RICHTEXT wxRichTextBuffer; // Resets the existing style before applying the new style #define wxRICHTEXT_SETSTYLE_RESET 0x40 +// Removes the given style instead of applying it +#define wxRICHTEXT_SETSTYLE_REMOVE 0x80 + /*! * Flags for text insertion */ @@ -400,8 +405,8 @@ public: bool HasParagraphSpacingAfter() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_AFTER); } bool HasParagraphSpacingBefore() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_BEFORE); } bool HasLineSpacing() const { return HasFlag(wxTEXT_ATTR_LINE_SPACING); } - bool HasCharacterStyleName() const { return HasFlag(wxTEXT_ATTR_CHARACTER_STYLE_NAME) || !m_characterStyleName.IsEmpty(); } - bool HasParagraphStyleName() const { return HasFlag(wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) || !m_paragraphStyleName.IsEmpty(); } + bool HasCharacterStyleName() const { return HasFlag(wxTEXT_ATTR_CHARACTER_STYLE_NAME) && !m_characterStyleName.IsEmpty(); } + bool HasParagraphStyleName() const { return HasFlag(wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) && !m_paragraphStyleName.IsEmpty(); } bool HasListStyleName() const { return HasFlag(wxTEXT_ATTR_LIST_STYLE_NAME) || !m_listStyleName.IsEmpty(); } bool HasBulletStyle() const { return HasFlag(wxTEXT_ATTR_BULLET_STYLE); } bool HasBulletNumber() const { return HasFlag(wxTEXT_ATTR_BULLET_NUMBER); } @@ -576,8 +581,8 @@ public: bool HasParagraphSpacingAfter() const { return (m_flags & wxTEXT_ATTR_PARA_SPACING_AFTER) != 0; } bool HasParagraphSpacingBefore() const { return (m_flags & wxTEXT_ATTR_PARA_SPACING_BEFORE) != 0; } bool HasLineSpacing() const { return (m_flags & wxTEXT_ATTR_LINE_SPACING) != 0; } - bool HasCharacterStyleName() const { return (m_flags & wxTEXT_ATTR_CHARACTER_STYLE_NAME) != 0 || !m_characterStyleName.IsEmpty(); } - bool HasParagraphStyleName() const { return (m_flags & wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) != 0 || !m_paragraphStyleName.IsEmpty(); } + bool HasCharacterStyleName() const { return (m_flags & wxTEXT_ATTR_CHARACTER_STYLE_NAME) != 0 && !m_characterStyleName.IsEmpty(); } + bool HasParagraphStyleName() const { return (m_flags & wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) != 0 && !m_paragraphStyleName.IsEmpty(); } bool HasListStyleName() const { return HasFlag(wxTEXT_ATTR_LIST_STYLE_NAME) || !m_listStyleName.IsEmpty(); } bool HasBulletStyle() const { return (m_flags & wxTEXT_ATTR_BULLET_STYLE) != 0; } bool HasBulletNumber() const { return (m_flags & wxTEXT_ATTR_BULLET_NUMBER) != 0; } @@ -1455,8 +1460,8 @@ protected: * wxRichTextImageBlock stores information about an image, in binary in-memory form */ -class WXDLLIMPEXP_BASE wxDataInputStream; -class WXDLLIMPEXP_BASE wxDataOutputStream; +class WXDLLIMPEXP_FWD_BASE wxDataInputStream; +class WXDLLIMPEXP_FWD_BASE wxDataOutputStream; class WXDLLIMPEXP_RICHTEXT wxRichTextImageBlock: public wxObject { @@ -1603,8 +1608,8 @@ protected: * This is a kind of box, used to represent the whole buffer */ -class WXDLLIMPEXP_RICHTEXT wxRichTextCommand; -class WXDLLIMPEXP_RICHTEXT wxRichTextAction; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCommand; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextAction; class WXDLLIMPEXP_RICHTEXT wxRichTextBuffer: public wxRichTextParagraphLayoutBox { @@ -1869,7 +1874,7 @@ public: /// Get the style that is appropriate for a new paragraph at this position. /// If the previous paragraph has a paragraph style name, look up the next-paragraph /// style. - wxRichTextAttr GetStyleForNewParagraph(long pos, bool caretPosition = false) const; + wxRichTextAttr GetStyleForNewParagraph(long pos, bool caretPosition = false, bool lookUpNewParaStyle=false) const; /// Dumps contents of buffer for debugging purposes virtual void Dump(); @@ -1993,7 +1998,7 @@ enum wxRichTextCommandId * */ -class WXDLLIMPEXP_RICHTEXT wxRichTextAction; +class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextAction; class WXDLLIMPEXP_RICHTEXT wxRichTextCommand: public wxCommand { public: @@ -2126,8 +2131,10 @@ public: { return DoSaveFile(buffer, stream); } #endif +#if wxUSE_FFILE && wxUSE_STREAMS bool LoadFile(wxRichTextBuffer *buffer, const wxString& filename); bool SaveFile(wxRichTextBuffer *buffer, const wxString& filename); +#endif // wxUSE_STREAMS && wxUSE_STREAMS /// Can we handle this filename (if using files)? By default, checks the extension. virtual bool CanHandle(const wxString& filename) const; @@ -2317,6 +2324,9 @@ WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL); WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL); +// Remove attributes +WXDLLIMPEXP_RICHTEXT bool wxRichTextRemoveStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style); + /// Combine two bitlists WXDLLIMPEXP_RICHTEXT bool wxRichTextCombineBitlists(int& valueA, int valueB, int& flagsA, int flagsB);