#ifndef PRINTLAYOUT_H #define PRINTLAYOUT_H #include #include #include 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; QList tablePrintColumnNames; unsigned int tablePrintHeadingBackground; QList tablePrintColumnWidths; unsigned int profilePrintTableMaxH; QList profilePrintColumnWidths, profilePrintRowHeights; void setup(); 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; QPixmap convertPixmapToGrayscale(QPixmap) const; }; #endif