X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da1ed74c85f53a75a193c7dcbd2013aa266a222c..4ce846b17c9a1ad71c749253cc8b73d492ed9634:/interface/wx/richtext/richtextbuffer.h diff --git a/interface/wx/richtext/richtextbuffer.h b/interface/wx/richtext/richtextbuffer.h index f86e30529a..5731c8c28b 100644 --- a/interface/wx/richtext/richtextbuffer.h +++ b/interface/wx/richtext/richtextbuffer.h @@ -179,7 +179,8 @@ public: /** Adds a paragraph of text. */ - wxRichTextRange AddParagraph(const wxString& text); + virtual wxRichTextRange AddParagraph(const wxString& text, + wxTextAttr* paraStyle = 0); /** Returns @true if the buffer is currently collapsing commands into a single @@ -322,7 +323,7 @@ public: See BeginNumberedBullet() for an explanation of how indentation is used to render the bulleted paragraph. */ - bool BeginSymbolBullet(wxChar symbol, int leftIndent, + bool BeginSymbolBullet(const wxString& symbol, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL); @@ -523,13 +524,12 @@ public: /** Finds a handler by type. */ - wxRichTextFileHandler* FindHandler(int imageType); + static wxRichTextFileHandler* FindHandler(wxRichTextFileType imageType); /** Finds a handler by extension and type. */ - wxRichTextFileHandler* FindHandler(const wxString& extension, - int imageType); + static wxRichTextFileHandler* FindHandler(const wxString& extension, wxRichTextFileType imageType); /** Finds a handler by name. @@ -539,8 +539,7 @@ public: /** Finds a handler by filename or, if supplied, type. */ - wxRichTextFileHandler* FindHandlerFilenameOrType(const wxString& filename, - int imageType); + static wxRichTextFileHandler* FindHandlerFilenameOrType(const wxString& filename, wxRichTextFileType imageType); /** Gets the basic (overall) style. @@ -550,7 +549,7 @@ public: applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). */ - const wxTextAttr GetBasicStyle() const; + virtual const wxTextAttr& GetBasicStyle() const; /** Gets the collapsed command. @@ -568,7 +567,7 @@ public: (for example, setting the default style to bold will cause subsequently inserted text to be bold). */ - const wxTextAttr GetDefaultStyle() const; + virtual const wxTextAttr& GetDefaultStyle() const; /** Gets a wildcard incorporating all visible handlers. @@ -576,13 +575,13 @@ public: to each filter. This can be used to determine the type to pass to LoadFile() given a selected filter. */ - wxString GetExtWildcard(bool combine = false, bool save = false, - wxArrayInt* types = NULL); + static wxString GetExtWildcard(bool combine = false, bool save = false, + wxArrayInt* types = NULL); /** Returns the list of file handlers. */ - wxList GetHandlers(); + static wxList& GetHandlers(); /** Returns the object to be used to render certain aspects of the content, such as @@ -623,8 +622,8 @@ public: changed to bold because this is already specified by the paragraph. However the text colour attributes @e will be changed to show red. */ - bool GetStyleForRange(const wxRichTextRange& range, - wxTextAttr& style); + virtual bool GetStyleForRange(const wxRichTextRange& range, + wxTextAttr& style); /** Returns the current style sheet associated with the buffer, if any. @@ -676,20 +675,19 @@ public: /** Submits a command to insert the given image. */ - bool InsertImageWithUndo(long pos, - const wxRichTextImageBlock& imageBlock, - wxRichTextCtrl* ctrl); + bool InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, + wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to insert a newline. */ - bool InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl); + bool InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to insert the given text. */ bool InsertTextWithUndo(long pos, const wxString& text, - wxRichTextCtrl* ctrl); + wxRichTextCtrl* ctrl, int flags = 0); /** Returns @true if the buffer has been modified. @@ -699,14 +697,14 @@ public: /** Loads content from a stream. */ - bool LoadFile(wxInputStream& stream, - int type = wxRICHTEXT_TYPE_ANY); + virtual bool LoadFile(wxInputStream& stream, + wxRichTextFileType type = wxRICHTEXT_TYPE_ANY); /** Loads content from a file. */ - bool LoadFile(const wxString& filename, - int type = wxRICHTEXT_TYPE_ANY); + virtual bool LoadFile(const wxString& filename, + wxRichTextFileType type = wxRICHTEXT_TYPE_ANY); /** Marks the buffer as modified or unmodified. @@ -795,14 +793,14 @@ public: /** Saves content to a stream. */ - bool SaveFile(wxOutputStream& stream, - int type = wxRICHTEXT_TYPE_ANY); + virtual bool SaveFile(wxOutputStream& stream, + wxRichTextFileType type = wxRICHTEXT_TYPE_ANY); /** Saves content to a file. */ - bool SaveFile(const wxString& filename, - int type = wxRICHTEXT_TYPE_ANY); + virtual bool SaveFile(const wxString& filename, + wxRichTextFileType type = wxRICHTEXT_TYPE_ANY); /** Sets the basic (overall) style. This is the style of the whole @@ -820,7 +818,7 @@ public: This is not cumulative - setting the default style will replace the previous default style. */ - void SetDefaultStyle(const wxTextAttr& style); + virtual bool SetDefaultStyle(const wxTextAttr& style); //@{ /** @@ -952,7 +950,7 @@ public: /** Returns the encoding associated with the handler (if any). */ - const wxString GetEncoding() const; + const wxString& GetEncoding() const; /** Returns the extension associated with the handler.