subsurface/qt-ui/printlayout.h
Lubomir I. Ivanov 9a99aa4c58 Print: use the actual dive table
Currently only for the table print, but now we use the
actual dive table to iterate trough all dives (find only
selected if needed) and print their 'number' element
in table rows.

Also improves the new-page detection algorithm slightly.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10 22:55:40 +03:00

36 lines
633 B
C++

#ifndef PRINTLAYOUT_H
#define PRINTLAYOUT_H
#include <QPrinter>
#include <QPainter>
#include "../display.h"
class PrintDialog;
struct dive;
class PrintLayout : public QObject {
Q_OBJECT
public:
PrintLayout(PrintDialog *, QPrinter *, struct options *);
void print();
private:
PrintDialog *dialog;
QPrinter *printer;
struct options *printOptions;
QPainter *painter;
int screenDpiX, screenDpiY, printerDpi;
qreal scaleX, scaleY;
QRect pageRect;
void setup();
void printSixDives();
void printTwoDives();
void printTable();
QString insertTableHeadingRow();
QString insertTableDataRow(struct dive *dive);
};
#endif