1 #############################################################################
2 ## Name: ext/richtext/XS/RichTextStyle.xsp
3 ## Purpose: XS++ for Wx::RichText*Style*
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: RichTextStyle.xsp 2568 2009-05-17 15:52:56Z mbarbon $
8 ## Copyright: (c) 2006, 2008-2009 Mattia Barbon
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
13 #include <wx/richtext/richtextstyles.h>
17 %name{Wx::RichTextStyleDefinition} class wxRichTextStyleDefinition
21 wxRichTextStyleDefinition::CLONE()
23 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
26 ~wxRichTextStyleDefinition()
27 %code%{ wxPli_thread_sv_unregister( aTHX_ wxPli_get_class( aTHX_ ST(0) ), THIS, ST(0) );
28 if( wxPli_object_is_deleteable( aTHX_ ST(0) ) )
32 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
33 void Copy( const wxRichTextStyleDefinition& def );
34 bool Eq( const wxRichTextStyleDefinition& def ) const;
36 void SetName( const wxString& name );
37 const wxString& GetName() const;
38 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
39 void SetDescription( const wxString& descr );
40 const wxString& GetDescription() const;
42 void SetBaseStyle( const wxString& name );
43 const wxString& GetBaseStyle() const;
44 void SetStyle( const wxRichTextAttr& style );
45 const wxRichTextAttr& GetStyle() const;
46 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
47 const wxTextAttr& GetStyleMergedWithBase( wxRichTextStyleSheet* sheet ) const;
51 %name{Wx::RichTextCharacterStyleDefinition} class wxRichTextCharacterStyleDefinition
53 wxRichTextCharacterStyleDefinition( const wxString& name = wxEmptyString );
56 %name{Wx::RichTextParagraphStyleDefinition} class wxRichTextParagraphStyleDefinition
58 wxRichTextParagraphStyleDefinition( const wxString& name = wxEmptyString );
60 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
61 void Copy( const wxRichTextParagraphStyleDefinition& def );
64 void SetNextStyle( const wxString& name );
65 const wxString& GetNextStyle() const;
68 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
70 %name{Wx::RichTextListStyleDefinition} class wxRichTextListStyleDefinition
72 wxRichTextListStyleDefinition( const wxString& name = wxEmptyString );
74 void Copy( const wxRichTextListStyleDefinition& def );
76 void SetLevelAttributes( int i, const wxRichTextAttr& attr );
77 wxRichTextAttrDisown* GetLevelAttributes( int i ) const;
79 void SetAttributes( int i, int leftIndent, int leftSubIndent,
81 const wxString& bulletSymbol = wxEmptyString );
82 int FindLevelForIndent( int indent ) const;
83 wxRichTextAttr& CombineWithParagraphStyle
84 ( int indent, const wxRichTextAttr& paraStyle );
85 wxRichTextAttr& GetCombinedStyle( int indent );
86 wxRichTextAttr& GetCombinedStyleForLevel( int level );
87 int GetLevelCount() const;
88 bool IsNumbered( int i ) const;
93 %name{Wx::RichTextStyleSheet} class wxRichTextStyleSheet
95 wxRichTextStyleSheet();
99 wxRichTextStyleSheet::CLONE()
101 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
104 ~wxRichTextStyleSheet()
105 %code%{ wxPli_thread_sv_unregister( aTHX_ "Wx::RichTextStyleSheet", THIS, ST(0) );
106 if( wxPli_object_is_deleteable( aTHX_ ST(0) ) )
110 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
111 bool AddStyle( wxRichTextStyleDefinitionDisown* def );
112 wxRichTextStyleDefinitionDisown* FindStyle( const wxString& name ) const;
113 bool RemoveStyle( wxRichTextStyleDefinition* def,
114 bool deleteStyle = false );
117 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
118 void Copy( const wxRichTextStyleSheet& sheet );
121 bool AddCharacterStyle( wxRichTextCharacterStyleDefinitionDisown* def );
122 bool AddParagraphStyle( wxRichTextParagraphStyleDefinitionDisown* def );
123 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
124 bool AddListStyle( wxRichTextListStyleDefinitionDisown* def );
127 bool RemoveCharacterStyle( wxRichTextStyleDefinition* def,
128 bool deleteStyle = false );
129 bool RemoveParagraphStyle( wxRichTextStyleDefinition* def,
130 bool deleteStyle = false );
131 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
132 bool RemoveListStyle( wxRichTextStyleDefinition* def,
133 bool deleteStyle = false );
136 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
137 wxRichTextCharacterStyleDefinitionDisown* FindCharacterStyle
138 ( const wxString& name, bool recurse = true ) const;
139 wxRichTextParagraphStyleDefinitionDisown* FindParagraphStyle
140 ( const wxString& name, bool recurse = true ) const;
141 wxRichTextListStyleDefinitionDisown* FindListStyle( const wxString& name,
142 bool recurse = true) const;
145 size_t GetCharacterStyleCount() const;
146 size_t GetParagraphStyleCount() const;
147 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
148 size_t GetListStyleCount() const;
151 wxRichTextCharacterStyleDefinitionDisown* GetCharacterStyle( size_t n ) const;
152 wxRichTextParagraphStyleDefinitionDisown* GetParagraphStyle( size_t n ) const;
153 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
154 wxRichTextListStyleDefinitionDisown* GetListStyle( size_t n ) const;
158 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
159 bool InsertSheet( wxRichTextStyleSheet* before );
160 bool AppendSheet( wxRichTextStyleSheet* after );
163 wxRichTextStyleSheetDisown* GetNextSheet() const;
164 void SetNextSheet( wxRichTextStyleSheet* sheet );
166 wxRichTextStyleSheetDisown* GetPreviousSheet() const;
167 void SetPreviousSheet( wxRichTextStyleSheet* sheet );
169 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
170 void SetName( const wxString& name );
171 const wxString& GetName() const;
172 void SetDescription( const wxString& descr );
173 const wxString& GetDescription() const;