diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2015-07-10 21:30:18 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2015-07-20 15:27:56 +0300 |
commit | 3a6963836682aa0e0e2825db4eaac7ea48a9939b (patch) | |
tree | 8bf8cbc1e5bfac2ce4a808482bc2ea4be499bbfb /printer.h | |
parent | 142fd950c8d69dc4d4aad4034fe65ca400d37783 (diff) | |
download | subsurface-3a6963836682aa0e0e2825db4eaac7ea48a9939b.tar.gz |
Printing: check for different printing modes
Add PRINT/PREVIEW print modes, check for printing modes before
casting.
We must pass a QPaintDevice with type QPixmap for previewing and
with type QPrinter for actual printing.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'printer.h')
-rw-r--r-- | printer.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -13,12 +13,19 @@ class Printer : public QObject { Q_OBJECT +public: + enum PrintMode { + PRINT, + PREVIEW + }; + private: QPaintDevice *paintDevice; QWebView *webView; print_options *printOptions; template_options *templateOptions; QSize pageSize; + PrintMode printMode; int done; int dpi; void render(int Pages); @@ -28,7 +35,7 @@ private slots: void templateProgessUpdated(int value); public: - Printer(QPaintDevice *paintDevice, print_options *printOptions, template_options *templateOptions); + Printer(QPaintDevice *paintDevice, print_options *printOptions, template_options *templateOptions, PrintMode printMode); ~Printer(); void print(); |