mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
76e6420f6b
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#ifndef PRINTLAYOUT_H
|
|
#define PRINTLAYOUT_H
|
|
|
|
#include <QObject>
|
|
#include <QPrinter>
|
|
#include <QList>
|
|
#include <QVector>
|
|
|
|
class QTableView;
|
|
class PrintDialog;
|
|
class TablePrintModel;
|
|
class ProfilePrintModel;
|
|
struct dive;
|
|
|
|
class PrintLayout : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
PrintLayout(PrintDialog *, QPrinter *, struct options *);
|
|
void print();
|
|
|
|
private:
|
|
PrintDialog *dialog;
|
|
QPrinter *printer;
|
|
struct options *printOptions;
|
|
|
|
int screenDpiX, screenDpiY, printerDpi, scaledPageW, scaledPageH;
|
|
qreal scaleX, scaleY;
|
|
QRect pageRect;
|
|
|
|
QVector<QString> tablePrintColumnNames;
|
|
unsigned int tablePrintHeadingBackground;
|
|
QList<unsigned int> tablePrintColumnWidths;
|
|
unsigned int profilePrintTableMaxH;
|
|
QList<unsigned int> profilePrintColumnWidths, profilePrintRowHeights;
|
|
|
|
void setup();
|
|
int estimateTotalDives() const;
|
|
void printProfileDives(int divesPerRow, int divesPerColumn);
|
|
QTableView *createProfileTable(ProfilePrintModel *model, const int tableW);
|
|
void printTable();
|
|
void addTablePrintDataRow(TablePrintModel *model, int row, struct dive *dive) const;
|
|
void addTablePrintHeadingRow(TablePrintModel *model, int row) const;
|
|
|
|
signals:
|
|
void signalProgress(int);
|
|
};
|
|
|
|
#endif // PRINTLAYOUT_H
|