Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / richtext / XS / RichTextCtrl.xsp
1 #############################################################################
2 ## Name:        ext/richtext/XS/RichTextCtrl.xsp
3 ## Purpose:     XS++ for Wx::RichTextCtrl
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     05/11/2006
7 ## RCS-ID:      $Id: RichTextCtrl.xsp 2738 2010-01-03 20:03:42Z mbarbon $
8 ## Copyright:   (c) 2006-2008, 2010 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 #############################################################################
12
13 #undef _
14 #define _(x) wxGetTranslation(wxT(x))
15
16 #include <wx/event.h>
17 #include <wx/button.h>
18 #include <wx/checkbox.h>
19 #include <wx/richtext/richtextctrl.h>
20 #include <wx/richtext/richtextstyles.h>
21 #include <wx/richtext/richtextformatdlg.h>
22 #include <wx/richtext/richtextstyledlg.h>
23 #include <wx/richtext/richtextprint.h>
24 #include "cpp/richtextctrl.h"
25
26 %module{Wx};
27
28 ## DECLARE_OVERLOAD( wrtr, Wx::RichTextRange )
29 ## DECLARE_OVERLOAD( wrta, Wx::RichTextAttr )
30 ## DECLARE_OVERLOAD( wtae, Wx::TextAttrEx )
31 ## DECLARE_OVERLOAD( wtat, Wx::TextAttr )
32
33 %file{cpp/richtextctrl.h};
34 %{
35
36 #define wxTEXT_ATTR_DEFAULT_NUMBERED_BULLET wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD
37
38 #define wxRICHTEXT_STYLE_ALL wxRichTextStyleListBox::wxRICHTEXT_STYLE_ALL
39 #define wxRICHTEXT_STYLE_CHARACTER wxRichTextStyleListBox::wxRICHTEXT_STYLE_CHARACTER
40 #define wxRICHTEXT_STYLE_LIST wxRichTextStyleListBox::wxRICHTEXT_STYLE_LIST
41 #define wxRICHTEXT_STYLE_PARAGRAPH wxRichTextStyleListBox::wxRICHTEXT_STYLE_PARAGRAPH
42
43 double richtextctrl_constant( const char* name, int arg )
44 {
45     // !package: Wx
46     // !parser: sub { $_[0] =~ m<^\s*r\w*\(\s*(\w+)\s*\);\s*(?://(.*))?$> }
47     // !tag: richtextctrl
48 #define r( n ) \
49     if( strEQ( name, #n ) ) \
50         return n;
51
52     WX_PL_CONSTANT_INIT();
53
54     switch( fl )
55     {
56     case 'R':
57         r( wxRE_READONLY );
58         r( wxRE_MULTILINE );
59 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
60         r( wxRICHTEXT_SETSTYLE_NONE );
61         r( wxRICHTEXT_SETSTYLE_WITH_UNDO );
62         r( wxRICHTEXT_SETSTYLE_OPTIMIZE );
63         r( wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY );
64         r( wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY );
65 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
66         r( wxRICHTEXT_SETSTYLE_RENUMBER );
67         r( wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL );
68 #endif
69 #if WXPERL_W_VERSION_GE( 2, 8, 7 )
70         r( wxRICHTEXT_SETSTYLE_REMOVE );
71 #endif
72         r( wxRICHTEXT_INSERT_NONE );
73         r( wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE );
74 #endif
75 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
76         r( wxRICHTEXT_SETSTYLE_RESET );
77 #endif
78         r( wxRICHTEXT_FIXED_WIDTH );
79         r( wxRICHTEXT_FIXED_HEIGHT );
80         r( wxRICHTEXT_VARIABLE_WIDTH );
81         r( wxRICHTEXT_VARIABLE_HEIGHT );
82         r( wxRICHTEXT_LAYOUT_SPECIFIED_RECT );
83 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
84         r( wxRICHTEXT_DRAW_IGNORE_CACHE );
85 #endif
86         r( wxRICHTEXT_HITTEST_NONE );
87         r( wxRICHTEXT_HITTEST_BEFORE );
88         r( wxRICHTEXT_HITTEST_AFTER );
89         r( wxRICHTEXT_HITTEST_ON );
90 #if WXPERL_W_VERSION_GE( 2, 8, 7 )
91         r( wxRICHTEXT_HITTEST_OUTSIDE );
92 #endif
93         r( wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET );
94         r( wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY );
95         r( wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES );
96         r( wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64 );
97 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
98         r( wxRICHTEXT_HANDLER_NO_HEADER_FOOTER );
99 #endif
100 #if WXPERL_W_VERSION_GE( 2, 8, 8 )
101         r( wxRICHTEXT_HANDLER_CONVERT_FACENAMES );
102 #endif
103
104         r( wxRICHTEXT_FORMATTED );
105         r( wxRICHTEXT_UNFORMATTED );
106         r( wxRICHTEXT_TYPE_ANY );
107         r( wxRICHTEXT_TYPE_TEXT );
108         r( wxRICHTEXT_TYPE_XML );
109         r( wxRICHTEXT_TYPE_HTML );
110         r( wxRICHTEXT_TYPE_RTF );
111         r( wxRICHTEXT_TYPE_PDF );
112         r( wxRICHTEXT_FORMAT_STYLE_EDITOR );
113         r( wxRICHTEXT_FORMAT_FONT );
114         r( wxRICHTEXT_FORMAT_TABS );
115         r( wxRICHTEXT_FORMAT_BULLETS );
116         r( wxRICHTEXT_FORMAT_INDENTS_SPACING );
117         r( wxRICHTEXT_FORMAT_CHARACTER );
118         r( wxRICHTEXT_FORMAT_HELP_BUTTON );
119         r( wxRICHTEXT_FORMAT_LIST_STYLE );
120         r( wxRICHTEXT_FORMAT_PARAGRAPH );
121         r( wxRICHTEXT_FORMAT_STYLE );
122
123         r( wxRICHTEXT_ORGANISER_DELETE_STYLES );
124         r( wxRICHTEXT_ORGANISER_CREATE_STYLES );
125         r( wxRICHTEXT_ORGANISER_APPLY_STYLES );
126         r( wxRICHTEXT_ORGANISER_EDIT_STYLES );
127         r( wxRICHTEXT_ORGANISER_RENAME_STYLES );
128         r( wxRICHTEXT_ORGANISER_OK_CANCEL );
129         r( wxRICHTEXT_ORGANISER_RENUMBER );
130         r( wxRICHTEXT_ORGANISER_SHOW_CHARACTER );
131         r( wxRICHTEXT_ORGANISER_SHOW_PARAGRAPH );
132         r( wxRICHTEXT_ORGANISER_SHOW_LIST );
133         r( wxRICHTEXT_ORGANISER_SHOW_ALL );
134         r( wxRICHTEXT_ORGANISER_ORGANISE );
135         r( wxRICHTEXT_ORGANISER_BROWSE );
136         r( wxRICHTEXT_ORGANISER_BROWSE_NUMBERING );
137
138         r( wxRICHTEXT_PAGE_ALL );
139         r( wxRICHTEXT_PAGE_CENTRE );
140         r( wxRICHTEXT_PAGE_EVEN );
141         r( wxRICHTEXT_PAGE_LEFT );
142         r( wxRICHTEXT_PAGE_ODD );
143         r( wxRICHTEXT_PAGE_RIGHT );
144
145         r( wxRICHTEXT_STYLE_ALL );
146         r( wxRICHTEXT_STYLE_CHARACTER );
147         r( wxRICHTEXT_STYLE_LIST );
148         r( wxRICHTEXT_STYLE_PARAGRAPH );
149         break;
150     case 'T':
151         r( wxTEXT_ATTR_PARA_SPACING_AFTER );
152         r( wxTEXT_ATTR_PARA_SPACING_BEFORE );
153         r( wxTEXT_ATTR_LINE_SPACING );
154         r( wxTEXT_ATTR_CHARACTER_STYLE_NAME );
155         r( wxTEXT_ATTR_PARAGRAPH_STYLE_NAME );
156 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
157         r( wxTEXT_ATTR_LIST_STYLE_NAME );
158 #endif
159         r( wxTEXT_ATTR_BULLET_STYLE );
160         r( wxTEXT_ATTR_BULLET_NUMBER );
161 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
162         r( wxTEXT_ATTR_BULLET_TEXT );
163         r( wxTEXT_ATTR_BULLET_NAME );
164         r( wxTEXT_ATTR_URL );
165         r( wxTEXT_ATTR_PAGE_BREAK );
166 #endif
167         r( wxTEXT_ATTR_BULLET_STYLE_NONE );
168         r( wxTEXT_ATTR_BULLET_STYLE_ARABIC );
169         r( wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER );
170         r( wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER );
171         r( wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER );
172         r( wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER );
173         r( wxTEXT_ATTR_BULLET_STYLE_SYMBOL );
174         r( wxTEXT_ATTR_BULLET_STYLE_BITMAP );
175         r( wxTEXT_ATTR_BULLET_STYLE_PARENTHESES );
176         r( wxTEXT_ATTR_BULLET_STYLE_PERIOD );
177 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
178         r( wxTEXT_ATTR_BULLET_STYLE_STANDARD );
179         r( wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS );
180         r( wxTEXT_ATTR_BULLET_STYLE_OUTLINE );
181         r( wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT );
182         r( wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT );
183         r( wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE );
184 #endif
185         r( wxTEXT_ATTR_LINE_SPACING_NORMAL );
186         r( wxTEXT_ATTR_LINE_SPACING_HALF );
187         r( wxTEXT_ATTR_LINE_SPACING_TWICE );
188         r( wxTEXT_ATTR_CHARACTER );
189         r( wxTEXT_ATTR_PARAGRAPH );
190         r( wxTEXT_ATTR_ALL );
191
192 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
193         r( wxTEXT_ATTR_EFFECT_NONE );
194         r( wxTEXT_ATTR_EFFECT_CAPITALS );
195         r( wxTEXT_ATTR_EFFECT_SMALL_CAPITALS );
196         r( wxTEXT_ATTR_EFFECT_STRIKETHROUGH );
197         r( wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH );
198         r( wxTEXT_ATTR_EFFECT_SHADOW );
199         r( wxTEXT_ATTR_EFFECT_EMBOSS );
200         r( wxTEXT_ATTR_EFFECT_OUTLINE );
201         r( wxTEXT_ATTR_EFFECT_ENGRAVE );
202         r( wxTEXT_ATTR_EFFECT_SUPERSCRIPT );
203         r( wxTEXT_ATTR_EFFECT_SUBSCRIPT );
204 #endif
205
206 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
207         r( wxTEXT_ATTR_EFFECTS );
208 #endif
209 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
210         r( wxTEXT_ATTR_FONT_ENCODING );
211 #endif
212 #if WXPERL_W_VERSION_GE( 2, 8, 8 )
213         r( wxTEXT_ATTR_KEEP_FIRST_PARA_STYLE );
214 #endif
215 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
216         r( wxTEXT_ATTR_OUTLINE_LEVEL );
217 #endif
218         break;
219     }
220 #undef r
221
222     WX_PL_CONSTANT_CLEANUP();
223 }
224
225 wxPlConstants richtextctrl_module( &richtextctrl_constant );
226
227 %}
228 %file{-};
229
230 %name{Wx::RichTextEvent} class wxRichTextEvent
231 {
232 #if WXPERL_W_VERSION_LE( 2, 7, 2 )
233     int GetIndex() const;
234     void SetIndex( int n );
235 #endif
236     int GetFlags() const;
237     void SetFlags( int flags );
238 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
239     wxRichTextStyleSheetDisown* GetOldStyleSheet() const;
240     void SetOldStyleSheet( wxRichTextStyleSheetDisown* sheet );
241     wxRichTextStyleSheetDisown* GetNewStyleSheet() const;
242     void SetNewStyleSheet( wxRichTextStyleSheetDisown* sheet );
243 #endif
244 };
245
246 %name{Wx::RichTextCtrl} class wxRichTextCtrl
247 {
248     %name{newDefault} wxRichTextCtrl()
249         %code{% RETVAL = new wxRichTextCtrl();
250                 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
251              %};
252     %name{newFull} wxRichTextCtrl( wxWindow* parent,
253                                    wxWindowID id = wxID_ANY,
254                                    const wxString& string = wxEmptyString,
255                                    const wxPoint& pos = wxDefaultPosition,
256                                    const wxSize& size = wxDefaultSize,
257                                    long style = wxRE_MULTILINE )
258         %code{% RETVAL = new wxRichTextCtrl( parent, id, string,
259                                              pos, size, style );
260                 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
261              %};
262
263     bool Create( wxWindow* parent, wxWindowID id = wxID_ANY,
264                  const wxString& string = wxEmptyString,
265                  const wxPoint& pos = wxDefaultPosition,
266                  const wxSize& size = wxDefaultSize,
267                  long style = wxRE_MULTILINE );
268
269     wxString GetFilename() const;
270     void SetFilename( const wxString& filename );
271     void SetDelayedLayoutThreshold( long threshold );
272     long GetDelayedLayoutThreshold() const;
273
274     %name{SetStyleFromTo} bool SetStyle( long start, long end,
275                                          const wxTextAttr& style );
276     %name{SetStyleExFromTo} bool SetStyle( long start, long end,
277                                            const wxTextAttrEx& style );
278     %name{SetStyleRange} bool SetStyle( const wxRichTextRange& range,
279                                         const wxRichTextAttr& style );
280
281 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
282 #if WXPERL_W_VERSION_LT( 2, 9, 0 )
283     %name{SetStyleExExFromTo} bool SetStyleEx
284         ( long start, long end, const wxTextAttrEx& style,
285           int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO );
286 #endif
287     %name{SetStyleExRange} bool SetStyleEx
288         ( const wxRichTextRange& range, const wxTextAttrEx& style,
289           int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO );
290     %name{SetStyleExExRange} bool SetStyleEx
291         ( const wxRichTextRange& range, const wxRichTextAttr& style,
292           int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO );
293 #endif
294
295     const wxTextAttrEx& GetBasicStyle() const;
296     const wxTextAttrEx& GetDefaultStyleEx() const;
297
298     bool Newline();
299
300     bool BeginStyle( const wxTextAttrEx& style );
301     bool EndStyle();
302     bool EndAllStyles();
303     bool BeginBold();
304     bool EndBold();
305     bool BeginItalic();
306     bool EndItalic();
307     bool BeginUnderline();
308     bool EndUnderline();
309     bool BeginFontSize( int pointSize );
310     bool EndFontSize();
311     bool BeginFont( const wxFont& font );
312     bool EndFont();
313     bool BeginTextColour( const wxColour& colour );
314     bool EndTextColour();
315     bool BeginAlignment( wxTextAttrAlignment alignment );
316     bool EndAlignment();
317     bool BeginLeftIndent( int leftIndent, int leftSubIndent = 0 );
318     bool EndLeftIndent();
319     bool BeginRightIndent( int rightIndent );
320     bool EndRightIndent();
321     bool BeginParagraphSpacing( int before, int after );
322     bool EndParagraphSpacing();
323     bool BeginLineSpacing( int lineSpacing );
324     bool EndLineSpacing();
325     bool BeginNumberedBullet( int bulletNumber, int leftIndent, 
326                               int leftSubIndent,
327                               int bulletStyle = wxTEXT_ATTR_DEFAULT_NUMBERED_BULLET );
328     bool EndNumberedBullet();
329 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
330     bool BeginSymbolBullet( const wxString& symbol, int leftIndent,
331                             int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL );
332 #else
333     bool BeginSymbolBullet( wxChar symbol, int leftIndent,
334                             int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL );
335 #endif
336     bool EndSymbolBullet();
337 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
338     bool BeginStandardBullet( const wxString& bulletName, int leftIndent,
339                               int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD );
340     bool EndStandardBullet();
341 #endif
342     bool BeginCharacterStyle( const wxString& characterStyle );
343     bool EndCharacterStyle();
344     bool BeginParagraphStyle( const wxString& paragraphStyle );
345     bool EndParagraphStyle();
346 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
347     bool BeginListStyle( const wxString& listStyle, int level = 1,
348                          int number = 1 );
349     bool EndListStyle();
350     bool BeginURL( const wxString& url,
351                    const wxString& characterStyle = wxEmptyString );
352     bool EndURL();
353 #endif
354     bool SetDefaultStyleToCursorStyle();
355 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
356     bool ClearListStyle( const wxRichTextRange& range,
357                          int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO );
358 #endif
359     void SelectNone();
360 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
361     bool SelectWord( long position );
362 #endif
363     wxRichTextRange GetSelectionRange() const;
364     void SetSelectionRange( const wxRichTextRange& range );
365 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
366     const wxRichTextRange& GetInternalSelectionRange() const;
367     void SetInternalSelectionRange( const wxRichTextRange& range );
368 #endif
369     bool HasSelection() const;
370     wxRichTextRange AddParagraph( const wxString& text );
371     wxRichTextRange AddImage( const wxImage& image );
372
373     bool LayoutContent( bool onlyVisibleRect = false );
374     bool MoveCaret( long pos, bool showAtLineStart = false );
375     bool MoveRight( int noPositions = 1, int flags = 0 );
376     bool MoveLeft( int noPositions = 1, int flags = 0 );
377     bool MoveUp( int noLines = 1, int flags = 0 );
378     bool MoveDown( int noLines = 1, int flags = 0 );
379     bool MoveToLineEnd( int flags = 0 );
380     bool MoveToLineStart( int flags = 0 );
381     bool MoveToParagraphEnd( int flags = 0 );
382     bool MoveToParagraphStart( int flags = 0 );
383     bool MoveHome( int flags = 0 );
384     bool MoveEnd( int flags = 0 );
385     bool PageUp( int noPages = 1, int flags = 0 );
386     bool PageDown( int noPages = 1, int flags = 0 );
387     bool WordLeft( int noPages = 1, int flags = 0 );
388     bool WordRight( int noPages = 1, int flags = 0 );
389
390     bool BeginBatchUndo( const wxString& cmdName );
391     bool EndBatchUndo();
392     bool BatchingUndo() const;
393     bool BeginSuppressUndo();
394     bool EndSuppressUndo();
395     bool SuppressingUndo() const;
396
397     bool CanDeleteSelection() const;
398     void DeleteSelection();
399
400     %name{HasCARich} bool HasCharacterAttributes
401         ( const wxRichTextRange& range, const wxTextAttrEx& style ) const;
402     %name{HasCAEx}   bool HasCharacterAttributes
403         ( const wxRichTextRange& range, const wxRichTextAttr& style) const;
404     %name{HasPARich} bool HasParagraphAttributes
405         ( const wxRichTextRange& range, const wxTextAttrEx& style) const;
406     %name{HasPAEx}   bool HasParagraphAttributes
407         ( const wxRichTextRange& range, const wxRichTextAttr& style) const;
408
409     bool IsSelectionBold();
410     bool IsSelectionItalics();
411     bool IsSelectionUnderlined();
412     bool IsSelectionAligned( wxTextAttrAlignment alignment );
413     bool ApplyBoldToSelection();
414     bool ApplyItalicToSelection();
415     bool ApplyUnderlineToSelection();
416     bool ApplyAlignmentToSelection(wxTextAttrAlignment alignment);
417 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
418     bool ApplyStyle( wxRichTextStyleDefinition* def );
419     void SetStyleSheet( wxRichTextStyleSheet* styleSheet );
420     wxRichTextStyleSheetDisown* GetStyleSheet() const;
421     bool ApplyStyleSheet( wxRichTextStyleSheet* styleSheet = NULL );
422 #endif
423 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
424     bool PushStyleSheet( wxRichTextStyleSheetDisown* styleSheet );
425     wxRichTextStyleSheetDisown* PopStyleSheet();
426 #endif
427
428     void PositionCaret();
429     bool ExtendSelection( long oldPosition, long newPosition, int flags );
430     bool ScrollIntoView( long position, int keyCode );
431     void SetCaretPosition( long position, bool showAtLineStart = false );
432     long GetCaretPosition() const;
433
434 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
435     long GetAdjustedCaretPosition( long caretPos ) const;
436 #endif
437     void MoveCaretForward( long oldPosition );
438     void MoveCaretBack( long oldPosition );
439
440 ##    bool GetCaretPositionForIndex( long position, wxRect& rect );
441 ##    bool DeleteSelectedContent( long* newPos= NULL );
442
443     wxPoint GetPhysicalPoint( const wxPoint& ptLogical ) const;
444     wxPoint GetLogicalPoint( const wxPoint& ptPhysical ) const;
445
446     long FindNextWordPosition( int direction = 1 ) const;
447     bool IsPositionVisible( long pos ) const;
448     long GetFirstVisiblePosition() const;
449 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
450     long GetCaretPositionForDefaultStyle() const;
451     void SetCaretPositionForDefaultStyle( long pos );
452     bool IsDefaultStyleShowing() const;
453     void SetAndShowDefaultStyle( const wxRichTextAttr& attr );
454 #endif
455 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
456     wxPoint GetFirstVisiblePoint() const;
457 #endif
458
459     %name{WriteImageFile} bool WriteImage( const wxString& filename,
460                                            wxBitmapType bitmapType );
461     %name{WriteImageBitmap} bool WriteImage( const wxBitmap& bitmap,
462                                   wxBitmapType bitmapType = wxBITMAP_TYPE_PNG );
463     %name{WriteImageImage} bool WriteImage( const wxImage& image,
464                                   wxBitmapType bitmapType = wxBITMAP_TYPE_PNG );
465
466     %name{SetBasicStyleRich} void SetBasicStyle( const wxRichTextAttr& style );
467     %name{SetBasicStyleEx} void SetBasicStyle( const wxTextAttrEx& style );
468 %{
469 void
470 wxRichTextCtrl::SetBasicStyle( ... )
471   PPCODE:
472     BEGIN_OVERLOAD()
473         MATCH_REDISP( wxPliOvl_wrta, SetBasicStyleRich )
474         MATCH_REDISP( wxPliOvl_wtae, SetBasicStyleEx )
475     END_OVERLOAD( "Wx::RichTextCtrl::SetBasicStyle" )
476
477 %}
478
479     wxRichTextBuffer* GetBuffer()
480         %code{% RETVAL = &THIS->GetBuffer(); %};
481 };
482
483 %{
484
485 void
486 wxRichTextCtrl::new( ... )
487   PPCODE:
488     BEGIN_OVERLOAD()
489         MATCH_VOIDM_REDISP( newDefault )
490         MATCH_ANY_REDISP( newFull )
491     END_OVERLOAD( "Wx::RichTextCtrl::new" )
492
493 void
494 wxRichTextCtrl::SetStyle( ... )
495   PPCODE:
496     BEGIN_OVERLOAD()
497         MATCH_REDISP( wxPliOvl_wrtr_wrta, SetStyleRange )
498         MATCH_REDISP( wxPliOvl_n_n_wtae, SetStyleExFromTo )
499         MATCH_REDISP( wxPliOvl_n_n_wtat, SetStyleFromTo )
500     END_OVERLOAD( "Wx::RichTextCtrl::SetStyle" )
501
502 void
503 wxRichTextCtrl::SetStyleEx( ... )
504   PPCODE:
505     BEGIN_OVERLOAD()
506         MATCH_REDISP( wxPliOvl_wrtr_wrta_n, SetStyleExExRange )
507         MATCH_REDISP( wxPliOvl_wrtr_wtae_n, SetStyleExRange )
508         MATCH_REDISP( wxPliOvl_n_n_wtae, SetStyleExExFromTo )
509     END_OVERLOAD( "Wx::RichTextCtrl::SetStyleEx" )
510
511 void
512 wxRichTextCtrl::HasCharacterAttributes( ... )
513   PPCODE:
514     BEGIN_OVERLOAD()
515         MATCH_REDISP( wxPliOvl_wrtr_wrta, HasCARich )
516         MATCH_REDISP( wxPliOvl_wrtr_wtae, HasCAEx )
517     END_OVERLOAD( "Wx::RichTextCtrl::HasCharacterAttributes" )
518
519 void
520 wxRichTextCtrl::HasParagraphAttributes( ... )
521   PPCODE:
522     BEGIN_OVERLOAD()
523         MATCH_REDISP( wxPliOvl_wrtr_wrtr, HasPARich )
524         MATCH_REDISP( wxPliOvl_wrtr_wtae, HasPAEx )
525     END_OVERLOAD( "Wx::RichTextCtrl::HasParagraphAttributes" )
526
527 void
528 wxRichTextCtrl::DeleteSelectedContent()
529   PPCODE:
530     long newPos;
531     bool retval = THIS->DeleteSelectedContent( &newPos );
532     EXTEND( SP, 2 );
533     PUSHs( newSViv( retval ) );
534     PUSHs( newSViv( retval ? newPos : -1 ) );
535
536 void
537 wxRichTextCtrl::GetCaretPositionForIndex( position )
538     long position
539   PPCODE:
540     wxRect rect;
541     bool retval = THIS->GetCaretPositionForIndex( position, rect );
542     EXTEND( SP, 2 );
543     PUSHs( newSViv( retval ) );
544     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
545                                            new wxRect( rect ), "Wx::Rect" ) :
546                     &PL_sv_undef );
547
548 void
549 wxRichTextCtrl::GetRichTextAttrStyle( position )
550     long position
551   PPCODE:
552     wxRichTextAttr attr;
553     bool retval = THIS->GetStyle( position, attr );
554     EXTEND( SP, 2 );
555     PUSHs( newSViv( retval ) );
556     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
557                                            new wxRichTextAttr( attr ),
558                                            "Wx::RichTextAttr" ) :
559                     &PL_sv_undef );
560
561 void
562 wxRichTextCtrl::GetTextAttrExStyle( position )
563     long position
564   PPCODE:
565     wxTextAttrEx attr;
566     bool retval = THIS->GetStyle( position, attr );
567     EXTEND( SP, 2 );
568     PUSHs( newSViv( retval ) );
569     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
570                                            new wxTextAttrEx( attr ),
571                                            "Wx::TextAttrEx" ) :
572                     &PL_sv_undef );
573
574 void
575 wxRichTextCtrl::GetTextAttrStyle( position )
576     long position
577   PPCODE:
578     wxTextAttr attr;
579     bool retval = THIS->GetStyle( position, attr );
580     EXTEND( SP, 2 );
581     PUSHs( newSViv( retval ) );
582     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
583                                            new wxTextAttr( attr ),
584                                            "Wx::TextAttr" ) :
585                     &PL_sv_undef );
586
587 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
588
589 void
590 wxRichTextCtrl::GetStyle( position )
591     long position
592   PPCODE:
593     wxTextAttr attr;
594     bool retval = THIS->GetStyle( position, attr );
595     EXTEND( SP, 2 );
596     PUSHs( newSViv( retval ) );
597     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
598                                            new wxTextAttr( attr ),
599                                            "Wx::TextAttr" ) :
600                     &PL_sv_undef );
601
602 #endif
603
604 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
605
606 void
607 wxRichTextCtrl::GetRichTextAttrUncombinedStyle( position )
608     long position
609   PPCODE:
610     wxRichTextAttr attr;
611     bool retval = THIS->GetUncombinedStyle( position, attr );
612     EXTEND( SP, 2 );
613     PUSHs( newSViv( retval ) );
614     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
615                                            new wxRichTextAttr( attr ),
616                                            "Wx::RichTextAttr" ) :
617                     &PL_sv_undef );
618
619 void
620 wxRichTextCtrl::GetTextAttrExUncombinedStyle( position )
621     long position
622   PPCODE:
623     wxTextAttrEx attr;
624     bool retval = THIS->GetUncombinedStyle( position, attr );
625     EXTEND( SP, 2 );
626     PUSHs( newSViv( retval ) );
627     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
628                                            new wxTextAttrEx( attr ),
629                                            "Wx::TextAttrEx" ) :
630                     &PL_sv_undef );
631
632 void
633 wxRichTextCtrl::GetTextAttrUncombinedStyle( position )
634     long position
635   PPCODE:
636     wxTextAttr attr;
637     bool retval = THIS->GetUncombinedStyle( position, attr );
638     EXTEND( SP, 2 );
639     PUSHs( newSViv( retval ) );
640     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
641                                            new wxTextAttr( attr ),
642                                            "Wx::TextAttr" ) :
643                     &PL_sv_undef );
644
645 #endif
646
647 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
648
649 void
650 wxRichTextCtrl::GetUncombinedStyle( position )
651     long position
652   PPCODE:
653     wxTextAttr attr;
654     bool retval = THIS->GetUncombinedStyle( position, attr );
655     EXTEND( SP, 2 );
656     PUSHs( newSViv( retval ) );
657     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
658                                            new wxTextAttr( attr ),
659                                            "Wx::TextAttr" ) :
660                     &PL_sv_undef );
661
662 #endif
663
664 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
665
666 void
667 wxRichTextCtrl::GetRichTextAttrStyleForRange( range )
668     wxRichTextRange* range
669   PPCODE:
670     wxRichTextAttr attr;
671     bool retval = THIS->GetStyleForRange( *range, attr );
672     EXTEND( SP, 2 );
673     PUSHs( newSViv( retval ) );
674     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
675                                            new wxRichTextAttr( attr ),
676                                            "Wx::RichTextAttr" ) :
677                     &PL_sv_undef );
678
679 void
680 wxRichTextCtrl::GetTextAttrExStyleForRange( range )
681     wxRichTextRange* range
682   PPCODE:
683     wxTextAttrEx attr;
684     bool retval = THIS->GetStyleForRange( *range, attr );
685     EXTEND( SP, 2 );
686     PUSHs( newSViv( retval ) );
687     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
688                                            new wxTextAttrEx( attr ),
689                                            "Wx::TextAttrEx" ) :
690                     &PL_sv_undef );
691
692 #endif
693
694 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
695
696 void
697 wxRichTextCtrl::GetStyleForRange( range )
698     wxRichTextRange* range
699   PPCODE:
700     wxTextAttr attr;
701     bool retval = THIS->GetStyleForRange( *range, attr );
702     EXTEND( SP, 2 );
703     PUSHs( newSViv( retval ) );
704     PUSHs( retval ? wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
705                                            new wxTextAttrEx( attr ),
706                                            "Wx::TextAttrEx" ) :
707                     &PL_sv_undef );
708
709 #endif
710
711 void
712 WriteImage( ... )
713   PPCODE:
714     BEGIN_OVERLOAD()
715         MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wimg_n, WriteImageImage, 1 )
716         MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wbmp_n, WriteImageBitmap, 1 )
717         MATCH_REDISP( wxPliOvl_s_n, WriteImageFile )
718     END_OVERLOAD( "Wx::RichTextCtrl::WriteImage" )
719
720
721 %}