2013-07-10 12:34:57 +00:00
|
|
|
#ifndef PRINTLAYOUT_H
|
|
|
|
#define PRINTLAYOUT_H
|
|
|
|
|
|
|
|
#include <QPrinter>
|
2013-07-10 21:45:29 +00:00
|
|
|
#include <QStringList>
|
2013-07-10 12:34:57 +00:00
|
|
|
|
|
|
|
class PrintDialog;
|
|
|
|
|
|
|
|
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 16:32:15 +00:00
|
|
|
QPainter *painter;
|
2013-07-10 13:04:00 +00:00
|
|
|
int screenDpiX, screenDpiY, printerDpi;
|
|
|
|
qreal scaleX, scaleY;
|
|
|
|
QRect pageRect;
|
2013-07-10 12:34:57 +00:00
|
|
|
|
2013-07-10 21:48:38 +00:00
|
|
|
QStringList tableColumnNames;
|
|
|
|
QStringList tableColumnWidths;
|
|
|
|
|
2013-07-10 13:04:00 +00:00
|
|
|
void setup();
|
2013-07-10 12:34:57 +00:00
|
|
|
void printSixDives();
|
|
|
|
void printTwoDives();
|
|
|
|
void printTable();
|
2013-07-10 16:32:15 +00:00
|
|
|
QString insertTableHeadingRow();
|
2013-07-10 21:48:38 +00:00
|
|
|
QString insertTableHeadingCol(int);
|
|
|
|
QString insertTableDataRow(struct dive *);
|
|
|
|
QString insertTableDataCol(QString);
|
2013-07-10 12:34:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|