ToolMap
Loading...
Searching...
No Matches
pdfdocument.h
1/***************************************************************************
2 pdfdocument.h
3 -------------------
4 copyright : (C) 2011 CREALP Lucien Schreiber
5 ***************************************************************************/
6
7/***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef _PDFDOCUMENT_H_
16#define _PDFDOCUMENT_H_
17
18// For compilers that support precompilation, includes "wx/wx.h".
19#include <wx/wxprec.h>
20
21#ifndef WX_PRECOMP
22#include <wx/wx.h>
23#endif
24
25#include <wx/filename.h>
26#include <wx/pdfdocument.h>
27
28#include "pdflayer.h"
29
30#ifndef MAX
31#define MIN(a, b) ((a < b) ? a : b)
32#define MAX(a, b) ((a > b) ? a : b)
33#endif
34
35class PrjDefMemManage;
36
38 private:
39 ArrayPdfLayer m_pdfLayers;
40
41 wxString m_prjName;
42 wxPdfDocument* m_pdf;
43 wxPaperSize m_PaperFormat;
44 double m_PaperWidth;
45 double m_PaperHeight;
46
47 wxPrintOrientation m_PaperOrientation;
48 int m_FontSize;
49 double m_LineSpacing;
50 double m_UsablePageWidth;
51 bool m_Decorate;
52 bool m_TwoCols;
53 bool m_PageBreak;
54 bool m_OnePage;
55
56 bool _GenerateTitle();
57
58 void _UpdatePageWidth();
59
60 void _ComputeOnePageSize(double& width, double& height);
61
62 bool _OrderLayers();
63
64 public:
66
67 virtual ~PdfDocument();
68
69 bool Generate(const wxFileName& filename);
70
71 inline const int GetFontSize() const;
72
73 inline const double GetLineSpacing() const;
74
75 inline const bool IsDecorated() const;
76
77 void SetDecorate(bool value);
78
79 void SetLineSpacing(double value);
80
81 void SetFontSize(int value);
82
83 void SetPaperFormat(wxPaperSize value);
84
85 void SetPaperSize(double width, double height);
86
87 void SetPaperOrientation(wxPrintOrientation value);
88
89 double GetUsablePageWidth();
90
91 bool IsLandscape();
92
93 wxPdfDocument* GetPdfRef();
94
95 inline const bool IsTwoColsLayout() const;
96
97 void SetTwoColsLayout(bool value);
98
99 inline const bool HasPageBreak() const;
100
101 void SetPageBreak(bool value);
102
103 void SetOnePage(bool value);
104};
105
106inline const int PdfDocument::GetFontSize() const {
107 return m_FontSize;
108}
109
110inline const double PdfDocument::GetLineSpacing() const {
111 return m_LineSpacing;
112}
113
114inline const bool PdfDocument::IsDecorated() const {
115 return m_Decorate;
116}
117
118inline const bool PdfDocument::IsTwoColsLayout() const {
119 return m_TwoCols;
120}
121
122inline const bool PdfDocument::HasPageBreak() const {
123 return m_PageBreak;
124}
125
126#endif
Definition pdfdocument.h:37
Definition prjdefmemmanage.h:54