/**
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
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);
*/
virtual void Clear();
- //@{
/**
Clears the list style from the given range, clearing list-related attributes
and applying any named paragraph style associated with each paragraph.
@see SetListStyle(), PromoteList(), NumberList()
*/
- bool ClearListStyle(const wxRichTextRange& range,
- int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
- bool ClearListStyle(const wxRichTextRange& range,
+ virtual bool ClearListStyle(const wxRichTextRange& range,
int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
- //@}
/**
Clears the style stack.
/**
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.
/**
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.
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.
(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.
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
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.
/**
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.
/**
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.
/**
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
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);
//@{
/**
/**
Returns the encoding associated with the handler (if any).
*/
- const wxString GetEncoding() const;
+ const wxString& GetEncoding() const;
/**
Returns the extension associated with the handler.