2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-04-21 16:05:20 +00:00
|
|
|
#ifndef PRINTER_H
|
|
|
|
#define PRINTER_H
|
|
|
|
|
2015-06-14 04:25:35 +00:00
|
|
|
#include "printoptions.h"
|
2015-07-02 20:26:31 +00:00
|
|
|
#include "templateedit.h"
|
2015-04-21 16:05:20 +00:00
|
|
|
|
2020-12-13 12:32:40 +00:00
|
|
|
class ProfileWidget2;
|
|
|
|
class QPainter;
|
|
|
|
class QPaintDevice;
|
|
|
|
class QRect;
|
|
|
|
class QWebView;
|
|
|
|
|
2015-04-21 16:05:20 +00:00
|
|
|
class Printer : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2015-07-10 19:30:18 +00:00
|
|
|
public:
|
|
|
|
enum PrintMode {
|
|
|
|
PRINT,
|
|
|
|
PREVIEW
|
|
|
|
};
|
|
|
|
|
2015-04-21 16:05:20 +00:00
|
|
|
private:
|
2015-07-10 18:34:25 +00:00
|
|
|
QPaintDevice *paintDevice;
|
2015-04-21 16:05:20 +00:00
|
|
|
QWebView *webView;
|
2020-12-12 12:28:36 +00:00
|
|
|
const print_options &printOptions;
|
|
|
|
const template_options &templateOptions;
|
2015-06-17 15:05:14 +00:00
|
|
|
QSize pageSize;
|
2015-07-10 19:30:18 +00:00
|
|
|
PrintMode printMode;
|
2021-02-13 21:43:55 +00:00
|
|
|
bool inPlanner;
|
2015-06-17 15:05:14 +00:00
|
|
|
int done;
|
2015-07-10 14:20:14 +00:00
|
|
|
void render(int Pages);
|
2015-08-13 21:23:07 +00:00
|
|
|
void flowRender();
|
2020-12-13 12:32:40 +00:00
|
|
|
void putProfileImage(const QRect &box, const QRect &viewPort, QPainter *painter,
|
2020-12-13 12:44:44 +00:00
|
|
|
struct dive *dive, ProfileWidget2 *profile);
|
2015-05-30 13:32:15 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void templateProgessUpdated(int value);
|
2015-04-21 16:05:20 +00:00
|
|
|
|
|
|
|
public:
|
2021-02-13 21:43:55 +00:00
|
|
|
Printer(QPaintDevice *paintDevice, const print_options &printOptions, const template_options &templateOptions, PrintMode printMode, bool inPlanner);
|
2015-07-10 12:59:56 +00:00
|
|
|
~Printer();
|
2015-04-21 16:05:20 +00:00
|
|
|
void print();
|
2015-07-10 19:45:27 +00:00
|
|
|
void previewOnePage();
|
2019-09-06 21:17:49 +00:00
|
|
|
QString exportHtml();
|
2015-05-30 13:32:15 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void progessUpdated(int value);
|
2015-04-21 16:05:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //PRINTER_H
|