YATiSh
Yet Another TIme SHeet
yatishPDF.h
Go to the documentation of this file.
1 /********************************************************************
2  * Name: yatishDB.h
3  * Purpose: Declares the class exporting PDF from yatish data
4  * Author: Nicolas PĂ©renne (nicolas.perenne@eif-services.eu)
5  * Created: 2021-03-23
6  * Copyright: EIF-services (https://www.eif-services.eu/yatish)
7  * License: GPLv3
8  ********************************************************************/
9 
10 #ifndef YATISHPDF_H
11 #define YATISHPDF_H
12 
13 #include "yatishDBsqlite.h"
14 #include "yatishSettings.h"
15 #include "yatishTypes.h"
16 
20 class yatishPDF : public wxPdfDocument {
21  public:
22  yatishPDF (const Settings&, const wxListCtrl *, const yatishDBsqlite&,
23  const wxString& = "yatish.pdf");
24  ~yatishPDF ();
25  private:
26  const Settings& sttngs; // for Header()
27  int colmax, rowmax;
28  wxString whereToWrite; // for ~yatishPDF()
29  void Summary (const yatishDBsqlite&);
30  void Charts (const wxListCtrl *);
31  void Listing (const wxListCtrl *);
32  void Header ();
33  void Footer ();
34  void PieChart (double, double, double, double,
35  const Map4pie&, const wxColour *);
36  void NoMoreThan6 (Map4pie&);
37 };
38 
39 #endif // YATISHPDF_H
Interacts with yatish tables in a SQLite database.
Exports a PDF reflecting the current state of panel #2.
Definition: yatishPDF.h:20
int colmax
Definition: yatishPDF.h:27
void Footer()
PDF footer (page count).
Definition: yatishPDF.cpp:180
void Listing(const wxListCtrl *)
Writes a table corresponding to the current state of panel #2 (Ctrl-T).
Definition: yatishPDF.cpp:132
int rowmax
Definition: yatishPDF.h:27
~yatishPDF()
Writes the PDF document to the file which was given to the constructor.
Definition: yatishPDF.cpp:43
void Header()
Creates the header of the PDF document, according to user preferences (Ctrl-P).
Definition: yatishPDF.cpp:159
wxString whereToWrite
Definition: yatishPDF.h:28
void NoMoreThan6(Map4pie &)
Modifies its argument map so that there is no more than six records.
Definition: yatishPDF.cpp:243
yatishPDF(const Settings &, const wxListCtrl *, const yatishDBsqlite &, const wxString &="yatish.pdf")
Prints a title then calls other member functions for the body of the PDF document.
Definition: yatishPDF.cpp:19
void Charts(const wxListCtrl *)
Draws charts from the timeslot view only (6 columns).
Definition: yatishPDF.cpp:89
void Summary(const yatishDBsqlite &)
A few pieces of information about the data to be shown by [Charts() and] Listing().
Definition: yatishPDF.cpp:48
void PieChart(double, double, double, double, const Map4pie &, const wxColour *)
Modified from charting.cpp in the wxPdfDocument samples.
Definition: yatishPDF.cpp:188
const Settings & sttngs
Definition: yatishPDF.h:26
As its names implies: the class holding YATiSh settings.
map< string, unsigned long > Map4pie
Definition: yatishTypes.h:18