Qt 4.8
qprintengine_ps_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QPRINTENGINE_PS_P_H
43 #define QPRINTENGINE_PS_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists for the convenience
50 // of qpsprinter.cpp and qprinter_x11.cpp.
51 // This header file may change from version to version without notice,
52 // or even be removed.
53 //
54 // We mean it.
55 //
56 
57 #ifndef QT_NO_PRINTER
58 
59 #include "private/qpdf_p.h"
60 #include "qplatformdefs.h"
61 #include "QtCore/qlibrary.h"
62 #include "QtCore/qstringlist.h"
63 #include "QtCore/qhash.h"
64 #include "QtCore/qabstractitemmodel.h"
65 
67 
68 class QPrinter;
70 
72 {
74 public:
75  // QPrinter uses these
78 
79 
80  virtual bool begin(QPaintDevice *pdev);
81  virtual bool end();
82 
83  void setBrush();
84 
85  virtual void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags);
86  virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
87  virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
88 
89  virtual void drawImageInternal(const QRectF &r, QImage img, bool bitmap);
90 
91  virtual QPaintEngine::Type type() const { return QPaintEngine::PostScript; }
92 
93  virtual bool newPage();
94  virtual bool abort();
95 
96  virtual QPrinter::PrinterState printerState() const;
97 
98  virtual Qt::HANDLE handle() const { return 0; }
99 
100 private:
102 };
103 
105 public:
108 
109  void emitHeader(bool finished);
110  void emitPages();
111  void drawImage(qreal x, qreal y, qreal w, qreal h, const QImage &img, const QImage &mask);
112  void flushPage(bool last = false);
113  void drawImageHelper(qreal x, qreal y, qreal w, qreal h, const QImage &img, const QImage &mask,
114  bool gray, qreal scaleX, qreal scaleY);
115 
117  bool epsf;
119 
120  // stores the descriptions of the n first pages.
123 
124  bool firstPage;
125 
127 
131 };
132 
134 
135 #endif // QT_NO_PRINTER
136 
137 #endif // QPRINTENGINE_PS_P_H
double qreal
Definition: qglobal.h:1193
PrinterState
Definition: qprinter.h:119
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QPSPrintEngine(QPrinter::PrinterMode m)
virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s)
Reimplement this function to draw the pixmap in the given rect, starting at the given p...
virtual QPrinter::PrinterState printerState() const
Returns the current state of the printer being used by the print engine.
PrinterMode
This enum describes the mode the printer should work in.
Definition: qprinter.h:70
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
virtual bool end()
Reimplement this function to finish painting on the current paint device.
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QPrinter class is a paint device that paints on a printer.
Definition: qprinter.h:66
virtual bool begin(QPaintDevice *pdev)
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
void * HANDLE
Definition: qnamespace.h:1671
virtual void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags)
Reimplement this function to draw the part of the image specified by the sr rectangle in the given re...
virtual void drawImageInternal(const QRectF &r, QImage img, bool bitmap)
virtual QPaintEngine::Type type() const
Reimplement this function to return the paint engine Type.
virtual bool newPage()
Instructs the print engine to start a new page.
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
QPrinter::PrinterState printerState
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
virtual Qt::HANDLE handle() const
virtual bool abort()
Instructs the print engine to abort the printing process.
QPdf::ByteStream buffer
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r...