1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _richtext.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13class wxRichTextStyleListCtrl : wxControl
14{
15    %Docstring
16        RichTextStyleListCtrl(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0)
17        RichTextStyleListCtrl()
18
19        This class incorporates a wxRichTextStyleListBox and a choice control
20        that allows the user to select the category of style to view.
21    %End
22    %TypeHeaderCode
23        #include <wx/richtext/richtextstyles.h>
24    %End
25
26public:
27    wxRichTextStyleListCtrl(
28        wxWindow * parent   /TransferThis/,
29        wxWindowID id = wxID_ANY,
30        const wxPoint & pos = wxDefaultPosition,
31        const wxSize & size = wxDefaultSize,
32        long style = 0
33    );
34    %PreMethodCode
35        if (!wxPyCheckForApp()) return NULL;
36    %End
37
38    wxRichTextStyleListCtrl();
39    %PreMethodCode
40        if (!wxPyCheckForApp()) return NULL;
41    %End
42
43    bool Create(
44        wxWindow * parent   /TransferThis/,
45        wxWindowID id = wxID_ANY,
46        const wxPoint & pos = wxDefaultPosition,
47        const wxSize & size = wxDefaultSize,
48        long style = 0
49    );
50    %Docstring
51        Create(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0) -> bool
52
53        Creates the windows.
54    %End
55
56    wxRichTextCtrl * GetRichTextCtrl() const;
57    %Docstring
58        GetRichTextCtrl() -> RichTextCtrl
59
60        Returns the associated rich text control, if any.
61    %End
62
63    wxChoice * GetStyleChoice() const;
64    %Docstring
65        GetStyleChoice() -> wx.Choice
66
67        Returns the wxChoice control used for selecting the style category.
68    %End
69
70    wxRichTextStyleListBox * GetStyleListBox() const;
71    %Docstring
72        GetStyleListBox() -> RichTextStyleListBox
73
74        Returns the wxListBox control used to view the style list.
75    %End
76
77    wxRichTextStyleSheet * GetStyleSheet() const;
78    %Docstring
79        GetStyleSheet() -> RichTextStyleSheet
80
81        Returns the associated style sheet, if any.
82    %End
83
84    wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const;
85    %Docstring
86        GetStyleType() -> RichTextStyleListBox.wxRichTextStyleType
87
88        Returns the type of style to show in the list box.
89    %End
90
91    void SetRichTextCtrl(
92        wxRichTextCtrl * ctrl
93    );
94    %Docstring
95        SetRichTextCtrl(ctrl)
96
97        Associates the control with a wxRichTextCtrl.
98    %End
99
100    void SetStyleSheet(
101        wxRichTextStyleSheet * styleSheet
102    );
103    %Docstring
104        SetStyleSheet(styleSheet)
105
106        Associates the control with a style sheet.
107    %End
108
109    void SetStyleType(
110        wxRichTextStyleListBox::wxRichTextStyleType styleType
111    );
112    %Docstring
113        SetStyleType(styleType)
114
115        Sets the style type to display.
116    %End
117
118    void UpdateStyles();
119    %Docstring
120        UpdateStyles()
121
122        Updates the style list box.
123    %End
124
125    public:
126    virtual wxPoint GetClientAreaOrigin() const;
127    virtual bool Validate();
128    virtual bool TransferDataToWindow();
129    virtual bool TransferDataFromWindow();
130    virtual void InitDialog();
131    virtual bool AcceptsFocus() const;
132    virtual bool AcceptsFocusRecursively() const;
133    virtual bool AcceptsFocusFromKeyboard() const;
134    virtual void AddChild( wxWindowBase *child );
135    virtual void RemoveChild( wxWindowBase *child );
136    virtual void InheritAttributes();
137    virtual bool ShouldInheritColours() const;
138    virtual void OnInternalIdle();
139    virtual wxWindow *GetMainWindowOfCompositeControl();
140    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
141    virtual void SetCanFocus(bool canFocus);
142    virtual bool Destroy();
143    virtual void SetValidator( const wxValidator &validator );
144    virtual wxValidator* GetValidator();
145
146
147    protected:
148    virtual bool ProcessEvent(wxEvent & event);
149    virtual void DoEnable(bool enable);
150    virtual void DoGetPosition(int *x, int *y) const;
151    virtual void DoGetSize(int *width, int *height) const;
152    virtual void DoGetClientSize(int *width, int *height) const;
153    virtual wxSize DoGetBestSize() const;
154    virtual wxSize DoGetBestClientSize() const;
155    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
156    virtual void DoSetClientSize(int width, int height);
157    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
158    virtual wxSize DoGetBorderSize() const;
159    virtual void DoMoveWindow(int x, int y, int width, int height);
160    virtual void DoSetWindowVariant( wxWindowVariant variant);
161    virtual wxBorder GetDefaultBorder() const;
162    virtual wxBorder GetDefaultBorderForControl() const;
163    virtual void DoFreeze();
164    virtual void DoThaw();
165    virtual bool HasTransparentBackground();
166    virtual bool TryBefore(wxEvent& event);
167    virtual bool TryAfter(wxEvent& event);
168
169
170    public:
171
172
173    static
174    wxVisualAttributes GetClassDefaultAttributes(
175        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
176    );
177    %Docstring
178        GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes
179    %End
180    %PreMethodCode
181        if (!wxPyCheckForApp()) return NULL;
182    %End
183
184    public:
185
186
187    %Property(name=RichTextCtrl, get=GetRichTextCtrl, set=SetRichTextCtrl)
188    %Property(name=StyleChoice, get=GetStyleChoice)
189    %Property(name=StyleListBox, get=GetStyleListBox)
190    %Property(name=StyleSheet, get=GetStyleSheet, set=SetStyleSheet)
191    %Property(name=StyleType, get=GetStyleType, set=SetStyleType)
192};  // end of class wxRichTextStyleListCtrl
193
194
195class wxRichTextStyleListBox : wxHtmlListBox
196{
197    %Docstring
198        RichTextStyleListBox(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0)
199        RichTextStyleListBox()
200
201        This is a listbox that can display the styles in a
202        wxRichTextStyleSheet, and apply the selection to an associated
203        wxRichTextCtrl.
204    %End
205    %TypeHeaderCode
206        #include <wx/richtext/richtextstyles.h>
207    %End
208
209public:
210    enum wxRichTextStyleType
211    {
212        wxRICHTEXT_STYLE_ALL,
213        wxRICHTEXT_STYLE_PARAGRAPH,
214        wxRICHTEXT_STYLE_CHARACTER,
215        wxRICHTEXT_STYLE_LIST,
216        wxRICHTEXT_STYLE_BOX
217    };
218
219    wxRichTextStyleListBox(
220        wxWindow * parent   /TransferThis/,
221        wxWindowID id = wxID_ANY,
222        const wxPoint & pos = wxDefaultPosition,
223        const wxSize & size = wxDefaultSize,
224        long style = 0
225    );
226    %PreMethodCode
227        if (!wxPyCheckForApp()) return NULL;
228    %End
229
230    wxRichTextStyleListBox();
231    %PreMethodCode
232        if (!wxPyCheckForApp()) return NULL;
233    %End
234
235    ~wxRichTextStyleListBox();
236
237    bool Create(
238        wxWindow * parent   /TransferThis/,
239        wxWindowID id = wxID_ANY,
240        const wxPoint & pos = wxDefaultPosition,
241        const wxSize & size = wxDefaultSize,
242        long style = 0
243    );
244    %Docstring
245        Create(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0) -> bool
246
247        Creates the window.
248    %End
249
250    void ApplyStyle(
251        int i
252    );
253    %Docstring
254        ApplyStyle(i)
255
256        Applies the ith style to the associated rich text control.
257    %End
258
259    int ConvertTenthsMMToPixels(
260        wxDC & dc,
261        int units
262    ) const;
263    %Docstring
264        ConvertTenthsMMToPixels(dc, units) -> int
265
266        Converts units in tenths of a millimetre to device units.
267    %End
268
269    wxString CreateHTML(
270        wxRichTextStyleDefinition * styleDef
271    ) const;
272    %Docstring
273        CreateHTML(styleDef) -> String
274
275        Creates a suitable HTML fragment for a definition.
276    %End
277
278    bool GetApplyOnSelection() const;
279    %Docstring
280        GetApplyOnSelection() -> bool
281
282        If the return value is true, clicking on a style name in the list will
283        immediately apply the style to the associated rich text control.
284    %End
285
286    wxRichTextCtrl * GetRichTextCtrl() const;
287    %Docstring
288        GetRichTextCtrl() -> RichTextCtrl
289
290        Returns the wxRichTextCtrl associated with this listbox.
291    %End
292
293    wxRichTextStyleDefinition * GetStyle(
294        size_t i
295    ) const;
296    %Docstring
297        GetStyle(i) -> RichTextStyleDefinition
298
299        Gets a style for a listbox index.
300    %End
301
302    wxRichTextStyleSheet * GetStyleSheet() const;
303    %Docstring
304        GetStyleSheet() -> RichTextStyleSheet
305
306        Returns the style sheet associated with this listbox.
307    %End
308
309    wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const;
310    %Docstring
311        GetStyleType() -> RichTextStyleListBox.wxRichTextStyleType
312
313        Returns the type of style to show in the list box.
314    %End
315
316    void OnLeftDown(
317        wxMouseEvent & event
318    );
319    %Docstring
320        OnLeftDown(event)
321
322        Implements left click behaviour, applying the clicked style to the
323        wxRichTextCtrl.
324    %End
325
326    void SetApplyOnSelection(
327        bool applyOnSelection
328    );
329    %Docstring
330        SetApplyOnSelection(applyOnSelection)
331
332        If applyOnSelection is true, clicking on a style name in the list will
333        immediately apply the style to the associated rich text control.
334    %End
335
336    void SetRichTextCtrl(
337        wxRichTextCtrl * ctrl
338    );
339    %Docstring
340        SetRichTextCtrl(ctrl)
341
342        Associates the listbox with a wxRichTextCtrl.
343    %End
344
345    void SetStyleSheet(
346        wxRichTextStyleSheet * styleSheet
347    );
348    %Docstring
349        SetStyleSheet(styleSheet)
350
351        Associates the control with a style sheet.
352    %End
353
354    void SetStyleType(
355        wxRichTextStyleListBox::wxRichTextStyleType styleType
356    );
357    %Docstring
358        SetStyleType(styleType)
359
360        Sets the style type to display.
361    %End
362
363    void UpdateStyles();
364    %Docstring
365        UpdateStyles()
366
367        Updates the list from the associated style sheet.
368    %End
369
370    public:
371    virtual wxPoint GetClientAreaOrigin() const;
372    virtual bool Validate();
373    virtual bool TransferDataToWindow();
374    virtual bool TransferDataFromWindow();
375    virtual void InitDialog();
376    virtual bool AcceptsFocus() const;
377    virtual bool AcceptsFocusRecursively() const;
378    virtual bool AcceptsFocusFromKeyboard() const;
379    virtual void AddChild( wxWindowBase *child );
380    virtual void RemoveChild( wxWindowBase *child );
381    virtual void InheritAttributes();
382    virtual bool ShouldInheritColours() const;
383    virtual void OnInternalIdle();
384    virtual wxWindow *GetMainWindowOfCompositeControl();
385    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
386    virtual void SetCanFocus(bool canFocus);
387    virtual bool Destroy();
388    virtual void SetValidator( const wxValidator &validator );
389    virtual wxValidator* GetValidator();
390
391
392    protected:
393    virtual bool ProcessEvent(wxEvent & event);
394    virtual void DoEnable(bool enable);
395    virtual void DoGetPosition(int *x, int *y) const;
396    virtual void DoGetSize(int *width, int *height) const;
397    virtual void DoGetClientSize(int *width, int *height) const;
398    virtual wxSize DoGetBestSize() const;
399    virtual wxSize DoGetBestClientSize() const;
400    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
401    virtual void DoSetClientSize(int width, int height);
402    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
403    virtual wxSize DoGetBorderSize() const;
404    virtual void DoMoveWindow(int x, int y, int width, int height);
405    virtual void DoSetWindowVariant( wxWindowVariant variant);
406    virtual wxBorder GetDefaultBorder() const;
407    virtual wxBorder GetDefaultBorderForControl() const;
408    virtual void DoFreeze();
409    virtual void DoThaw();
410    virtual bool HasTransparentBackground();
411    virtual bool TryBefore(wxEvent& event);
412    virtual bool TryAfter(wxEvent& event);
413
414
415    public:
416
417
418    static
419    wxVisualAttributes GetClassDefaultAttributes(
420        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
421    );
422    %Docstring
423        GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes
424    %End
425    %PreMethodCode
426        if (!wxPyCheckForApp()) return NULL;
427    %End
428
429    public:
430
431
432    %Property(name=ApplyOnSelection, get=GetApplyOnSelection, set=SetApplyOnSelection)
433    %Property(name=RichTextCtrl, get=GetRichTextCtrl, set=SetRichTextCtrl)
434    %Property(name=StyleSheet, get=GetStyleSheet, set=SetStyleSheet)
435    %Property(name=StyleType, get=GetStyleType, set=SetStyleType)
436
437protected:
438    wxString OnGetItem(
439        size_t n
440    ) const;
441    %Docstring
442        OnGetItem(n) -> String
443
444        Returns the HTML for this item.
445    %End
446
447};  // end of class wxRichTextStyleListBox
448
449
450class wxRichTextStyleComboCtrl : wxComboCtrl
451{
452    %Docstring
453        RichTextStyleComboCtrl(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0)
454        RichTextStyleComboCtrl()
455
456        This is a combo control that can display the styles in a
457        wxRichTextStyleSheet, and apply the selection to an associated
458        wxRichTextCtrl.
459    %End
460    %TypeHeaderCode
461        #include <wx/richtext/richtextstyles.h>
462    %End
463
464public:
465    wxRichTextStyleComboCtrl(
466        wxWindow * parent   /TransferThis/,
467        wxWindowID id = wxID_ANY,
468        const wxPoint & pos = wxDefaultPosition,
469        const wxSize & size = wxDefaultSize,
470        long style = 0
471    );
472    %PreMethodCode
473        if (!wxPyCheckForApp()) return NULL;
474    %End
475
476    wxRichTextStyleComboCtrl();
477    %PreMethodCode
478        if (!wxPyCheckForApp()) return NULL;
479    %End
480
481    ~wxRichTextStyleComboCtrl();
482
483    bool Create(
484        wxWindow * parent   /TransferThis/,
485        wxWindowID id = wxID_ANY,
486        const wxPoint & pos = wxDefaultPosition,
487        const wxSize & size = wxDefaultSize,
488        long style = 0
489    );
490    %Docstring
491        Create(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0) -> bool
492
493        Creates the windows.
494    %End
495
496    wxRichTextCtrl * GetRichTextCtrl() const;
497    %Docstring
498        GetRichTextCtrl() -> RichTextCtrl
499
500        Returns the wxRichTextCtrl associated with this control.
501    %End
502
503    wxRichTextStyleSheet * GetStyleSheet() const;
504    %Docstring
505        GetStyleSheet() -> RichTextStyleSheet
506
507        Returns the style sheet associated with this control.
508    %End
509
510    void SetRichTextCtrl(
511        wxRichTextCtrl * ctrl
512    );
513    %Docstring
514        SetRichTextCtrl(ctrl)
515
516        Associates the control with a wxRichTextCtrl.
517    %End
518
519    void SetStyleSheet(
520        wxRichTextStyleSheet * styleSheet
521    );
522    %Docstring
523        SetStyleSheet(styleSheet)
524
525        Associates the control with a style sheet.
526    %End
527
528    void UpdateStyles();
529    %Docstring
530        UpdateStyles()
531
532        Updates the combo control from the associated style sheet.
533    %End
534
535    public:
536    virtual wxPoint GetClientAreaOrigin() const;
537    virtual bool Validate();
538    virtual bool TransferDataToWindow();
539    virtual bool TransferDataFromWindow();
540    virtual void InitDialog();
541    virtual bool AcceptsFocus() const;
542    virtual bool AcceptsFocusRecursively() const;
543    virtual bool AcceptsFocusFromKeyboard() const;
544    virtual void AddChild( wxWindowBase *child );
545    virtual void RemoveChild( wxWindowBase *child );
546    virtual void InheritAttributes();
547    virtual bool ShouldInheritColours() const;
548    virtual void OnInternalIdle();
549    virtual wxWindow *GetMainWindowOfCompositeControl();
550    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
551    virtual void SetCanFocus(bool canFocus);
552    virtual bool Destroy();
553    virtual void SetValidator( const wxValidator &validator );
554    virtual wxValidator* GetValidator();
555
556
557    protected:
558    virtual bool ProcessEvent(wxEvent & event);
559    virtual void DoEnable(bool enable);
560    virtual void DoGetPosition(int *x, int *y) const;
561    virtual void DoGetSize(int *width, int *height) const;
562    virtual void DoGetClientSize(int *width, int *height) const;
563    virtual wxSize DoGetBestSize() const;
564    virtual wxSize DoGetBestClientSize() const;
565    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
566    virtual void DoSetClientSize(int width, int height);
567    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
568    virtual wxSize DoGetBorderSize() const;
569    virtual void DoMoveWindow(int x, int y, int width, int height);
570    virtual void DoSetWindowVariant( wxWindowVariant variant);
571    virtual wxBorder GetDefaultBorder() const;
572    virtual wxBorder GetDefaultBorderForControl() const;
573    virtual void DoFreeze();
574    virtual void DoThaw();
575    virtual bool HasTransparentBackground();
576    virtual bool TryBefore(wxEvent& event);
577    virtual bool TryAfter(wxEvent& event);
578
579
580    public:
581
582
583    static
584    wxVisualAttributes GetClassDefaultAttributes(
585        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
586    );
587    %Docstring
588        GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes
589    %End
590    %PreMethodCode
591        if (!wxPyCheckForApp()) return NULL;
592    %End
593
594    public:
595
596
597    %Property(name=RichTextCtrl, get=GetRichTextCtrl, set=SetRichTextCtrl)
598    %Property(name=StyleSheet, get=GetStyleSheet, set=SetStyleSheet)
599};  // end of class wxRichTextStyleComboCtrl
600
601
602class wxRichTextStyleDefinition : wxObject   /Abstract/
603{
604    %Docstring
605        RichTextStyleDefinition(name=wx.EmptyString)
606
607        This is a base class for paragraph and character styles.
608    %End
609    %TypeHeaderCode
610        #include <wx/richtext/richtextstyles.h>
611    %End
612
613public:
614    wxRichTextStyleDefinition(
615        const wxString & name = wxEmptyString
616    );
617
618    virtual
619    ~wxRichTextStyleDefinition();
620
621    const wxRichTextAttr GetStyle() const;
622    %Docstring
623        GetStyle() -> RichTextAttr
624
625        Returns the attributes associated with this style.
626    %End
627
628    const wxString & GetBaseStyle() const;
629    %Docstring
630        GetBaseStyle() -> String
631
632        Returns the style on which this style is based.
633    %End
634
635    const wxString & GetDescription() const;
636    %Docstring
637        GetDescription() -> String
638
639        Returns the style's description.
640    %End
641
642    const wxString & GetName() const;
643    %Docstring
644        GetName() -> String
645
646        Returns the style name.
647    %End
648
649    virtual
650    wxRichTextAttr GetStyleMergedWithBase(
651        const wxRichTextStyleSheet * sheet
652    ) const;
653    %Docstring
654        GetStyleMergedWithBase(sheet) -> RichTextAttr
655
656        Returns the style attributes combined with the attributes of the
657        specified base style, if any.
658    %End
659
660    void SetBaseStyle(
661        const wxString & name
662    );
663    %Docstring
664        SetBaseStyle(name)
665
666        Sets the name of the style that this style is based on.
667    %End
668
669    void SetDescription(
670        const wxString & descr
671    );
672    %Docstring
673        SetDescription(descr)
674
675        Sets the style description.
676    %End
677
678    void SetName(
679        const wxString & name
680    );
681    %Docstring
682        SetName(name)
683
684        Sets the name of the style.
685    %End
686
687    void SetStyle(
688        const wxRichTextAttr & style
689    );
690    %Docstring
691        SetStyle(style)
692
693        Sets the attributes for this style.
694    %End
695
696    wxRichTextProperties & GetProperties();
697    %Docstring
698        GetProperties() -> RichTextProperties
699
700        Returns the definition's properties.
701    %End
702
703    void SetProperties(
704        const wxRichTextProperties & props
705    );
706    %Docstring
707        SetProperties(props)
708
709        Sets the definition's properties.
710    %End
711
712    public:
713
714
715    %Property(name=BaseStyle, get=GetBaseStyle, set=SetBaseStyle)
716    %Property(name=Description, get=GetDescription, set=SetDescription)
717    %Property(name=Name, get=GetName, set=SetName)
718    %Property(name=Properties, get=GetProperties, set=SetProperties)
719    %Property(name=Style, get=GetStyle, set=SetStyle)
720};  // end of class wxRichTextStyleDefinition
721
722
723class wxRichTextParagraphStyleDefinition : wxRichTextStyleDefinition
724{
725    %Docstring
726        RichTextParagraphStyleDefinition(name=wx.EmptyString)
727
728        This class represents a paragraph style definition, usually added to a
729        wxRichTextStyleSheet.
730    %End
731    %TypeHeaderCode
732        #include <wx/richtext/richtextstyles.h>
733    %End
734
735public:
736    wxRichTextParagraphStyleDefinition(
737        const wxString & name = wxEmptyString
738    );
739
740    virtual
741    ~wxRichTextParagraphStyleDefinition();
742
743    const wxString & GetNextStyle() const;
744    %Docstring
745        GetNextStyle() -> String
746
747        Returns the style that should normally follow this style.
748    %End
749
750    void SetNextStyle(
751        const wxString & name
752    );
753    %Docstring
754        SetNextStyle(name)
755
756        Sets the style that should normally follow this style.
757    %End
758
759    public:
760
761
762    %Property(name=NextStyle, get=GetNextStyle, set=SetNextStyle)
763};  // end of class wxRichTextParagraphStyleDefinition
764
765
766class wxRichTextCharacterStyleDefinition : wxRichTextStyleDefinition
767{
768    %Docstring
769        RichTextCharacterStyleDefinition(name=wx.EmptyString)
770
771        This class represents a character style definition, usually added to a
772        wxRichTextStyleSheet.
773    %End
774    %TypeHeaderCode
775        #include <wx/richtext/richtextstyles.h>
776    %End
777
778public:
779    wxRichTextCharacterStyleDefinition(
780        const wxString & name = wxEmptyString
781    );
782
783    virtual
784    ~wxRichTextCharacterStyleDefinition();
785
786};  // end of class wxRichTextCharacterStyleDefinition
787
788
789class wxRichTextListStyleDefinition : wxRichTextParagraphStyleDefinition
790{
791    %Docstring
792        RichTextListStyleDefinition(name=wx.EmptyString)
793
794        This class represents a list style definition, usually added to a
795        wxRichTextStyleSheet.
796    %End
797    %TypeHeaderCode
798        #include <wx/richtext/richtextstyles.h>
799    %End
800
801public:
802    wxRichTextListStyleDefinition(
803        const wxString & name = wxEmptyString
804    );
805
806    virtual
807    ~wxRichTextListStyleDefinition();
808
809    wxRichTextAttr CombineWithParagraphStyle(
810        int indent,
811        const wxRichTextAttr & paraStyle,
812        wxRichTextStyleSheet * styleSheet = NULL
813    );
814    %Docstring
815        CombineWithParagraphStyle(indent, paraStyle, styleSheet=None) -> RichTextAttr
816
817        This function combines the given paragraph style with the list style's
818        base attributes and level style matching the given indent, returning
819        the combined attributes.
820    %End
821
822    int FindLevelForIndent(
823        int indent
824    ) const;
825    %Docstring
826        FindLevelForIndent(indent) -> int
827
828        This function finds the level (from 0 to 9) whose indentation
829        attribute mostly closely matches indent (expressed in tenths of a
830        millimetre).
831    %End
832
833    wxRichTextAttr GetCombinedStyle(
834        int indent,
835        wxRichTextStyleSheet * styleSheet = NULL
836    );
837    %Docstring
838        GetCombinedStyle(indent, styleSheet=None) -> RichTextAttr
839
840        This function combines the list style's base attributes and the level
841        style matching the given indent, returning the combined attributes.
842    %End
843
844    wxRichTextAttr GetCombinedStyleForLevel(
845        int level,
846        wxRichTextStyleSheet * styleSheet = NULL
847    );
848    %Docstring
849        GetCombinedStyleForLevel(level, styleSheet=None) -> RichTextAttr
850
851        This function combines the list style's base attributes and the style
852        for the specified level, returning the combined attributes.
853    %End
854
855    const wxRichTextAttr * GetLevelAttributes(
856        int level
857    ) const;
858    %Docstring
859        GetLevelAttributes(level) -> RichTextAttr
860
861        Returns the style for the given level.
862    %End
863
864    int GetLevelCount() const;
865    %Docstring
866        GetLevelCount() -> int
867
868        Returns the number of levels.
869    %End
870
871    bool IsNumbered(
872        int level
873    ) const;
874    %Docstring
875        IsNumbered(level) -> bool
876
877        Returns true if the given level has numbered list attributes.
878    %End
879
880    void SetLevelAttributes(
881        int level,
882        const wxRichTextAttr & attr
883    );
884    %Docstring
885        SetLevelAttributes(level, attr)
886
887        Sets the style for the given level.
888    %End
889
890    public:
891
892
893    %Property(name=LevelCount, get=GetLevelCount)
894};  // end of class wxRichTextListStyleDefinition
895
896
897class wxRichTextStyleSheet : wxObject
898{
899    %Docstring
900        RichTextStyleSheet()
901
902        A style sheet contains named paragraph and character styles that make
903        it easy for a user to apply combinations of attributes to a
904        wxRichTextCtrl.
905    %End
906    %TypeHeaderCode
907        #include <wx/richtext/richtextstyles.h>
908    %End
909
910public:
911    wxRichTextStyleSheet();
912
913    virtual
914    ~wxRichTextStyleSheet();
915
916    bool AddCharacterStyle(
917        wxRichTextCharacterStyleDefinition * styleDef   /Transfer/
918    );
919    %Docstring
920        AddCharacterStyle(styleDef) -> bool
921
922        Adds a definition to the character style list.
923    %End
924
925    bool AddListStyle(
926        wxRichTextListStyleDefinition * styleDef   /Transfer/
927    );
928    %Docstring
929        AddListStyle(styleDef) -> bool
930
931        Adds a definition to the list style list.
932    %End
933
934    bool AddParagraphStyle(
935        wxRichTextParagraphStyleDefinition * styleDef   /Transfer/
936    );
937    %Docstring
938        AddParagraphStyle(styleDef) -> bool
939
940        Adds a definition to the paragraph style list.
941    %End
942
943    bool AddStyle(
944        wxRichTextStyleDefinition * styleDef   /Transfer/
945    );
946    %Docstring
947        AddStyle(styleDef) -> bool
948
949        Adds a definition to the appropriate style list.
950    %End
951
952    void DeleteStyles();
953    %Docstring
954        DeleteStyles()
955
956        Deletes all styles.
957    %End
958
959    wxRichTextCharacterStyleDefinition * FindCharacterStyle(
960        const wxString & name,
961        bool recurse = true
962    ) const;
963    %Docstring
964        FindCharacterStyle(name, recurse=True) -> RichTextCharacterStyleDefinition
965
966        Finds a character definition by name.
967    %End
968
969    wxRichTextListStyleDefinition * FindListStyle(
970        const wxString & name,
971        bool recurse = true
972    ) const;
973    %Docstring
974        FindListStyle(name, recurse=True) -> RichTextListStyleDefinition
975
976        Finds a list definition by name.
977    %End
978
979    wxRichTextParagraphStyleDefinition * FindParagraphStyle(
980        const wxString & name,
981        bool recurse = true
982    ) const;
983    %Docstring
984        FindParagraphStyle(name, recurse=True) -> RichTextParagraphStyleDefinition
985
986        Finds a paragraph definition by name.
987    %End
988
989    wxRichTextStyleDefinition * FindStyle(
990        const wxString & name
991    ) const;
992    %Docstring
993        FindStyle(name) -> RichTextStyleDefinition
994
995        Finds a style definition by name.
996    %End
997
998    wxRichTextCharacterStyleDefinition * GetCharacterStyle(
999        size_t n
1000    ) const;
1001    %Docstring
1002        GetCharacterStyle(n) -> RichTextCharacterStyleDefinition
1003
1004        Returns the nth character style.
1005    %End
1006
1007    size_t GetCharacterStyleCount() const;
1008    %Docstring
1009        GetCharacterStyleCount() -> size_t
1010
1011        Returns the number of character styles.
1012    %End
1013
1014    const wxString & GetDescription() const;
1015    %Docstring
1016        GetDescription() -> String
1017
1018        Returns the style sheet's description.
1019    %End
1020
1021    wxRichTextListStyleDefinition * GetListStyle(
1022        size_t n
1023    ) const;
1024    %Docstring
1025        GetListStyle(n) -> RichTextListStyleDefinition
1026
1027        Returns the nth list style.
1028    %End
1029
1030    size_t GetListStyleCount() const;
1031    %Docstring
1032        GetListStyleCount() -> size_t
1033
1034        Returns the number of list styles.
1035    %End
1036
1037    const wxString & GetName() const;
1038    %Docstring
1039        GetName() -> String
1040
1041        Returns the style sheet's name.
1042    %End
1043
1044    wxRichTextParagraphStyleDefinition * GetParagraphStyle(
1045        size_t n
1046    ) const;
1047    %Docstring
1048        GetParagraphStyle(n) -> RichTextParagraphStyleDefinition
1049
1050        Returns the nth paragraph style.
1051    %End
1052
1053    size_t GetParagraphStyleCount() const;
1054    %Docstring
1055        GetParagraphStyleCount() -> size_t
1056
1057        Returns the number of paragraph styles.
1058    %End
1059
1060    bool RemoveCharacterStyle(
1061        wxRichTextStyleDefinition * styleDef,
1062        bool deleteStyle = false
1063    );
1064    %Docstring
1065        RemoveCharacterStyle(styleDef, deleteStyle=False) -> bool
1066
1067        Removes a character style.
1068    %End
1069
1070    bool RemoveListStyle(
1071        wxRichTextStyleDefinition * styleDef,
1072        bool deleteStyle = false
1073    );
1074    %Docstring
1075        RemoveListStyle(styleDef, deleteStyle=False) -> bool
1076
1077        Removes a list style.
1078    %End
1079
1080    bool RemoveParagraphStyle(
1081        wxRichTextStyleDefinition * styleDef,
1082        bool deleteStyle = false
1083    );
1084    %Docstring
1085        RemoveParagraphStyle(styleDef, deleteStyle=False) -> bool
1086
1087        Removes a paragraph style.
1088    %End
1089
1090    bool RemoveStyle(
1091        wxRichTextStyleDefinition * styleDef,
1092        bool deleteStyle = false
1093    );
1094    %Docstring
1095        RemoveStyle(styleDef, deleteStyle=False) -> bool
1096
1097        Removes a style.
1098    %End
1099
1100    void SetDescription(
1101        const wxString & descr
1102    );
1103    %Docstring
1104        SetDescription(descr)
1105
1106        Sets the style sheet's description.
1107    %End
1108
1109    void SetName(
1110        const wxString & name
1111    );
1112    %Docstring
1113        SetName(name)
1114
1115        Sets the style sheet's name.
1116    %End
1117
1118    wxRichTextProperties & GetProperties();
1119    %Docstring
1120        GetProperties() -> RichTextProperties
1121
1122        Returns the sheet's properties.
1123    %End
1124
1125    void SetProperties(
1126        const wxRichTextProperties & props
1127    );
1128    %Docstring
1129        SetProperties(props)
1130
1131        Sets the sheet's properties.
1132    %End
1133
1134    public:
1135
1136
1137    %Property(name=CharacterStyleCount, get=GetCharacterStyleCount)
1138    %Property(name=Description, get=GetDescription, set=SetDescription)
1139    %Property(name=ListStyleCount, get=GetListStyleCount)
1140    %Property(name=Name, get=GetName, set=SetName)
1141    %Property(name=ParagraphStyleCount, get=GetParagraphStyleCount)
1142    %Property(name=Properties, get=GetProperties, set=SetProperties)
1143};  // end of class wxRichTextStyleSheet
1144
1145
1146
1147//---------------------------------------------------------------------------
1148
1149