X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9e7ad1cab887c2f1cd1a624ec0aec60d20b4d6e2..54c45be005b3ffc43c63cfb9da63852c905cf3a9:/interface/wx/richtext/richtextstyles.h diff --git a/interface/wx/richtext/richtextstyles.h b/interface/wx/richtext/richtextstyles.h index 3cc9fc99d6..c1c636fef8 100644 --- a/interface/wx/richtext/richtextstyles.h +++ b/interface/wx/richtext/richtextstyles.h @@ -3,7 +3,7 @@ // Purpose: interface of wxRichTextStyleListCtrl // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -134,17 +134,17 @@ public: /** Returns the style on which this style is based. */ - const wxString GetBaseStyle() const; + const wxString& GetBaseStyle() const; /** Returns the style's description. */ - const wxString GetDescription() const; + const wxString& GetDescription() const; /** Returns the style name. */ - const wxString GetName() const; + const wxString& GetName() const; //@{ /** @@ -158,7 +158,7 @@ public: Returns the style attributes combined with the attributes of the specified base style, if any. This function works recursively. */ - wxTextAttr GetStyleMergedWithBase(wxRichTextStyleSheet* sheet) const; + virtual wxTextAttr GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const; /** Sets the name of the style that this style is based on. @@ -208,7 +208,7 @@ public: /** Returns the style that should normally follow this style. */ - const wxString GetNextStyle() const; + const wxString& GetNextStyle() const; /** Sets the style that should normally follow this style. @@ -289,22 +289,12 @@ public: */ wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const; - /** - Returns the HTML for this item. - */ - wxString OnGetItem(size_t n) const; - /** Implements left click behaviour, applying the clicked style to the wxRichTextCtrl. */ void OnLeftDown(wxMouseEvent& event); - /** - Reacts to selection. - */ - void OnSelect(wxCommandEvent& event); - /** If @a applyOnSelection is @true, clicking on a style name in the list will immediately apply the style to the associated rich text control. @@ -334,6 +324,13 @@ public: Updates the list from the associated style sheet. */ void UpdateStyles(); + +protected: + + /** + Returns the HTML for this item. + */ + virtual wxString OnGetItem(size_t n) const; }; @@ -480,7 +477,7 @@ public: included in the result. */ wxTextAttr GetCombinedStyle(int indent, - wxRichTextStyleSheet* styleSheet = NULL) const; + wxRichTextStyleSheet* styleSheet = NULL); /** This function combines the list style's base attributes and the style for the @@ -489,7 +486,8 @@ public: If @a styleSheet is specified, the base style for this definition will also be included in the result. */ - wxTextAttr GetCombinedStyleLevel(int level, + + wxTextAttr GetCombinedStyleForLevel(int level, wxRichTextStyleSheet* styleSheet = NULL) const; /** @@ -506,20 +504,14 @@ public: /** Returns @true if the given level has numbered list attributes. */ - int IsNumbered(int level) const; + bool IsNumbered(int level) const; - //@{ /** Sets the style for the given level. @a level is a number between 0 and 9. The first and most flexible form uses a wxTextAttr object, while the second form is for convenient setting of the most commonly-used attributes. */ void SetLevelAttributes(int level, const wxTextAttr& attr); - void SetLevelAttributes(int level, int leftIndent, - int leftSubIndent, - int bulletStyle, - const wxString& bulletSymbol = wxEmptyString); - //@} }; @@ -577,17 +569,20 @@ public: /** Finds a character definition by name. */ - wxRichTextCharacterStyleDefinition* FindCharacterStyle(const wxString& name) const; + wxRichTextCharacterStyleDefinition* FindCharacterStyle(const wxString& name, + bool recurse = true) const; /** Finds a list definition by name. */ - wxRichTextListStyleDefinition* FindListStyle(const wxString& name) const; + wxRichTextListStyleDefinition* FindListStyle(const wxString& name, + bool recurse = true) const; /** Finds a paragraph definition by name. */ - wxRichTextParagraphStyleDefinition* FindParagraphStyle(const wxString& name) const; + wxRichTextParagraphStyleDefinition* FindParagraphStyle(const wxString& name, + bool recurse = true) const; /** Finds a style definition by name. @@ -607,7 +602,7 @@ public: /** Returns the style sheet's description. */ - const wxString GetDescription() const; + const wxString& GetDescription() const; /** Returns the @e nth list style. @@ -622,7 +617,7 @@ public: /** Returns the style sheet's name. */ - const wxString GetName() const; + const wxString& GetName() const; /** Returns the @e nth paragraph style.