summaryrefslogtreecommitdiffstats
path: root/printer.h
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-07-10 21:30:18 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-07-20 15:27:56 +0300
commit3a6963836682aa0e0e2825db4eaac7ea48a9939b (patch)
tree8bf8cbc1e5bfac2ce4a808482bc2ea4be499bbfb /printer.h
parent142fd950c8d69dc4d4aad4034fe65ca400d37783 (diff)
downloadsubsurface-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.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/printer.h b/printer.h
index caeb14a1f..dee9ba980 100644
--- a/printer.h
+++ b/printer.h
@@ -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();