2013-07-10 15:34:57 +03:00
|
|
|
#ifndef PRINTLAYOUT_H
|
|
|
|
#define PRINTLAYOUT_H
|
|
|
|
|
2013-07-25 12:52:20 +03:00
|
|
|
#include <QObject>
|
2013-07-10 15:34:57 +03:00
|
|
|
#include <QPrinter>
|
2013-07-25 12:52:20 +03:00
|
|
|
#include <QList>
|
2013-07-10 15:34:57 +03:00
|
|
|
|
|
|
|
class PrintDialog;
|
2013-07-25 12:52:20 +03:00
|
|
|
class TablePrintModel;
|
|
|
|
struct dive;
|
2013-07-10 15:34:57 +03:00
|
|
|
|
|
|
|
class PrintLayout : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PrintLayout(PrintDialog *, QPrinter *, struct options *);
|
|
|
|
void print();
|
|
|
|
|
|
|
|
private:
|
|
|
|
PrintDialog *dialog;
|
|
|
|
QPrinter *printer;
|
|
|
|
struct options *printOptions;
|
|
|
|
|
2013-07-10 19:32:15 +03:00
|
|
|
QPainter *painter;
|
2013-07-25 12:52:20 +03:00
|
|
|
int screenDpiX, screenDpiY, printerDpi, scaledPageW, scaledPageH;
|
2013-07-10 16:04:00 +03:00
|
|
|
qreal scaleX, scaleY;
|
|
|
|
QRect pageRect;
|
2013-07-10 15:34:57 +03:00
|
|
|
|
2013-07-25 12:52:20 +03:00
|
|
|
QList<QString> tablePrintColumnNames;
|
|
|
|
QList<unsigned int> tablePrintColumnWidths;
|
|
|
|
unsigned int tablePrintHeadingBackground;
|
2013-07-11 00:48:38 +03:00
|
|
|
|
2013-07-10 16:04:00 +03:00
|
|
|
void setup();
|
2013-07-11 12:55:48 +03:00
|
|
|
void printSixDives() const;
|
|
|
|
void printTwoDives() const;
|
2013-07-25 12:52:20 +03:00
|
|
|
void printTable();
|
|
|
|
void addTablePrintDataRow(TablePrintModel *model, int row, struct dive *dive) const;
|
|
|
|
void addTablePrintHeadingRow(TablePrintModel *model, int row) const;
|
|
|
|
|
2013-07-13 16:12:32 +03:00
|
|
|
QPixmap convertPixmapToGrayscale(QPixmap) const;
|
2013-07-10 15:34:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|