2013-07-10 12:34:57 +00:00
|
|
|
#ifndef PRINTLAYOUT_H
|
|
|
|
#define PRINTLAYOUT_H
|
|
|
|
|
2013-07-25 09:52:20 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include <QList>
|
2013-12-24 12:18:56 +00:00
|
|
|
#include <QVector>
|
2014-06-26 17:01:31 +00:00
|
|
|
#include <QRect>
|
2013-07-10 12:34:57 +00:00
|
|
|
|
2014-06-26 17:01:31 +00:00
|
|
|
class QPrinter;
|
2013-10-03 14:50:40 +00:00
|
|
|
class QTableView;
|
2013-07-10 12:34:57 +00:00
|
|
|
class PrintDialog;
|
2013-07-25 09:52:20 +00:00
|
|
|
class TablePrintModel;
|
2013-10-03 14:50:40 +00:00
|
|
|
class ProfilePrintModel;
|
2013-07-25 09:52:20 +00:00
|
|
|
struct dive;
|
2013-07-10 12:34:57 +00:00
|
|
|
|
|
|
|
class PrintLayout : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PrintLayout(PrintDialog *, QPrinter *, struct options *);
|
|
|
|
void print();
|
|
|
|
|
|
|
|
private:
|
|
|
|
PrintDialog *dialog;
|
|
|
|
QPrinter *printer;
|
|
|
|
struct options *printOptions;
|
|
|
|
|
2014-07-25 00:50:40 +00:00
|
|
|
int screenDpiX, screenDpiY, printerDpi, pageW, pageH;
|
2013-07-10 13:04:00 +00:00
|
|
|
QRect pageRect;
|
2013-07-10 12:34:57 +00:00
|
|
|
|
2013-12-24 12:18:56 +00:00
|
|
|
QVector<QString> tablePrintColumnNames;
|
2013-07-25 09:52:20 +00:00
|
|
|
unsigned int tablePrintHeadingBackground;
|
2013-10-03 14:50:40 +00:00
|
|
|
QList<unsigned int> tablePrintColumnWidths;
|
|
|
|
unsigned int profilePrintTableMaxH;
|
|
|
|
QList<unsigned int> profilePrintColumnWidths, profilePrintRowHeights;
|
2013-07-10 21:48:38 +00:00
|
|
|
|
2013-07-10 13:04:00 +00:00
|
|
|
void setup();
|
2013-12-04 23:48:38 +00:00
|
|
|
int estimateTotalDives() const;
|
2013-09-27 16:06:45 +00:00
|
|
|
void printProfileDives(int divesPerRow, int divesPerColumn);
|
2014-07-24 17:56:39 +00:00
|
|
|
QTableView *createProfileTable(ProfilePrintModel *model, const int tableW, const qreal fitNotesToHeight = 0.0);
|
2013-07-25 09:52:20 +00:00
|
|
|
void printTable();
|
|
|
|
void addTablePrintDataRow(TablePrintModel *model, int row, struct dive *dive) const;
|
|
|
|
void addTablePrintHeadingRow(TablePrintModel *model, int row) const;
|
2013-12-04 13:13:40 +00:00
|
|
|
|
|
|
|
signals:
|
2014-02-28 04:09:57 +00:00
|
|
|
void signalProgress(int);
|
2013-07-10 12:34:57 +00:00
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // PRINTLAYOUT_H
|