+ void SetSelectionAnchorObject(wxRichTextObject* anchor);
+
+ //@{
+ /**
+ Returns an object that stores information about context menu property item(s),
+ in order to communicate between the context menu event handler and the code
+ that responds to it. The wxRichTextContextMenuPropertiesInfo stores one
+ item for each object that could respond to a property-editing event. If
+ objects are nested, several might be editable.
+ */
+ wxRichTextContextMenuPropertiesInfo& GetContextMenuPropertiesInfo();
+ const wxRichTextContextMenuPropertiesInfo& GetContextMenuPropertiesInfo() const;
+ //@}
+
+ /**
+ Returns the wxRichTextObject object that currently has the editing focus.
+ If there are no composite objects, this will be the top-level buffer.
+ */
+ wxRichTextParagraphLayoutBox* GetFocusObject() const;
+
+ /**
+ Setter for m_focusObject.
+ */
+ void StoreFocusObject(wxRichTextParagraphLayoutBox* obj);
+
+ /**
+ Sets the wxRichTextObject object that currently has the editing focus.
+ @param setCaretPosition
+ Optionally set the caret position.
+ */
+ bool SetFocusObject(wxRichTextParagraphLayoutBox* obj, bool setCaretPosition = true);
+
+// Operations
+
+ /**
+ Invalidates the whole buffer to trigger painting later.
+ */
+ void Invalidate();
+
+ /**
+ Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
+ */
+ virtual void Clear();
+
+ /**
+ Replaces the content in the specified range with the string specified by
+ @a value.
+ */
+ virtual void Replace(long from, long to, const wxString& value);
+
+ /**
+ Removes the content in the specified range.
+ */
+ virtual void Remove(long from, long to);
+
+ /**
+ Loads content into the control's buffer using the given type.
+
+ If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from
+ the filename extension.
+
+ This function looks for a suitable wxRichTextFileHandler object.
+ */
+ bool LoadFile(const wxString& file,
+ int type = wxRICHTEXT_TYPE_ANY);
+
+ /**
+ Helper function for LoadFile(). Loads content into the control's buffer using the given type.
+
+ If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from
+ the filename extension.
+
+ This function looks for a suitable wxRichTextFileHandler object.
+ */
+ virtual bool DoLoadFile(const wxString& file, int fileType);
+
+ /**
+ Saves the buffer content using the given type.
+
+ If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from
+ the filename extension.
+
+ This function looks for a suitable wxRichTextFileHandler object.
+ */
+ bool SaveFile(const wxString& file = wxEmptyString,
+ int type = wxRICHTEXT_TYPE_ANY);
+
+ /**
+ Helper function for SaveFile(). Saves the buffer content using the given type.
+
+ If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from
+ the filename extension.
+
+ This function looks for a suitable wxRichTextFileHandler object.
+ */
+ virtual bool DoSaveFile(const wxString& file = wxEmptyString,
+ int fileType = wxRICHTEXT_TYPE_ANY);
+
+ /**
+ Sets flags that change the behaviour of loading or saving.
+
+ See the documentation for each handler class to see what flags are
+ relevant for each handler.
+ */
+ void SetHandlerFlags(int flags);
+
+ /**
+ Returns flags that change the behaviour of loading or saving.
+ See the documentation for each handler class to see what flags are
+ relevant for each handler.
+ */
+ int GetHandlerFlags() const;
+
+ /**
+ Marks the buffer as modified.
+ */
+ virtual void MarkDirty();
+
+ /**
+ Sets the buffer's modified status to @false, and clears the buffer's command
+ history.
+ */
+ virtual void DiscardEdits();
+
+
+ void SetModified(bool modified);
+
+ /**
+ Sets the maximum number of characters that may be entered in a single line
+ text control. For compatibility only; currently does nothing.
+ */
+ virtual void SetMaxLength(unsigned long len);
+
+ /**
+ Writes text at the current position.
+ */
+ virtual void WriteText(const wxString& text);
+
+ /**
+ Sets the insertion point to the end of the buffer and writes the text.
+ */
+ virtual void AppendText(const wxString& text);
+
+ //@{
+ /**
+ Gets the attributes at the given position.
+ This function gets the combined style - that is, the style you see on the
+ screen as a result of combining base style, paragraph style and character
+ style attributes.
+
+ To get the character or paragraph style alone, use GetUncombinedStyle().
+
+ @beginWxPerlOnly
+ In wxPerl this method is implemented as GetStyle(@a position)
+ returning a 2-element list (ok, attr).
+ @endWxPerlOnly
+ */
+ virtual bool GetStyle(long position, wxTextAttr& style);
+ virtual bool GetStyle(long position, wxRichTextAttr& style);
+ virtual bool GetStyle(long position, wxRichTextAttr& style, wxRichTextParagraphLayoutBox* container);
+ //@}
+
+ //@{
+ /**
+ Sets the attributes for the given range.
+ The end point of range is specified as the last character position of the span
+ of text, plus one.
+
+ So, for example, to set the style for a character at position 5, use the range
+ (5,6).
+ */
+ virtual bool SetStyle(long start, long end, const wxTextAttr& style);
+ virtual bool SetStyle(long start, long end, const wxRichTextAttr& style);
+ virtual bool SetStyle(const wxRichTextRange& range, const wxTextAttr& style);
+ virtual bool SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style);
+ //@}
+
+ /**
+ Sets the attributes for a single object
+ */
+ virtual void SetStyle(wxRichTextObject *obj, const wxRichTextAttr& textAttr, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
+
+ //@{
+ /**
+ Gets the attributes common to the specified range.
+ Attributes that differ in value within the range will not be included
+ in @a style flags.
+
+ @beginWxPerlOnly
+ In wxPerl this method is implemented as GetStyleForRange(@a position)
+ returning a 2-element list (ok, attr).
+ @endWxPerlOnly
+ */
+ virtual bool GetStyleForRange(const wxRichTextRange& range, wxTextAttr& style);
+ virtual bool GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style);
+ virtual bool GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style, wxRichTextParagraphLayoutBox* container);
+ //@}
+
+ /**
+ Sets the attributes for the given range, passing flags to determine how the
+ attributes are set.
+
+ The end point of range is specified as the last character position of the span
+ of text, plus one. So, for example, to set the style for a character at
+ position 5, use the range (5,6).
+
+ @a flags may contain a bit list of the following values:
+ - wxRICHTEXT_SETSTYLE_NONE: no style flag.
+ - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this operation should be
+ undoable.
+ - wxRICHTEXT_SETSTYLE_OPTIMIZE: specifies that the style should not be applied
+ if the combined style at this point is already the style in question.
+ - wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY: specifies that the style should only be
+ applied to paragraphs, and not the content.
+ This allows content styling to be preserved independently from that
+ of e.g. a named paragraph style.
+ - wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY: specifies that the style should only be
+ applied to characters, and not the paragraph.
+ This allows content styling to be preserved independently from that
+ of e.g. a named paragraph style.
+ - wxRICHTEXT_SETSTYLE_RESET: resets (clears) the existing style before applying
+ the new style.
+ - wxRICHTEXT_SETSTYLE_REMOVE: removes the specified style. Only the style flags
+ are used in this operation.
+ */
+ virtual bool SetStyleEx(const wxRichTextRange& range, const wxRichTextAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
+
+ //@{
+ /**
+ Gets the attributes at the given position.
+ This function gets the @e uncombined style - that is, the attributes associated
+ with the paragraph or character content, and not necessarily the combined
+ attributes you see on the screen.
+ To get the combined attributes, use GetStyle().
+
+ If you specify (any) paragraph attribute in @e style's flags, this function
+ will fetch the paragraph attributes.
+ Otherwise, it will return the character attributes.
+
+ @beginWxPerlOnly
+ In wxPerl this method is implemented as GetUncombinedStyle(@a position)
+ returning a 2-element list (ok, attr).
+ @endWxPerlOnly
+ */
+ virtual bool GetUncombinedStyle(long position, wxRichTextAttr& style);
+ virtual bool GetUncombinedStyle(long position, wxRichTextAttr& style, wxRichTextParagraphLayoutBox* container);
+ //@}
+
+ //@{
+ /**
+ Sets the current default style, which can be used to change how subsequently
+ inserted text is displayed.
+ */
+ virtual bool SetDefaultStyle(const wxTextAttr& style);
+ virtual bool SetDefaultStyle(const wxRichTextAttr& style);
+ //@}
+
+ /**
+ Returns the current default style, which can be used to change how subsequently
+ inserted text is displayed.
+ */
+ virtual const wxRichTextAttr& GetDefaultStyleEx() const;
+
+ //virtual const wxTextAttr& GetDefaultStyle() const;
+
+ //@{
+ /**
+ Sets the list attributes for the given range, passing flags to determine how
+ the attributes are set.
+
+ Either the style definition or the name of the style definition (in the current
+ sheet) can be passed.
+ @a flags is a bit list of the following:
+ - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
+ - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from
+ @a startFrom, otherwise existing attributes are used.
+ - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used
+ as the level for all paragraphs, otherwise the current indentation will be used.
+
+ @see NumberList(), PromoteList(), ClearListStyle().
+ */
+ virtual bool SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1);
+ virtual bool SetListStyle(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1);
+ //@}