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-12-24 10:18:56 -02:00
|
|
|
#include <QVector>
|
2013-07-10 15:34:57 +03:00
|
|
|
|
2013-10-03 17:50:40 +03:00
|
|
|
class QTableView;
|
2013-07-10 15:34:57 +03:00
|
|
|
class PrintDialog;
|
2013-07-25 12:52:20 +03:00
|
|
|
class TablePrintModel;
|
2013-10-03 17:50:40 +03:00
|
|
|
class ProfilePrintModel;
|
2013-07-25 12:52:20 +03:00
|
|
|
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-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-12-24 10:18:56 -02:00
|
|
|
QVector<QString> tablePrintColumnNames;
|
2013-07-25 12:52:20 +03:00
|
|
|
unsigned int tablePrintHeadingBackground;
|
2013-10-03 17:50:40 +03:00
|
|
|
QList<unsigned int> tablePrintColumnWidths;
|
|
|
|
unsigned int profilePrintTableMaxH;
|
|
|
|
QList<unsigned int> profilePrintColumnWidths, profilePrintRowHeights;
|
2013-07-11 00:48:38 +03:00
|
|
|
|
2013-07-10 16:04:00 +03:00
|
|
|
void setup();
|
2013-12-05 00:48:38 +01:00
|
|
|
int estimateTotalDives() const;
|
2013-09-27 19:06:45 +03:00
|
|
|
void printProfileDives(int divesPerRow, int divesPerColumn);
|
2013-10-03 17:50:40 +03:00
|
|
|
QTableView *createProfileTable(ProfilePrintModel *model, const int tableW);
|
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-12-04 15:13:40 +02:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void signalProgress(int);
|
2013-07-10 15:34:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|