1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for wx????
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
20 #include "wx/wxPython/printfw.h"
24 MAKE_CONST_WXSTRING2(PrintoutTitleStr, wxT("Printout"));
25 MAKE_CONST_WXSTRING2(PreviewCanvasNameStr, wxT("previewcanvas"));
28 //---------------------------------------------------------------------------
32 wxPRINT_MODE_NONE = 0,
33 wxPRINT_MODE_PREVIEW = 1, // Preview in external application
34 wxPRINT_MODE_FILE = 2, // Print to file
35 wxPRINT_MODE_PRINTER = 3, // Send to printer
36 wxPRINT_MODE_STREAM = 4 // Send postscript data into a stream
53 wxPRINTBIN_LARGECAPACITY,
55 wxPRINTBIN_FORMSOURCE,
61 class wxPrintData : public wxObject {
63 %nokwargs wxPrintData;
65 wxPrintData(const wxPrintData& data); // for making copies
75 const wxString& GetPrinterName();
77 wxDuplexMode GetDuplex();
78 wxPaperSize GetPaperId();
79 const wxSize& GetPaperSize();
83 wxPrintMode GetPrintMode() const;
85 void SetNoCopies(int v);
86 void SetCollate(bool flag);
87 void SetOrientation(int orient);
89 void SetPrinterName(const wxString& name);
90 void SetColour(bool colour);
91 void SetDuplex(wxDuplexMode duplex);
92 void SetPaperId(wxPaperSize sizeId);
93 void SetPaperSize(const wxSize& sz);
94 void SetQuality(int quality);
95 void SetBin(wxPrintBin bin);
96 void SetPrintMode(wxPrintMode printMode);
98 wxString GetFilename() const;
99 void SetFilename( const wxString &filename );
101 %pythoncode { def __nonzero__(self): return self.Ok() }
104 // NOTE: These are now inside of #if WXWIN_COMPATIBILITY_2_4, so be
105 // prepared to remove them...
107 // PostScript-specific data
108 const wxString& GetPrinterCommand();
109 const wxString& GetPrinterOptions();
110 const wxString& GetPreviewCommand();
111 const wxString& GetFontMetricPath();
112 double GetPrinterScaleX();
113 double GetPrinterScaleY();
114 long GetPrinterTranslateX();
115 long GetPrinterTranslateY();
116 void SetPrinterCommand(const wxString& command);
117 void SetPrinterOptions(const wxString& options);
118 void SetPreviewCommand(const wxString& command);
119 void SetFontMetricPath(const wxString& path);
120 void SetPrinterScaleX(double x);
121 void SetPrinterScaleY(double y);
122 void SetPrinterScaling(double x, double y);
123 void SetPrinterTranslateX(long x);
124 void SetPrinterTranslateY(long y);
125 void SetPrinterTranslation(long x, long y);
129 //---------------------------------------------------------------------------
131 class wxPageSetupDialogData : public wxObject {
133 %nokwargs wxPageSetupDialogData;
134 wxPageSetupDialogData();
135 wxPageSetupDialogData(const wxPageSetupDialogData& data); // for making copies
136 ~wxPageSetupDialogData();
138 void EnableHelp(bool flag);
139 void EnableMargins(bool flag);
140 void EnableOrientation(bool flag);
141 void EnablePaper(bool flag);
142 void EnablePrinter(bool flag);
143 bool GetDefaultMinMargins();
144 bool GetEnableMargins();
145 bool GetEnableOrientation();
146 bool GetEnablePaper();
147 bool GetEnablePrinter();
148 bool GetEnableHelp();
149 bool GetDefaultInfo();
150 wxPoint GetMarginTopLeft();
151 wxPoint GetMarginBottomRight();
152 wxPoint GetMinMarginTopLeft();
153 wxPoint GetMinMarginBottomRight();
154 wxPaperSize GetPaperId();
155 wxSize GetPaperSize();
157 wxPrintData& GetPrintData();
159 // %new wxPrintData* GetPrintData() {
160 // return new wxPrintData(self->GetPrintData()); // force a copy
166 void SetDefaultInfo(bool flag);
167 void SetDefaultMinMargins(bool flag);
168 void SetMarginTopLeft(const wxPoint& pt);
169 void SetMarginBottomRight(const wxPoint& pt);
170 void SetMinMarginTopLeft(const wxPoint& pt);
171 void SetMinMarginBottomRight(const wxPoint& pt);
172 void SetPaperId(wxPaperSize id);
173 void SetPaperSize(const wxSize& size);
174 void SetPrintData(const wxPrintData& printData);
176 %pythoncode { def __nonzero__(self): return self.Ok() }
181 MustHaveApp(wxPageSetupDialog);
183 class wxPageSetupDialog : public wxDialog {
185 %pythonAppend wxPageSetupDialog "self._setOORInfo(self)"
187 wxPageSetupDialog(wxWindow* parent, wxPageSetupDialogData* data = NULL);
189 wxPageSetupDialogData& GetPageSetupData();
193 //---------------------------------------------------------------------------
196 class wxPrintDialogData : public wxObject {
198 %nokwargs wxPrintDialogData;
200 wxPrintDialogData(const wxPrintData& printData); // for making copies
201 ~wxPrintDialogData();
203 int GetFromPage() const;
204 int GetToPage() const;
205 int GetMinPage() const;
206 int GetMaxPage() const;
207 int GetNoCopies() const;
208 bool GetAllPages() const;
209 bool GetSelection() const;
210 bool GetCollate() const;
211 bool GetPrintToFile() const;
213 // WXWIN_COMPATIBILITY_2_4
214 bool GetSetupDialog() const;
215 void SetSetupDialog(bool flag);
217 void SetFromPage(int v);
218 void SetToPage(int v);
219 void SetMinPage(int v);
220 void SetMaxPage(int v);
221 void SetNoCopies(int v);
222 void SetAllPages(bool flag);
223 void SetSelection(bool flag);
224 void SetCollate(bool flag);
225 void SetPrintToFile(bool flag);
227 void EnablePrintToFile(bool flag);
228 void EnableSelection(bool flag);
229 void EnablePageNumbers(bool flag);
230 void EnableHelp(bool flag);
232 bool GetEnablePrintToFile() const;
233 bool GetEnableSelection() const;
234 bool GetEnablePageNumbers() const;
235 bool GetEnableHelp() const;
237 // Is this data OK for showing the print dialog?
241 wxPrintData& GetPrintData();
242 void SetPrintData(const wxPrintData& printData);
244 %pythoncode { def __nonzero__(self): return self.Ok() }
248 MustHaveApp(wxPrintDialog);
250 class wxPrintDialog : public wxDialog {
252 %pythonAppend wxPrintDialog "self._setOORInfo(self)"
254 wxPrintDialog(wxWindow* parent, wxPrintDialogData* data = NULL);
256 // TODO?: wxPrintDialog(wxWindow *parent, wxPrintData* data);
258 virtual int ShowModal();
260 virtual wxPrintDialogData& GetPrintDialogData();
261 virtual wxPrintData& GetPrintData();
263 %newobject GetPrintDC;
264 virtual wxDC *GetPrintDC();
269 //---------------------------------------------------------------------------
270 //---------------------------------------------------------------------------
275 wxPRINTER_NO_ERROR = 0,
281 MustHaveApp(wxPrinter);
283 class wxPrinter : public wxObject {
285 wxPrinter(wxPrintDialogData* data = NULL);
288 virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout);
289 virtual void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message);
291 virtual bool Setup(wxWindow *parent);
292 virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true);
293 virtual wxDC* PrintDialog(wxWindow *parent);
295 virtual wxPrintDialogData& GetPrintDialogData() const;
298 static wxPrinterError GetLastError();
302 //---------------------------------------------------------------------------
303 // Custom wxPrintout class that knows how to call python
307 // Since this one would be tough and ugly to do with the Macros...
308 void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
312 bool blocked = wxPyBeginBlockThreads();
313 if ((found = wxPyCBH_findCallback(m_myInst, "GetPageInfo"))) {
314 PyObject* result = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
315 if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
318 val = PyTuple_GetItem(result, 0);
319 if (PyInt_Check(val)) *minPage = PyInt_AsLong(val);
322 val = PyTuple_GetItem(result, 1);
323 if (PyInt_Check(val)) *maxPage = PyInt_AsLong(val);
326 val = PyTuple_GetItem(result, 2);
327 if (PyInt_Check(val)) *pageFrom = PyInt_AsLong(val);
330 val = PyTuple_GetItem(result, 3);
331 if (PyInt_Check(val)) *pageTo = PyInt_AsLong(val);
338 PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers.");
343 wxPyEndBlockThreads(blocked);
345 wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
348 void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
349 wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
353 IMP_PYCALLBACK_BOOL_INTINT(wxPyPrintout, wxPrintout, OnBeginDocument);
354 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnEndDocument);
355 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnBeginPrinting);
356 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnEndPrinting);
357 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnPreparePrinting);
358 IMP_PYCALLBACK_BOOL_INT_pure(wxPyPrintout, wxPrintout, OnPrintPage);
359 IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage);
365 MustHaveApp(wxPyPrintout);
367 // Now define the custom class for SWIGging
368 %name(Printout) class wxPyPrintout : public wxObject {
370 %pythonAppend wxPyPrintout "self._setCallbackInfo(self, Printout)"
372 wxPyPrintout(const wxString& title = wxPyPrintoutTitleStr);
373 //~wxPyPrintout(); wxPrintPreview object takes ownership...
375 void _setCallbackInfo(PyObject* self, PyObject* _class);
378 wxString GetTitle() const;
380 void SetDC(wxDC *dc);
382 void SetPageSizePixels(int w, int h);
384 void, GetPageSizePixels(int *OUTPUT, int *OUTPUT),
385 "GetPageSizePixels() -> (w, h)");
387 void SetPageSizeMM(int w, int h);
389 void, GetPageSizeMM(int *OUTPUT, int *OUTPUT),
390 "GetPageSizeMM() -> (w, h)");
392 void SetPPIScreen(int x, int y);
394 void, GetPPIScreen(int *OUTPUT, int *OUTPUT),
395 "GetPPIScreen() -> (x,y)");
397 void SetPPIPrinter(int x, int y);
399 void, GetPPIPrinter(int *OUTPUT, int *OUTPUT),
400 "GetPPIPrinter() -> (x,y)");
403 void SetIsPreview(bool p);
406 bool base_OnBeginDocument(int startPage, int endPage);
407 void base_OnEndDocument();
408 void base_OnBeginPrinting();
409 void base_OnEndPrinting();
410 void base_OnPreparePrinting();
411 bool base_HasPage(int page);
413 void, base_GetPageInfo(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
414 "base_GetPageInfo() -> (minPage, maxPage, pageFrom, pageTo)");
417 //---------------------------------------------------------------------------
421 MustHaveApp(wxPreviewCanvas);
423 class wxPreviewCanvas: public wxScrolledWindow
426 %pythonAppend wxPreviewCanvas "self._setOORInfo(self)"
428 wxPreviewCanvas(wxPrintPreview *preview,
430 const wxPoint& pos = wxDefaultPosition,
431 const wxSize& size = wxDefaultSize,
433 const wxString& name = wxPyPreviewCanvasNameStr);
437 MustHaveApp(wxPreviewFrame);
439 class wxPreviewFrame : public wxFrame {
441 %pythonAppend wxPreviewFrame "self._setOORInfo(self)"
443 wxPreviewFrame(wxPrintPreview* preview, wxFrame* parent, const wxString& title,
444 const wxPoint& pos = wxDefaultPosition,
445 const wxSize& size = wxDefaultSize,
446 long style = wxDEFAULT_FRAME_STYLE,
447 const wxString& name = wxPyFrameNameStr);
450 void CreateControlBar();
453 wxPreviewControlBar* GetControlBar() const;
470 wxID_PREVIEW_PREVIOUS,
478 MustHaveApp(wxPreviewControlBar);
480 class wxPreviewControlBar: public wxPanel
483 %pythonAppend wxPreviewControlBar "self._setOORInfo(self)"
485 wxPreviewControlBar(wxPrintPreview *preview,
488 const wxPoint& pos = wxDefaultPosition,
489 const wxSize& size = wxDefaultSize,
490 long style = wxTAB_TRAVERSAL,
491 const wxString& name = wxPyPanelNameStr);
493 int GetZoomControl();
494 void SetZoomControl(int zoom);
495 wxPrintPreview* GetPrintPreview();
506 //---------------------------------------------------------------------------
508 MustHaveApp(wxPrintPreview);
510 class wxPrintPreview : public wxObject {
512 %nokwargs wxPrintPreview;
513 wxPrintPreview(wxPyPrintout* printout,
514 wxPyPrintout* printoutForPrinting,
515 wxPrintDialogData *data=NULL);
516 wxPrintPreview(wxPyPrintout* printout,
517 wxPyPrintout* printoutForPrinting,
520 virtual bool SetCurrentPage(int pageNum);
521 int GetCurrentPage();
523 void SetPrintout(wxPyPrintout *printout);
524 wxPyPrintout *GetPrintout();
525 wxPyPrintout *GetPrintoutForPrinting();
527 void SetFrame(wxFrame *frame);
528 void SetCanvas(wxPreviewCanvas *canvas);
530 virtual wxFrame *GetFrame();
531 virtual wxPreviewCanvas *GetCanvas();
533 // The preview canvas should call this from OnPaint
534 virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc);
536 // This draws a blank page onto the preview canvas
537 virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc);
539 // This is called by wxPrintPreview to render a page into a wxMemoryDC.
540 virtual bool RenderPage(int pageNum);
542 // Adjusts the scrollbars for the current scale
543 virtual void AdjustScrollbars(wxPreviewCanvas *canvas);
545 wxPrintDialogData& GetPrintDialogData();
547 virtual void SetZoom(int percent);
556 virtual bool Print(bool interactive);
557 virtual void DetermineScaling();
559 %pythoncode { def __nonzero__(self): return self.Ok() }
564 //---------------------------------------------------------------------------
566 // Python-derivable versions of the above preview classes
570 #define DEC_PYCALLBACK_BOOL_PREWINDC(CBNAME) \
571 bool CBNAME(wxPreviewCanvas* a, wxDC& b); \
572 bool base_##CBNAME(wxPreviewCanvas* a, wxDC& b)
575 #define IMP_PYCALLBACK_BOOL_PREWINDC(CLASS, PCLASS, CBNAME) \
576 bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) { \
579 bool blocked = wxPyBeginBlockThreads(); \
580 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
581 PyObject* win = wxPyMake_wxObject(a,false); \
582 PyObject* dc = wxPyMake_wxObject(&b,false); \
583 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", win, dc)); \
587 wxPyEndBlockThreads(blocked); \
589 rval = PCLASS::CBNAME(a, b); \
592 bool CLASS::base_##CBNAME(wxPreviewCanvas* a, wxDC& b) { \
593 return PCLASS::CBNAME(a, b); \
599 class wxPyPrintPreview : public wxPrintPreview
601 DECLARE_CLASS(wxPyPrintPreview)
603 wxPyPrintPreview(wxPyPrintout* printout,
604 wxPyPrintout* printoutForPrinting,
605 wxPrintDialogData* data=NULL)
606 : wxPrintPreview(printout, printoutForPrinting, data)
608 wxPyPrintPreview(wxPyPrintout* printout,
609 wxPyPrintout* printoutForPrinting,
610 wxPrintData* data=NULL)
611 : wxPrintPreview(printout, printoutForPrinting, data)
614 DEC_PYCALLBACK_BOOL_INT(SetCurrentPage);
615 DEC_PYCALLBACK_BOOL_PREWINDC(PaintPage);
616 DEC_PYCALLBACK_BOOL_PREWINDC(DrawBlankPage);
617 DEC_PYCALLBACK_BOOL_INT(RenderPage);
618 DEC_PYCALLBACK_VOID_INT(SetZoom);
619 DEC_PYCALLBACK_BOOL_BOOL(Print);
620 DEC_PYCALLBACK_VOID_(DetermineScaling);
625 // Stupid renamed classes... Fix this in 2.5...
626 #if defined(__WXMSW__)
627 IMPLEMENT_CLASS( wxPyPrintPreview, wxWindowsPrintPreview );
628 #elif defined(__WXMAC__)
629 IMPLEMENT_CLASS( wxPyPrintPreview, wxMacPrintPreview );
631 IMPLEMENT_CLASS( wxPyPrintPreview, wxPostScriptPrintPreview );
634 IMP_PYCALLBACK_BOOL_INT (wxPyPrintPreview, wxPrintPreview, SetCurrentPage);
635 IMP_PYCALLBACK_BOOL_PREWINDC(wxPyPrintPreview, wxPrintPreview, PaintPage);
636 IMP_PYCALLBACK_BOOL_PREWINDC(wxPyPrintPreview, wxPrintPreview, DrawBlankPage);
637 IMP_PYCALLBACK_BOOL_INT (wxPyPrintPreview, wxPrintPreview, RenderPage);
638 IMP_PYCALLBACK_VOID_INT (wxPyPrintPreview, wxPrintPreview, SetZoom);
639 IMP_PYCALLBACK_BOOL_BOOL (wxPyPrintPreview, wxPrintPreview, Print);
640 IMP_PYCALLBACK_VOID_ (wxPyPrintPreview, wxPrintPreview, DetermineScaling);
644 MustHaveApp(wxPyPrintPreview);
646 class wxPyPrintPreview : public wxPrintPreview
649 %pythonAppend wxPyPrintPreview "self._setCallbackInfo(self, PyPrintPreview)"
650 %nokwargs wxPyPrintPreview;
651 wxPyPrintPreview(wxPyPrintout* printout,
652 wxPyPrintout* printoutForPrinting,
653 wxPrintDialogData* data=NULL);
654 wxPyPrintPreview(wxPyPrintout* printout,
655 wxPyPrintout* printoutForPrinting,
658 void _setCallbackInfo(PyObject* self, PyObject* _class);
660 bool base_SetCurrentPage(int pageNum);
661 bool base_PaintPage(wxPreviewCanvas *canvas, wxDC& dc);
662 bool base_DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc);
663 bool base_RenderPage(int pageNum);
664 void base_SetZoom(int percent);
665 bool base_Print(bool interactive);
666 void base_DetermineScaling();
673 class wxPyPreviewFrame : public wxPreviewFrame
675 DECLARE_CLASS(wxPyPreviewFrame);
677 wxPyPreviewFrame(wxPrintPreview* preview, wxFrame* parent,
678 const wxString& title,
679 const wxPoint& pos = wxDefaultPosition,
680 const wxSize& size = wxDefaultSize,
681 long style = wxDEFAULT_FRAME_STYLE,
682 const wxString& name = wxPyFrameNameStr)
683 : wxPreviewFrame(preview, parent, title, pos, size, style, name)
686 void SetPreviewCanvas(wxPreviewCanvas* canvas) { m_previewCanvas = canvas; }
687 void SetControlBar(wxPreviewControlBar* bar) { m_controlBar = bar; }
689 DEC_PYCALLBACK_VOID_(Initialize);
690 DEC_PYCALLBACK_VOID_(CreateCanvas);
691 DEC_PYCALLBACK_VOID_(CreateControlBar);
696 IMPLEMENT_CLASS(wxPyPreviewFrame, wxPreviewFrame);
698 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, Initialize);
699 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateCanvas);
700 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateControlBar);
704 MustHaveApp(wxPyPreviewFrame);
706 class wxPyPreviewFrame : public wxPreviewFrame
709 %pythonAppend wxPyPreviewFrame "self._setCallbackInfo(self, PyPreviewFrame); self._setOORInfo(self)"
711 wxPyPreviewFrame(wxPrintPreview* preview, wxFrame* parent,
712 const wxString& title,
713 const wxPoint& pos = wxDefaultPosition,
714 const wxSize& size = wxDefaultSize,
715 long style = wxDEFAULT_FRAME_STYLE,
716 const wxString& name = wxPyFrameNameStr);
718 void _setCallbackInfo(PyObject* self, PyObject* _class);
720 void SetPreviewCanvas(wxPreviewCanvas* canvas);
721 void SetControlBar(wxPreviewControlBar* bar);
723 void base_Initialize();
724 void base_CreateCanvas();
725 void base_CreateControlBar();
732 class wxPyPreviewControlBar : public wxPreviewControlBar
734 DECLARE_CLASS(wxPyPreviewControlBar);
736 wxPyPreviewControlBar(wxPrintPreview *preview,
739 const wxPoint& pos = wxDefaultPosition,
740 const wxSize& size = wxDefaultSize,
742 const wxString& name = wxPyPanelNameStr)
743 : wxPreviewControlBar(preview, buttons, parent, pos, size, style, name)
746 void SetPrintPreview(wxPrintPreview* preview) { m_printPreview = preview; }
748 DEC_PYCALLBACK_VOID_(CreateButtons);
749 DEC_PYCALLBACK_VOID_INT(SetZoomControl);
754 IMPLEMENT_CLASS(wxPyPreviewControlBar, wxPreviewControlBar);
755 IMP_PYCALLBACK_VOID_(wxPyPreviewControlBar, wxPreviewControlBar, CreateButtons);
756 IMP_PYCALLBACK_VOID_INT(wxPyPreviewControlBar, wxPreviewControlBar, SetZoomControl);
760 MustHaveApp(wxPyPreviewControlBar);
762 class wxPyPreviewControlBar : public wxPreviewControlBar
765 %pythonAppend wxPyPreviewControlBar "self._setCallbackInfo(self, PyPreviewControlBar); self._setOORInfo(self)"
767 wxPyPreviewControlBar(wxPrintPreview *preview,
770 const wxPoint& pos = wxDefaultPosition,
771 const wxSize& size = wxDefaultSize,
773 const wxString& name = wxPyPanelNameStr);
775 void _setCallbackInfo(PyObject* self, PyObject* _class);
777 void SetPrintPreview(wxPrintPreview* preview);
779 void base_CreateButtons();
780 void base_SetZoomControl(int zoom);
783 //---------------------------------------------------------------------------
785 //---------------------------------------------------------------------------
790 // wxPrintFactory() {} *** It's an ABC
791 // virtual ~wxPrintFactory();
793 virtual wxPrinterBase *CreatePrinter( wxPrintDialogData* data );
795 %nokwargs CreatePrintPreview;
796 virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
797 wxPrintout *printout = NULL,
798 wxPrintDialogData *data = NULL );
799 virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
800 wxPrintout *printout,
803 %nokwargs CreatePrintDialog;
804 virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
805 wxPrintDialogData *data = NULL );
806 virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
809 // What to do and what to show in the wxPrintDialog
810 // a) Use the generic print setup dialog or a native one?
811 virtual bool HasPrintSetupDialog();
812 virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
814 // b) Provide the "print to file" option ourselves or via print setup?
815 virtual bool HasOwnPrintToFile();
817 // c) Show current printer
818 virtual bool HasPrinterLine();
819 virtual wxString CreatePrinterLine();
821 // d) Show Status line for current printer?
822 virtual bool HasStatusLine();
823 virtual wxString CreateStatusLine();
826 virtual wxPrintNativeDataBase *CreatePrintNativeData();
828 static void SetPrintFactory( wxPrintFactory *factory );
829 static wxPrintFactory *GetFactory();
830 //static wxPrintFactory *m_factory;
833 // class wxNativePrintFactory: public wxPrintFactory
836 // virtual wxPrinterBase *CreatePrinter( wxPrintDialogData *data );
838 // virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
839 // wxPrintout *printout = NULL,
840 // wxPrintDialogData *data = NULL );
841 // virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
842 // wxPrintout *printout,
843 // wxPrintData *data );
845 // virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
846 // wxPrintDialogData *data = NULL );
847 // virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
848 // wxPrintData *data );
850 // virtual bool HasPrintSetupDialog();
851 // virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
852 // virtual bool HasOwnPrintToFile();
853 // virtual bool HasPrinterLine();
854 // virtual wxString CreatePrinterLine();
855 // virtual bool HasStatusLine();
856 // virtual wxString CreateStatusLine();
858 // virtual wxPrintNativeDataBase *CreatePrintNativeData();
862 class wxPrintNativeDataBase: public wxObject
865 wxPrintNativeDataBase();
866 virtual ~wxPrintNativeDataBase() {}
868 virtual bool TransferTo( wxPrintData &data ) = 0;
869 virtual bool TransferFrom( const wxPrintData &data ) = 0;
871 virtual bool Ok() const = 0;
878 //---------------------------------------------------------------------------
879 //---------------------------------------------------------------------------
881 wxPyPtrTypeMap_Add("wxPrintout", "wxPyPrintout");
883 //---------------------------------------------------------------------------