mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <neolit123@gmail.com>
This commit is contained in:
parent
74f989bc46
commit
41bad7695e
6 changed files with 91 additions and 1 deletions
50
qt-ui/printlayout.cpp
Normal file
50
qt-ui/printlayout.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
#include <QPainter>
|
||||
#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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue