1 /*
2  * Xournal++
3  *
4  * Page template settings handler
5  *
6  * @author Xournal++ Team
7  * https://github.com/xournalpp/xournalpp
8  *
9  * @license GNU GPLv2 or later
10  */
11 
12 #pragma once
13 
14 #include <string>
15 #include <vector>
16 
17 #include "control/Tool.h"
18 #include "model/PageType.h"
19 
20 #include "XournalType.h"
21 
22 class PageTemplateSettings {
23 public:
24     PageTemplateSettings();
25     virtual ~PageTemplateSettings();
26 
27 public:
28     /**
29      * Parse a template string
30      *
31      * @return true if valid
32      */
33     bool parse(const string& tpl);
34 
35     /**
36      * Convert to a parsable string
37      */
38     string toString() const;
39 
40     bool isCopyLastPageSettings() const;
41     void setCopyLastPageSettings(bool copyLastPageSettings);
42 
43     bool isCopyLastPageSize() const;
44     void setCopyLastPageSize(bool copyLastPageSize);
45 
46     double getPageWidth() const;
47     void setPageWidth(double pageWidth);
48 
49     double getPageHeight() const;
50     void setPageHeight(double pageHeight);
51 
52     Color getBackgroundColor() const;
53     void setBackgroundColor(Color backgroundColor);
54 
55     PageType getBackgroundType();
56     PageType getPageInsertType();
57     void setBackgroundType(const PageType& backgroundType);
58 
59 private:
60     /**
61      * Copy the settings from the last page
62      */
63     bool copyLastPageSettings;
64 
65     /**
66      * Copy the last page size
67      */
68     bool copyLastPageSize;
69 
70     double pageWidth;
71     double pageHeight;
72 
73     /**
74      * Background color in RGB
75      */
76     Color backgroundColor;
77 
78     /**
79      * Background type
80      */
81     PageType backgroundType;
82 };
83