1 #############################################################################
2 ## Name: ext/richtext/XS/RichTextAttr.xsp
3 ## Purpose: XS++ for Wx::RichTextAttr and Wx::TextAttrEx
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: RichTextAttr.xsp 2568 2009-05-17 15:52:56Z mbarbon $
8 ## Copyright: (c) 2006-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 #############################################################################
14 #include <wx/richtext/richtextbuffer.h>
18 %name{Wx::RichTextRange} class wxRichTextRange
20 %name{newDefault} wxRichTextRange();
21 %name{newFromTo} wxRichTextRange( long start, long end );
22 %name{newCopy} wxRichTextRange( const wxRichTextRange& range );
26 wxRichTextRange::CLONE()
28 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
32 %code{% wxPli_thread_sv_unregister( aTHX_ "Wx::RichTextRange", THIS, ST(0) );
36 void SetRange( long start, long end );
37 void SetStart( long start );
38 long GetStart() const;
40 void SetEnd( long end );
43 bool IsOutside( const wxRichTextRange& range ) const;
44 bool IsWithin( const wxRichTextRange& range ) const;
46 bool Contains( long pos ) const;
47 bool LimitTo( const wxRichTextRange& range );
48 long GetLength() const;
51 ## DECLARE_OVERLOAD( wrtr, Wx::RichTextRange )
56 wxRichTextRange::new( ... )
59 MATCH_VOIDM_REDISP( newDefault )
60 MATCH_REDISP( wxPliOvl_n_n, newFromTo )
61 MATCH_REDISP( wxPliOvl_wrtr, newCopy )
62 END_OVERLOAD( Wx::RichTextRange::new )
66 %name{Wx::TextAttrEx} class wxTextAttrEx
68 %name{newDefault} wxTextAttrEx();
69 %name{newCopy} wxTextAttrEx( const wxTextAttrEx& attr );
70 %name{newAttr} wxTextAttrEx( const wxTextAttr& attr );
76 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
80 %code{% wxPli_thread_sv_unregister( aTHX_ "Wx::TextAttrEx", THIS, ST(0) );
84 void SetCharacterStyleName( const wxString& name );
85 void SetParagraphStyleName( const wxString& name );
86 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
87 void SetListStyleName( const wxString& name );
89 void SetParagraphSpacingAfter( int spacing );
90 void SetParagraphSpacingBefore( int spacing );
91 void SetLineSpacing( int spacing );
92 void SetBulletStyle( int style );
93 void SetBulletNumber( int n );
94 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
95 void SetBulletText( const wxString& text );
96 void SetBulletName( const wxString& name );
97 void SetBulletFont( const wxString& bulletFont );
98 void SetURL( const wxString& url );
99 void SetPageBreak( bool pageBreak = true );
102 const wxString& GetCharacterStyleName() const;
103 const wxString& GetParagraphStyleName() const;
104 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
105 const wxString& GetListStyleName() const;
107 int GetParagraphSpacingAfter() const;
108 int GetParagraphSpacingBefore() const;
109 int GetLineSpacing() const;
110 int GetBulletStyle() const;
111 int GetBulletNumber() const;
112 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
113 const wxString& GetBulletText() const;
114 const wxString& GetBulletName() const;
115 const wxString& GetBulletFont() const;
116 const wxString& GetURL() const;
119 #if WXPERL_W_VERSION_LT( 2, 8, 0 )
120 bool HasWeight() const;
121 bool HasSize() const;
122 bool HasItalic() const;
123 bool HasUnderlined() const;
124 bool HasFaceName() const;
127 bool HasParagraphSpacingAfter() const;
128 bool HasParagraphSpacingBefore() const;
129 bool HasLineSpacing() const;
130 bool HasCharacterStyleName() const;
131 bool HasParagraphStyleName() const;
132 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
133 bool HasListStyleName() const;
135 bool HasBulletStyle() const;
136 bool HasBulletNumber() const;
137 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
138 bool HasBulletText() const;
139 bool HasBulletName() const;
141 bool HasPageBreak() const;
144 bool IsCharacterStyle() const;
145 bool IsParagraphStyle() const;
147 bool IsDefault() const;
149 #if WXPERL_W_VERSION_LT( 2, 9, 0 ) && WXPERL_W_VERSION_GE( 2, 8, 0 )
150 int GetOutlineLevel() const;
151 bool HasOutlineLevel() const;
152 void SetOutlineLevel( int level );
154 int GetTextEffects() const;
155 bool HasTextEffects() const;
156 void SetTextEffects( int effects );
158 int GetTextEffectFlags() const;
159 bool HasTextEffect( int effect ) const;
160 void SetTextEffectFlags( int effects );
164 ## DECLARE_OVERLOAD( wtae, Wx::TextAttrEx )
165 ## DECLARE_OVERLOAD( wtat, Wx::TextAttr )
170 wxTextAttrEx::new( ... )
173 MATCH_VOIDM_REDISP( newDefault )
174 MATCH_REDISP( wxPliOvl_wtae, newCopy )
175 MATCH_REDISP( wxPliOvl_wtat, newAttr )
176 END_OVERLOAD( Wx::TextAttrEx::new )
180 %name{Wx::RichTextAttr} class wxRichTextAttr
182 %name{newDefault} wxRichTextAttr();
183 %name{newCopy} wxRichTextAttr( const wxRichTextAttr& attr );
184 %name{newAttrEx} wxRichTextAttr( const wxTextAttrEx& attr );
185 %name{newAttr} wxRichTextAttr( const wxTextAttr& attr );
186 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
187 %name{newFull} wxRichTextAttr
188 ( const wxColour& colText, const wxColour& colBack = wxNullColourPtr,
189 const wxFont& font = wxNullFontPtr,
190 wxTextAttrAlignment alignment = wxTEXT_ALIGNMENT_DEFAULT );
192 %name{newFull} wxRichTextAttr
193 ( const wxColour& colText, const wxColour& colBack = wxNullColourPtr,
194 wxTextAttrAlignment alignment = wxTEXT_ALIGNMENT_DEFAULT );
198 wxRichTextAttr::CLONE()
200 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
204 %code{% wxPli_thread_sv_unregister( aTHX_ "Wx::RichTextAttr", THIS, ST(0) );
208 #if WXPERL_W_VERSION_LT( 2, 9, 0 )
209 wxFont CreateFont() const;
211 bool GetFontAttributes( const wxFont& font );
213 void SetTextColour( const wxColour& colText );
214 void SetBackgroundColour( const wxColour& colBack );
215 void SetAlignment( wxTextAttrAlignment alignment );
216 void SetTabs( const wxArrayInt& tabs );
217 void SetLeftIndent( int indent, int subIndent = 0 );
218 void SetRightIndent( int indent );
220 void SetFontSize( int pointSize );
221 void SetFontStyle( wxFontStyle fontStyle );
222 void SetFontWeight( wxFontWeight fontWeight );
223 void SetFontFaceName( const wxString& faceName );
224 void SetFontUnderlined( bool underlined );
226 void SetFlags( long flags );
228 void SetCharacterStyleName( const wxString& name );
229 void SetParagraphStyleName( const wxString& name );
230 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
231 void SetListStyleName( const wxString& name );
233 void SetParagraphSpacingAfter( int spacing );
234 void SetParagraphSpacingBefore( int spacing );
235 void SetLineSpacing( int spacing );
236 void SetBulletStyle( int style );
237 void SetBulletNumber( int n );
238 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
239 void SetBulletText( const wxString& text );
240 void SetBulletFont( const wxString& bulletFont );
241 void SetBulletName( const wxString& name );
242 void SetURL( const wxString& url );
243 void SetPageBreak( bool pageBreak = true );
246 const wxColour& GetTextColour() const;
247 const wxColour& GetBackgroundColour() const;
248 wxTextAttrAlignment GetAlignment() const;
249 long GetLeftIndent() const;
250 long GetLeftSubIndent() const;
251 long GetRightIndent() const;
252 long GetFlags() const;
254 int GetFontSize() const;
255 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
256 wxFontStyle GetFontStyle() const;
257 wxFontWeight GetFontWeight() const;
259 int GetFontStyle() const;
260 int GetFontWeight() const;
262 bool GetFontUnderlined() const;
263 const wxString& GetFontFaceName() const;
265 const wxString& GetCharacterStyleName() const;
266 const wxString& GetParagraphStyleName() const;
267 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
268 const wxString& GetListStyleName() const;
270 int GetParagraphSpacingAfter() const;
271 int GetParagraphSpacingBefore() const;
272 int GetLineSpacing() const;
273 int GetBulletStyle() const;
274 int GetBulletNumber() const;
275 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
276 const wxString& GetBulletText() const;
277 const wxString& GetBulletFont() const;
278 const wxString& GetBulletName() const;
279 const wxString& GetURL() const;
282 bool HasTextColour() const;
283 bool HasBackgroundColour() const;
284 bool HasAlignment() const;
285 bool HasTabs() const;
286 bool HasLeftIndent() const;
287 bool HasRightIndent() const;
288 #if WXPERL_W_VERSION_LT( 2, 8, 0 )
289 bool HasWeight() const;
290 bool HasSize() const;
291 bool HasItalic() const;
292 bool HasUnderlined() const;
293 bool HasFaceName() const;
295 bool HasFont() const;
297 bool HasParagraphSpacingAfter() const;
298 bool HasParagraphSpacingBefore() const;
299 bool HasLineSpacing() const;
300 bool HasCharacterStyleName() const;
301 bool HasParagraphStyleName() const;
302 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
303 bool HasListStyleName() const;
305 bool HasBulletStyle() const;
306 bool HasBulletNumber() const;
307 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
308 bool HasBulletText() const;
309 bool HasBulletName() const;
311 bool HasPageBreak() const;
314 bool IsCharacterStyle() const;
315 bool IsParagraphStyle() const;
317 bool IsDefault() const;
320 ## DECLARE_OVERLOAD( wrta, Wx::RichTextAttr )
325 wxRichTextAttr::new( ... )
328 MATCH_VOIDM_REDISP( newDefault )
329 MATCH_REDISP( wxPliOvl_wrta, newCopy )
330 MATCH_REDISP( wxPliOvl_wtae, newAttrEx )
331 MATCH_REDISP( wxPliOvl_wtat, newAttr )
332 MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wcol_wcol_n, newFull, 2 )
333 END_OVERLOAD( Wx::RichTextAttr::new )
336 wxRichTextAttr::GetTabs()
338 const wxArrayInt& tabs = THIS->GetTabs();
340 wxPli_intarray_push( aTHX_ tabs );