diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-08-16 11:34:01 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-08-19 09:15:46 +0200 |
commit | 2df117b8ad0b0726cd6d7a084a9dced4710617a7 (patch) | |
tree | 04e5865b744e61cb51bd5e06ca4f0307039f6c5c /src/gui/painting/qpdf_p.h | |
parent | 941de7608b9388f0a72dac9f650ca03a3b26f34c (diff) |
Move the remaining QPrinter dependencies out of qpf.*
Change-Id: I4fd0158d65afad1bc67c52eff17ce2e12ff60641
Reviewed-on: http://codereview.qt.nokia.com/3203
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/gui/painting/qpdf_p.h')
-rw-r--r-- | src/gui/painting/qpdf_p.h | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h index e8d8dd9ef3..6cd0700554 100644 --- a/src/gui/painting/qpdf_p.h +++ b/src/gui/painting/qpdf_p.h @@ -60,16 +60,10 @@ #include "private/qfontengine_p.h" #include "private/qfontsubset_p.h" -// ### remove! -#include <qprinter.h> +// #define USE_NATIVE_GRADIENTS QT_BEGIN_NAMESPACE -#define PPK_CupsOptions QPrintEngine::PrintEnginePropertyKey(0xfe00) -#define PPK_CupsPageRect QPrintEngine::PrintEnginePropertyKey(0xfe01) -#define PPK_CupsPaperRect QPrintEngine::PrintEnginePropertyKey(0xfe02) -#define PPK_CupsStringPageSize QPrintEngine::PrintEnginePropertyKey(0xfe03) - const char *qt_real_to_string(qreal val, char *buf); const char *qt_int_to_string(int val, char *buf); @@ -147,13 +141,6 @@ namespace QPdf { const char *toHex(ushort u, char *buffer); const char *toHex(uchar u, char *buffer); - - struct PaperSize { - int width, height; // in postscript points - }; - Q_GUI_EXPORT PaperSize paperSize(QPrinter::PaperSize paperSize); - Q_GUI_EXPORT const char *paperSizeToString(QPrinter::PaperSize paperSize); - } @@ -181,9 +168,13 @@ class QPdfEngine : public QAlphaPaintEngine { Q_DECLARE_PRIVATE(QPdfEngine) public: - QPdfEngine(QPdfEnginePrivate &d, PaintEngineFeatures f); + QPdfEngine(); + QPdfEngine(QPdfEnginePrivate &d); ~QPdfEngine() {} + void setOutputFilename(const QString &filename); + inline void setResolution(int resolution); + // reimplementations QPaintEngine bool begin(QPaintDevice *pdev); bool end(); @@ -222,7 +213,7 @@ class QPdfEnginePrivate : public QAlphaPaintEnginePrivate { Q_DECLARE_PUBLIC(QPdfEngine) public: - QPdfEnginePrivate(QPrinter::PrinterMode m); + QPdfEnginePrivate(); ~QPdfEnginePrivate(); inline uint requestObject() { return currentObject++; } @@ -280,29 +271,16 @@ public: // printer options QString outputFileName; - QString printerName; - QString printProgram; - QString selectionOption; QString title; QString creator; - QPrinter::DuplexMode duplex; - bool collate; bool fullPage; bool embedFonts; - int copies; int resolution; - QPrinter::PageOrder pageOrder; - QPrinter::Orientation orientation; - QPrinter::PaperSize paperSize; - QPrinter::ColorMode colorMode; - QPrinter::PaperSource paperSource; - - QStringList cupsOptions; - QRect cupsPaperRect; - QRect cupsPageRect; - QString cupsStringPageSize; - QSizeF customPaperSize; // in postscript points - bool hasCustomPageMargins; + bool landscape; + bool grayscale; + + // in postscript points + QSizeF paperSize; qreal leftMargin, topMargin, rightMargin, bottomMargin; #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) @@ -346,6 +324,12 @@ private: QHash<QPair<uint, uint>, uint > alphaCache; }; +void QPdfEngine::setResolution(int resolution) +{ + Q_D(QPdfEngine); + d->resolution = resolution; +} + QT_END_NAMESPACE #endif // QPDF_P_H |