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>
Print: add a setup() method to PrintLayout

The setup() method will be called each time to obtain the
current printer settings. Also it calculates required scalling
based on screen agains printer DPI.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Print: add a print preview for testing purposes

Use a QPrintPreviewDialog, while the print logic is WIP.
This way Qt will show the print output in a window instead
of exporting to a file and opending it manualy.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Print: initial implementation of the table print

PrintLayout for now only handles the table print,
while the data output itself is work in progress.
For now there is a simple HTML/CSS table logic based
on QTextDocument. There is an iterative algorithm
which listens for a page increase and adds a heading
on top of the new page.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
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>
Print: cleanup for PrintLayout::printTable()

also includes:
- experiment with colored background for headings
- experiment with 'left' alignment for headings
('th' tag CSS does not support 'text-align')
- whitespace fixes

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Print: move some header includes to cpp files

We don't really need includes of display.h and dive.h in
printoptions.h and printlayout.h or forward declartions
of 'struct dive' and 'struct options' in there.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Print: show column titles for table print

Patch does:
- set individual column width and name
(held in tableColumnNames, tableColumnWidths)
- reduce font size in the table
- more small tweaks in the style sheet

TODO: finish printing all dive data

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Models: move the declaration of DiveItem to the header

This should allow external use of the type by
including models.h.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Models: add the DiveItem::displayDate() helper

Add this helper so that we can easily wrap the required
memory release after calling get_dive_date_string()
(fixes a small memory leak).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Print: complete columns for the table print

We use the DiveItem struct from models.h so to ease the
display of date, depth and duration. All columns present
in the GTK build are now displayed.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Print: mark some functions in PrintLayout as 'const'

It might be a good practice to declare certain class
'helper' functions as constant members. But I don't
think there are performance benefits to that other
than the readability ones.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
About: improve dialog layout

This modifications makes the About dialog spacing more
consitent with different font sizes. Tested on
Ubuntu 12.04 with the 'Universal Access->Text size'
settings.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>