QtBase
v6.3.1
|
The QPrintEngine class defines an interface for how QPrinter interacts with a given printing subsystem. More...
#include <qprintengine.h>
enum | PrintEnginePropertyKey { PPK_CollateCopies , PPK_ColorMode , PPK_Creator , PPK_DocumentName , PPK_FullPage , PPK_NumberOfCopies , PPK_Orientation , PPK_OutputFileName , PPK_PageOrder , PPK_PageRect , PPK_PageSize , PPK_PaperRect , PPK_PaperSource , PPK_PrinterName , PPK_PrinterProgram , PPK_Resolution , PPK_SelectionOption , PPK_SupportedResolutions , PPK_WindowsPageSize , PPK_FontEmbedding , PPK_Duplex , PPK_PaperSources , PPK_CustomPaperSize , PPK_PageMargins , PPK_CopyCount , PPK_SupportsMultipleCopies , PPK_PaperName , PPK_QPageSize , PPK_QPageMargins , PPK_QPageLayout , PPK_PaperSize = PPK_PageSize , PPK_CustomBase = 0xff00 } |
virtual | ~QPrintEngine () |
virtual void | setProperty (PrintEnginePropertyKey key, const QVariant &value)=0 |
virtual QVariant | property (PrintEnginePropertyKey key) const =0 |
virtual bool | newPage ()=0 |
virtual bool | abort ()=0 |
virtual int | metric (QPaintDevice::PaintDeviceMetric) const =0 |
virtual QPrinter::PrinterState | printerState () const =0 |
The QPrintEngine class defines an interface for how QPrinter interacts with a given printing subsystem.
\reentrant
\inmodule QtPrintSupport
The common case when creating your own print engine is to derive from both QPaintEngine and QPrintEngine. Various properties of a print engine are given with property() and set with setProperty().
Definition at line 54 of file qprintengine.h.
This enum is used to communicate properties between the print engine and QPrinter. A property may or may not be supported by a given print engine.
\value PPK_CollateCopies A boolean value indicating whether the printout should be collated or not.
\value PPK_ColorMode Refers to QPrinter::ColorMode, either color or monochrome.
\value PPK_Creator A string describing the document's creator.
\value PPK_Duplex A boolean value indicating whether both sides of the printer paper should be used for the printout.
\value PPK_DocumentName A string describing the document name in the spooler.
\value PPK_FontEmbedding A boolean value indicating whether data for the document's fonts should be embedded in the data sent to the printer.
\value PPK_FullPage A boolean describing if the printer should be full page or not.
\value PPK_NumberOfCopies Obsolete. An integer specifying the number of copies. Use PPK_CopyCount instead.
\value PPK_Orientation Specifies a QPageLayout::Orientation value.
\value PPK_OutputFileName The output file name as a string. An empty file name indicates that the printer should not print to a file.
\value PPK_PageOrder Specifies a QPrinter::PageOrder value.
\value PPK_PageRect A QRect specifying the page rectangle
\value PPK_PageSize Obsolete. Use PPK_PaperSize instead.
\value PPK_PaperRect A QRect specifying the paper rectangle.
\value PPK_PaperSource Specifies a QPrinter::PaperSource value.
\value PPK_PaperSources Specifies more than one QPrinter::PaperSource value.
\value PPK_PaperName A string specifying the name of the paper.
\value PPK_PaperSize Specifies a QPrinter::PaperSize value.
\value PPK_PrinterName A string specifying the name of the printer.
\value PPK_PrinterProgram A string specifying the name of the printer program used for printing,
\value PPK_Resolution An integer describing the dots per inch for this printer.
\value PPK_SelectionOption
\value PPK_SupportedResolutions A list of integer QVariants describing the set of supported resolutions that the printer has.
\value PPK_WindowsPageSize An integer specifying a DM_PAPER entry on Windows.
\value PPK_CustomPaperSize A QSizeF specifying a custom paper size in the QPrinter::Point unit.
\value PPK_PageMargins A QList<QVariant> containing the left, top, right and bottom margin values in the QPrinter::Point unit.
\value PPK_CopyCount An integer specifying the number of copies to print.
\value PPK_SupportsMultipleCopies A boolean value indicating whether or not the printer supports printing multiple copies in one job.
\value PPK_QPageSize Set the page size using a QPageSize object.
\value PPK_QPageMargins Set the page margins using a QPair of QMarginsF and QPageLayout::Unit.
\value PPK_QPageLayout Set the page layout using a QPageLayout object.
\value PPK_CustomBase Basis for extension.
Definition at line 58 of file qprintengine.h.
|
inlinevirtual |
Destroys the print engine.
Definition at line 57 of file qprintengine.h.
|
pure virtual |
Instructs the print engine to abort the printing process. Returns true if successful; otherwise returns false
.
Implemented in QWin32PrintEngine, QPdfPrintEngine, QPreviewPaintEngine, and QMacPrintEngine.
|
pure virtual |
Returns the metric for the given id.
Implemented in QWin32PrintEngine, QPdfPrintEngine, QPreviewPaintEngine, and QMacPrintEngine.
|
pure virtual |
Instructs the print engine to start a new page. Returns true
if the printer was able to create the new page; otherwise returns false
.
Implemented in QWin32PrintEngine, QPdfPrintEngine, QPreviewPaintEngine, and QMacPrintEngine.
|
pure virtual |
Returns the current state of the printer being used by the print engine.
Implemented in QWin32PrintEngine, QPdfPrintEngine, QPreviewPaintEngine, and QMacPrintEngine.
|
pure virtual |
Returns the print engine's property specified by key.
Implemented in QWin32PrintEngine, QPdfPrintEngine, QPreviewPaintEngine, QCupsPrintEngine, and QMacPrintEngine.
|
pure virtual |
Sets the print engine's property specified by key to the given value.
Implemented in QWin32PrintEngine, QPdfPrintEngine, QPreviewPaintEngine, QCupsPrintEngine, and QMacPrintEngine.