45 #include <QtCore/qstring.h> 46 #include <QtCore/qscopedpointer.h> 47 #include <QtGui/qpaintdevice.h> 58 #undef B0 // Terminal hang-up. We assume that you do not want that. 81 enum PageSize { A4, B5, Letter, Legal, Executive,
82 A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
83 B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
84 DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom, NPaperSize = Custom };
87 enum PageSize { A4, B5, Letter, Legal, Executive,
88 A0, A1, A2, A3, A5, A6, A7, A8, A9, B0,
B1,
89 B10, B2, B3, B4, B6, B7, B8, B9, C5E,
Comm10E,
90 DLE, Folio, Ledger,
Tabloid, Custom, NPageSize = Custom };
91 enum PaperSize { A4, B5, Letter, Legal, Executive,
92 A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
93 B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
94 DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom, NPaperSize = Custom };
147 enum PrinterOption { PrintToFile, PrintSelection, PrintPageRange };
148 #endif // QT3_SUPPORT 153 void setPrinterName(
const QString &);
156 bool isValid()
const;
158 void setOutputFileName(
const QString &);
161 void setPrintProgram(
const QString &);
164 void setDocName(
const QString &);
167 void setCreator(
const QString &);
176 void setPaperSize(PaperSize);
179 void setPaperSize(
const QSizeF &paperSize,
Unit unit);
185 void setResolution(
int);
186 int resolution()
const;
191 void setCollateCopies(
bool collate);
192 bool collateCopies()
const;
194 void setFullPage(
bool);
195 bool fullPage()
const;
197 void setNumCopies(
int);
198 int numCopies()
const;
200 int actualNumCopies()
const;
202 void setCopyCount(
int);
203 int copyCount()
const;
204 bool supportsMultipleCopies()
const;
218 void setFontEmbeddingEnabled(
bool enable);
219 bool fontEmbeddingEnabled()
const;
221 void setDoubleSidedPrinting(
bool enable);
222 bool doubleSidedPrinting()
const;
225 void setWinPageSize(
int winPageSize);
226 int winPageSize()
const;
229 QRect paperRect()
const;
230 QRect pageRect()
const;
234 #if !defined(Q_WS_WIN) || defined(qdoc) 235 QString printerSelectionOption()
const;
236 void setPrinterSelectionOption(
const QString &);
252 void setFromTo(
int fromPage,
int toPage);
253 int fromPage()
const;
264 QT3_SUPPORT
bool pageSetup(
QWidget *parent = 0);
265 QT3_SUPPORT
bool printSetup(
QWidget *parent = 0);
270 QT3_SUPPORT
void setMinMax(
int minPage,
int maxPage);
271 QT3_SUPPORT
int minPage()
const;
272 QT3_SUPPORT
int maxPage()
const;
274 QT3_SUPPORT
void setCollateCopiesEnabled(
bool);
275 QT3_SUPPORT
bool collateCopiesEnabled()
const;
277 QT3_SUPPORT
void setOptionEnabled(PrinterOption,
bool enable);
278 QT3_SUPPORT
bool isOptionEnabled(PrinterOption)
const;
280 inline QT3_SUPPORT
QSize margins()
const;
281 inline QT3_SUPPORT
void margins(
uint *top,
uint *left,
uint *bottom,
uint *right)
const;
283 inline QT3_SUPPORT
bool aborted() {
return printerState() == Aborted; }
285 QT3_SUPPORT
void setOutputToFile(
bool);
286 inline QT3_SUPPORT
bool outputToFile()
const {
return !outputFileName().
isEmpty(); }
309 inline QSize QPrinter::margins()
const 311 QRect page = pageRect();
312 QRect paper = paperRect();
316 inline void QPrinter::margins(
uint *top,
uint *left,
uint *bottom,
uint *right)
const 318 QRect page = pageRect();
319 QRect paper = paperRect();
321 *top = page.
top() - paper.
top();
331 #endif // QT_NO_PRINTER
PaperSize paperSize(QPrinter::PaperSize paperSize)
#define QT_END_NAMESPACE
This macro expands to.
PrinterMode
This enum describes the mode the printer should work in.
Orientation
This enum type (not to be confused with Orientation) is used to specify each page's orientation...
int left() const
Returns the x-coordinate of the rectangle's left edge.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
virtual int devType() const
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
virtual void releaseDC(HDC hdc) const
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
Unit
This enum type is used to specify the measurement unit for page and paper sizes.
DuplexMode
This enum is used to indicate whether printing will occur on one or both sides of each sheet of paper...
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
The QPrintEngine class defines an interface for how QPrinter interacts with a given printing subsyste...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QPrinter class is a paint device that paints on a printer.
OutputFormat
The OutputFormat enum is used to describe the format QPrinter should use for printing.
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
The QPrinterInfo class gives access to information about existing printers.
virtual QPaintEngine * paintEngine() const =0
The QAbstractPrintDialog class provides a base implementation for print dialogs used to configure pri...
int top() const
Returns the y-coordinate of the rectangle's top edge.
virtual HDC getDC() const
int right() const
Returns the x-coordinate of the rectangle's right edge.
PaperSize
This enum type specifies what paper size QPrinter should use.
ColorMode
This enum type is used to indicate whether QPrinter should print in color or not. ...
The QRect class defines a rectangle in the plane using integer precision.
virtual int metric(PaintDeviceMetric metric) const
PageOrder
This enum type is used by QPrinter to tell the application program how to print.
The QTextDocument class holds formatted text that can be viewed and edited using a QTextEdit...
PrintRange
Used to specify the print range selection option.
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
PageSize
Use QPrinter::PaperSize instead.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
PaperSource
This enum type specifies what paper source QPrinter is to use.