This makes it easier to see what's going on during the printing process. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef PRINTER_H
|
|
#define PRINTER_H
|
|
|
|
#include "printoptions.h"
|
|
|
|
#include <QPrinter>
|
|
#include <QTemporaryDir>
|
|
|
|
class ProfileWidget2;
|
|
class QPainter;
|
|
class QPaintDevice;
|
|
class QRect;
|
|
class QWebEngineView;
|
|
|
|
|
|
class Printer : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum PrintMode {
|
|
PRINT,
|
|
PREVIEW
|
|
};
|
|
QWebEngineView *webView;
|
|
|
|
private:
|
|
QPaintDevice *paintDevice;
|
|
QPrinter printer;
|
|
QTemporaryDir printDir;
|
|
print_options &printOptions;
|
|
template_options &templateOptions;
|
|
QSize pageSize;
|
|
PrintMode printMode;
|
|
bool inPlanner;
|
|
int done;
|
|
void onLoadFinished();
|
|
bool profilesMissing;
|
|
|
|
private slots:
|
|
void templateProgessUpdated(int value);
|
|
void printing();
|
|
void printFinished();
|
|
|
|
public:
|
|
Printer(QPaintDevice *paintDevice, print_options &printOptions, template_options &templateOptions, PrintMode printMode, bool inPlanner, QWidget *parent);
|
|
~Printer();
|
|
void print();
|
|
void previewOnePage();
|
|
QString writeTmpTemplate(const QString templtext);
|
|
QString exportHtml();
|
|
void updateOptions(print_options &poptions, template_options &toptions);
|
|
|
|
|
|
signals:
|
|
void progessUpdated(int value);
|
|
void profilesInserted();
|
|
void jobDone();
|
|
};
|
|
|
|
#endif //PRINTER_H
|