1// qprinter.sip generated by MetaSIP
2//
3// This file is part of the QtPrintSupport Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23%If (PyQt_Printer)
24
25class QPrinter : QPagedPaintDevice
26{
27%TypeHeaderCode
28#include <qprinter.h>
29%End
30
31public:
32    enum PrinterMode
33    {
34        ScreenResolution,
35        PrinterResolution,
36        HighResolution,
37    };
38
39    explicit QPrinter(QPrinter::PrinterMode mode = QPrinter::ScreenResolution);
40    QPrinter(const QPrinterInfo &printer, QPrinter::PrinterMode mode = QPrinter::ScreenResolution);
41    virtual ~QPrinter();
42
43    enum Orientation
44    {
45        Portrait,
46        Landscape,
47    };
48
49    typedef QPagedPaintDevice::PageSize PaperSize;
50
51    enum PageOrder
52    {
53        FirstPageFirst,
54        LastPageFirst,
55    };
56
57    enum ColorMode
58    {
59        GrayScale,
60        Color,
61    };
62
63    enum PaperSource
64    {
65        OnlyOne,
66        Lower,
67        Middle,
68        Manual,
69        Envelope,
70        EnvelopeManual,
71        Auto,
72        Tractor,
73        SmallFormat,
74        LargeFormat,
75        LargeCapacity,
76        Cassette,
77        FormSource,
78        MaxPageSource,
79%If (Qt_5_3_0 -)
80        Upper,
81%End
82%If (Qt_5_3_0 -)
83        CustomSource,
84%End
85%If (Qt_5_3_0 -)
86        LastPaperSource,
87%End
88    };
89
90    enum PrinterState
91    {
92        Idle,
93        Active,
94        Aborted,
95        Error,
96    };
97
98    enum OutputFormat
99    {
100        NativeFormat,
101        PdfFormat,
102    };
103
104    enum PrintRange
105    {
106        AllPages,
107        Selection,
108        PageRange,
109        CurrentPage,
110    };
111
112    enum Unit
113    {
114        Millimeter,
115        Point,
116        Inch,
117        Pica,
118        Didot,
119        Cicero,
120        DevicePixel,
121    };
122
123    enum DuplexMode
124    {
125        DuplexNone,
126        DuplexAuto,
127        DuplexLongSide,
128        DuplexShortSide,
129    };
130
131    void setOutputFormat(QPrinter::OutputFormat format);
132    QPrinter::OutputFormat outputFormat() const;
133    void setPrinterName(const QString &);
134    QString printerName() const;
135    bool isValid() const;
136    void setOutputFileName(const QString &);
137    QString outputFileName() const;
138    void setPrintProgram(const QString &);
139    QString printProgram() const;
140    void setDocName(const QString &);
141    QString docName() const;
142    void setCreator(const QString &);
143    QString creator() const;
144    void setOrientation(QPrinter::Orientation);
145    QPrinter::Orientation orientation() const;
146    virtual void setPageSizeMM(const QSizeF &size);
147    void setPaperSize(QPrinter::PaperSize);
148    QPrinter::PaperSize paperSize() const;
149    void setPaperSize(const QSizeF &paperSize, QPrinter::Unit unit);
150    QSizeF paperSize(QPrinter::Unit unit) const;
151    void setPageOrder(QPrinter::PageOrder);
152    QPrinter::PageOrder pageOrder() const;
153    void setResolution(int);
154    int resolution() const;
155    void setColorMode(QPrinter::ColorMode);
156    QPrinter::ColorMode colorMode() const;
157    void setCollateCopies(bool collate);
158    bool collateCopies() const;
159    void setFullPage(bool);
160    bool fullPage() const;
161    void setCopyCount(int);
162    int copyCount() const;
163    bool supportsMultipleCopies() const;
164    void setPaperSource(QPrinter::PaperSource);
165    QPrinter::PaperSource paperSource() const;
166    void setDuplex(QPrinter::DuplexMode duplex);
167    QPrinter::DuplexMode duplex() const;
168    QList<int> supportedResolutions() const;
169    void setFontEmbeddingEnabled(bool enable);
170    bool fontEmbeddingEnabled() const;
171    void setDoubleSidedPrinting(bool enable);
172    bool doubleSidedPrinting() const;
173    QRect paperRect() const;
174    QRect pageRect() const;
175    QRectF paperRect(QPrinter::Unit) const;
176    QRectF pageRect(QPrinter::Unit) const;
177%If (WS_X11 || WS_MACX)
178    QString printerSelectionOption() const;
179%End
180%If (WS_X11 || WS_MACX)
181    void setPrinterSelectionOption(const QString &);
182%End
183    virtual bool newPage();
184    bool abort();
185    QPrinter::PrinterState printerState() const;
186    virtual QPaintEngine *paintEngine() const;
187    QPrintEngine *printEngine() const;
188    void setFromTo(int fromPage, int toPage);
189    int fromPage() const;
190    int toPage() const;
191    void setPrintRange(QPrinter::PrintRange range);
192    QPrinter::PrintRange printRange() const;
193    virtual void setMargins(const QPagedPaintDevice::Margins &m);
194    void setPageMargins(qreal left, qreal top, qreal right, qreal bottom, QPrinter::Unit unit);
195    void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, QPrinter::Unit unit) const;
196
197protected:
198    virtual int metric(QPaintDevice::PaintDeviceMetric) const;
199    void setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
200
201public:
202%If (Qt_5_1_0 -)
203    void setPaperName(const QString &paperName);
204%End
205%If (Qt_5_1_0 -)
206    QString paperName() const;
207%End
208%If (Qt_5_10_0 -)
209    void setPdfVersion(QPagedPaintDevice::PdfVersion version);
210%End
211%If (Qt_5_10_0 -)
212    QPagedPaintDevice::PdfVersion pdfVersion() const;
213%End
214};
215
216%End
217