1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/msw/dcprint.h
3 // Purpose:     wxPrinterDC class
4 // Author:      Julian Smart
5 // Modified by:
6 // Created:     01/02/97
7 // RCS-ID:      $Id: dcprint.h 42522 2006-10-27 13:07:40Z JS $
8 // Copyright:   (c) Julian Smart
9 // Licence:     wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef _WX_MSW_DCPRINT_H_
13 #define _WX_MSW_DCPRINT_H_
14 
15 #if wxUSE_PRINTING_ARCHITECTURE
16 
17 #include "wx/dc.h"
18 #include "wx/cmndata.h"
19 
20 class WXDLLEXPORT wxPrinterDC : public wxDC
21 {
22 public:
23     // Create a printer DC (obsolete function: use wxPrintData version now)
24     wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = true, int orientation = wxPORTRAIT);
25 
26     // Create from print data
27     wxPrinterDC(const wxPrintData& data);
28 
29     wxPrinterDC(WXHDC theDC);
30 
31     // override some base class virtuals
32     virtual bool StartDoc(const wxString& message);
33     virtual void EndDoc();
34     virtual void StartPage();
35     virtual void EndPage();
36 
37     wxRect GetPaperRect();
38 
39 protected:
40     virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
41                               bool useMask = false);
42     virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
43                         wxCoord width, wxCoord height,
44                         wxDC *source, wxCoord xsrc, wxCoord ysrc,
45                         int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
DoGetSize(int * w,int * h)46     virtual void DoGetSize(int *w, int *h) const
47     {
48         GetDeviceSize(w, h);
49     }
50 
51 
52     // init the dc
53     void Init();
54 
55     wxPrintData m_printData;
56 
57 private:
58     DECLARE_DYNAMIC_CLASS_NO_COPY(wxPrinterDC)
59 };
60 
61 // Gets an HDC for the default printer configuration
62 // WXHDC WXDLLEXPORT wxGetPrinterDC(int orientation);
63 
64 // Gets an HDC for the specified printer configuration
65 WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& data);
66 
67 #endif // wxUSE_PRINTING_ARCHITECTURE
68 
69 #endif // _WX_MSW_DCPRINT_H_
70 
71