1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 #ifndef CBEDITORPRINTOUT_H
7 #define CBEDITORPRINTOUT_H
8 
9 #include <wx/print.h>
10 
11 class cbStyledTextCtrl;
12 
13 class cbEditorPrintout : public wxPrintout
14 {
15     public:
16         cbEditorPrintout(const wxString& title, cbStyledTextCtrl* control, bool selectionOnly);
17         ~cbEditorPrintout() override;
18         bool OnPrintPage(int page) override;
19         bool HasPage(int page) override;
20         void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) override;
21         bool OnBeginDocument(int startPage, int endPage) override;
22     protected:
23         bool ScaleDC(wxDC *dc);
24         cbStyledTextCtrl* m_TextControl;
25         wxRect m_pageRect;
26         wxRect m_printRect;
27         int m_printed;
28         int m_SelStart;
29         int m_SelEnd;
30         wxArrayInt* m_pPageSelStart;
31 };
32 
33 #endif // CBEDITORPRINTOUT_H
34