From 41bad7695ee40571062a370610e6ca518295e3c7 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 10 Jul 2013 15:34:57 +0300 Subject: Print: add a class for print layouting PrintLayout is a class that will handle the layouting part of dive profiles, text, tables depending on the settings of a QPrinter and the PrinterDialog and PrintOptions instances. Signed-off-by: Lubomir I. Ivanov --- qt-ui/printlayout.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 qt-ui/printlayout.cpp (limited to 'qt-ui/printlayout.cpp') diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp new file mode 100644 index 000000000..7716883e8 --- /dev/null +++ b/qt-ui/printlayout.cpp @@ -0,0 +1,50 @@ +#include +#include "mainwindow.h" +#include "printlayout.h" + +/* +struct options { + enum { PRETTY, TABLE, TWOPERPAGE } type; + int print_selected; + int color_selected; + bool notes_up; + int profile_height, notes_height, tanks_height; +}; +*/ + +PrintLayout::PrintLayout(PrintDialog *dialogPtr, QPrinter *printerPtr, struct options *optionsPtr) +{ + dialog = dialogPtr; + printer = printerPtr; + printOptions = optionsPtr; +} + +void PrintLayout::print() +{ + switch (printOptions->type) { + case options::PRETTY: + printSixDives(); + break; + case options::TWOPERPAGE: + printTwoDives(); + break; + case options::TABLE: + printTable(); + break; + } +} + +void PrintLayout::printSixDives() +{ + // nop +} + +void PrintLayout::printTwoDives() +{ + // nop +} + +void PrintLayout::printTable() +{ + // nop +} -- cgit v1.2.3-70-g09d2