X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5267aefd85739afd26bd19bfba998005119db446..d3fa4bc22e84e3ca4d88cc1772f2d414140a1017:/interface/wx/richtext/richtextstyles.h diff --git a/interface/wx/richtext/richtextstyles.h b/interface/wx/richtext/richtextstyles.h index 4f99f22c3b..6ac41a0b4d 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 ///////////////////////////////////////////////////////////////////////////// /** @@ -150,15 +150,15 @@ public: /** Returns the attributes associated with this style. */ - wxTextAttr GetStyle() const; - const wxTextAttr GetStyle() const; + wxRichTextAttr GetStyle() const; + const wxRichTextAttr GetStyle() const; //@} /** Returns the style attributes combined with the attributes of the specified base style, if any. This function works recursively. */ - virtual wxTextAttr GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const; + virtual wxRichTextAttr GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const; /** Sets the name of the style that this style is based on. @@ -178,7 +178,22 @@ public: /** Sets the attributes for this style. */ - void SetStyle(const wxTextAttr& style); + void SetStyle(const wxRichTextAttr& style); + + /** + Returns the definition's properties. + */ + wxRichTextProperties& GetProperties(); + + /** + Returns the definition's properties. + */ + const wxRichTextProperties& GetProperties() const; + + /** + Sets the definition's properties. + */ + void SetProperties(const wxRichTextProperties& props); }; @@ -234,6 +249,17 @@ public: class wxRichTextStyleListBox : public wxHtmlListBox { public: + + /// Which type of style definition is currently showing? + enum wxRichTextStyleType + { + wxRICHTEXT_STYLE_ALL, + wxRICHTEXT_STYLE_PARAGRAPH, + wxRICHTEXT_STYLE_CHARACTER, + wxRICHTEXT_STYLE_LIST, + wxRICHTEXT_STYLE_BOX + }; + /** Constructor. */ @@ -289,22 +315,12 @@ public: */ wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const; - /** - Returns the HTML for this item. - */ - virtual 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 +350,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; }; @@ -462,8 +485,8 @@ public: If @a styleSheet is specified, the base style for this definition will also be included in the result. */ - wxTextAttr CombineWithParagraphStyle(int indent, - const wxTextAttr& paraStyle, + wxRichTextAttr CombineWithParagraphStyle(int indent, + const wxRichTextAttr& paraStyle, wxRichTextStyleSheet* styleSheet = NULL); /** @@ -479,7 +502,7 @@ public: If @a styleSheet is specified, the base style for this definition will also be included in the result. */ - wxTextAttr GetCombinedStyle(int indent, + wxRichTextAttr GetCombinedStyle(int indent, wxRichTextStyleSheet* styleSheet = NULL); /** @@ -489,13 +512,14 @@ public: If @a styleSheet is specified, the base style for this definition will also be included in the result. */ - wxTextAttr GetCombinedStyleLevel(int level, - wxRichTextStyleSheet* styleSheet = NULL) const; + + wxRichTextAttr GetCombinedStyleForLevel(int level, + wxRichTextStyleSheet* styleSheet = NULL); /** Returns the style for the given level. @a level is a number between 0 and 9. */ - const wxTextAttr* GetLevelAttributes(int level) const; + const wxRichTextAttr* GetLevelAttributes(int level) const; /** Returns the number of levels. This is hard-wired to 10. @@ -508,18 +532,12 @@ public: */ 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); - //@} + void SetLevelAttributes(int level, const wxRichTextAttr& attr); }; @@ -670,5 +688,20 @@ public: Sets the style sheet's name. */ void SetName(const wxString& name); + + /** + Returns the sheet's properties. + */ + wxRichTextProperties& GetProperties(); + + /** + Returns the sheet's properties. + */ + const wxRichTextProperties& GetProperties() const; + + /** + Sets the sheet's properties. + */ + void SetProperties(const wxRichTextProperties& props); };