Seamly2D
Code documentation
vsettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2017 Seamly, LLC *
4  * *
5  * https://github.com/fashionfreedom/seamly2d *
6  * *
7  ***************************************************************************
8  **
9  ** Seamly2D 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 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** You should have received a copy of the GNU General Public License
20  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  **************************************************************************
23 
24  ************************************************************************
25  **
26  ** @file vsettings.h
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 22 11, 2014
29  **
30  ** @brief
31  ** @copyright
32  ** This source code is part of the Valentine project, a pattern making
33  ** program, whose allow create and modeling patterns of clothing.
34  ** Copyright (C) 2013-2015 Seamly2D project
35  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36  **
37  ** Seamly2D is free software: you can redistribute it and/or modify
38  ** it under the terms of the GNU General Public License as published by
39  ** the Free Software Foundation, either version 3 of the License, or
40  ** (at your option) any later version.
41  **
42  ** Seamly2D is distributed in the hope that it will be useful,
43  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
44  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  ** GNU General Public License for more details.
46  **
47  ** You should have received a copy of the GNU General Public License
48  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49  **
50  *************************************************************************/
51 
52 #ifndef VSETTINGS_H
53 #define VSETTINGS_H
54 
55 #include <QMetaObject>
56 #include <QObject>
57 #include <QSettings>
58 #include <QString>
59 #include <QtGlobal>
60 #include <QMargins>
61 
62 #include "../vmisc/def.h"
63 #include "../vlayout/vbank.h"
64 #include "vcommonsettings.h"
65 
66 template <class T> class QSharedPointer;
67 
68 class VSettings : public VCommonSettings
69 {
70  Q_OBJECT
71 public:
72  VSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(),
73  QObject *parent = nullptr);
74 
75  QString GetLabelLanguage() const;
76  void SetLabelLanguage(const QString &value);
77 
78  static QString GetDefPathPattern();
79  QString GetPathPattern() const;
80  void SetPathPattern(const QString &value);
81 
82  static QString GetDefPathLayout();
83  QString getLayoutPath() const;
84  void SetPathLayout(const QString &value);
85 
86  bool GetGraphicalOutput() const;
87  void SetGraphicalOutput(const bool &value);
88 
89  QString GetServer() const;
90  void SetServer(const QString &value);
91 
92  bool GetServerSecure() const;
93  void SetServerSecure(const bool &value);
94 
95  bool GetProxy() const;
96  void SetProxy(const bool &value);
97 
98  QString GetProxyAddress() const;
99  void SetProxyAddress(const QString &value);
100 
101  QString GetProxyPort() const;
102  void SetProxyPort(const QString &value);
103 
104  QString GetProxyUser() const;
105  void SetProxyUser(const QString &value);
106 
107  QString GetProxyPass() const;
108  void SetProxyPass(const QString &value);
109 
110  QString GetUsername() const;
111  void SetUsername(const QString &value);
112 
113  bool GetSavePassword() const;
114  void SetSavePassword(const bool &value);
115 
116  QString GetUserPassword() const;
117  void SetUserPassword(const QString &value);
118 
119  // Layout settings
120  qreal GetLayoutPaperHeight() const;
121  void SetLayoutPaperHeight(qreal value);
122 
123  qreal GetLayoutPaperWidth() const;
124  void SetLayoutPaperWidth(qreal value);
125 
126  qreal GetLayoutShift() const;
127  static qreal GetDefLayoutShift();
128  void SetLayoutShift(qreal value);
129 
130  qreal GetLayoutWidth() const;
131  static qreal GetDefLayoutWidth();
132  void SetLayoutWidth(qreal value);
133 
134  QMarginsF GetFields(const QMarginsF &def = QMarginsF()) const;
135  void SetFields(const QMarginsF &value);
136 
137  Cases GetLayoutGroup() const;
138  static Cases GetDefLayoutGroup();
139  void SetLayoutGroup(const Cases &value);
140 
141  bool GetLayoutRotate() const;
142  static bool GetDefLayoutRotate();
143  void SetLayoutRotate(bool value);
144 
145  int GetLayoutRotationIncrease() const;
146  static int GetDefLayoutRotationIncrease();
147  void SetLayoutRotationIncrease(int value);
148 
149  bool GetLayoutAutoCrop() const;
150  static bool GetDefLayoutAutoCrop();
151  void SetLayoutAutoCrop(bool value);
152 
153  bool GetLayoutSaveLength() const;
154  static bool GetDefLayoutSaveLength();
155  void SetLayoutSaveLength(bool value);
156 
157  bool GetLayoutUnitePages() const;
158  static bool GetDefLayoutUnitePages();
159  void SetLayoutUnitePages(bool value);
160 
161  bool GetIgnoreAllFields() const;
162  static bool GetDefIgnoreAllFields();
163  void SetIgnoreAllFields(bool value);
164 
165  bool GetStripOptimization() const;
166  static bool GetDefStripOptimization();
167  void SetStripOptimization(bool value);
168 
169  quint8 GetMultiplier() const;
170  static quint8 GetDefMultiplier();
171  void SetMultiplier(quint8 value);
172 
173  bool GetTextAsPaths() const;
174  static bool GetDefTextAsPaths();
175  void setTextAsPaths(bool value);
176 
177  // settings for the tiled PDFs
178  QMarginsF GetTiledPDFMargins(const Unit &unit) const;
179  void setTiledPDFMargins(const QMarginsF &value, const Unit &unit);
180 
181  qreal getTiledPDFPaperHeight(const Unit &unit) const;
182  void setTiledPDFPaperHeight(qreal value, const Unit &unit);
183 
184  qreal getTiledPDFPaperWidth(const Unit &unit) const;
185  void setTiledPDFPaperWidth(qreal value, const Unit &unit);
186 
189 
190 private:
191  Q_DISABLE_COPY(VSettings)
192 };
193 
194 #endif // VSETTINGS_H
bool GetLayoutSaveLength() const
Definition: vsettings.cpp:531
void setTiledPDFOrientation(PageOrientation value)
Definition: vsettings.cpp:752
QString GetUsername() const
Definition: vsettings.cpp:272
void SetLabelLanguage(const QString &value)
Definition: vsettings.cpp:128
void SetProxyPort(const QString &value)
Definition: vsettings.cpp:242
void SetProxy(const bool &value)
Definition: vsettings.cpp:218
void SetGraphicalOutput(const bool &value)
Definition: vsettings.cpp:182
void SetLayoutGroup(const Cases &value)
Definition: vsettings.cpp:454
static bool GetDefLayoutSaveLength()
Definition: vsettings.cpp:537
QString GetUserPassword() const
Definition: vsettings.cpp:296
bool GetGraphicalOutput() const
Definition: vsettings.cpp:176
void SetUsername(const QString &value)
Definition: vsettings.cpp:278
static qreal GetDefLayoutWidth()
Definition: vsettings.cpp:396
QString GetProxyPort() const
Definition: vsettings.cpp:236
void SetProxyAddress(const QString &value)
Definition: vsettings.cpp:230
quint8 GetMultiplier() const
Definition: vsettings.cpp:603
static bool GetDefLayoutRotate()
Definition: vsettings.cpp:466
static QString GetDefPathLayout()
Definition: vsettings.cpp:155
bool GetStripOptimization() const
Definition: vsettings.cpp:585
QString GetLabelLanguage() const
Definition: vsettings.cpp:122
static Cases GetDefLayoutGroup()
Definition: vsettings.cpp:448
bool GetSavePassword() const
Definition: vsettings.cpp:284
QString GetProxyUser() const
Definition: vsettings.cpp:248
void SetSavePassword(const bool &value)
Definition: vsettings.cpp:290
static QString GetDefPathPattern()
Definition: vsettings.cpp:134
VSettings(Format format, Scope scope, const QString &organization, const QString &application=QString(), QObject *parent=nullptr)
Definition: vsettings.cpp:114
qreal GetLayoutPaperHeight() const
Definition: vsettings.cpp:308
static bool GetDefTextAsPaths()
Definition: vsettings.cpp:627
void setTiledPDFMargins(const QMarginsF &value, const Unit &unit)
VSettings::setTiledPDFMargins sets the setting tiled pdf margins to the given value.
Definition: vsettings.cpp:667
qreal GetLayoutWidth() const
Definition: vsettings.cpp:380
void setTextAsPaths(bool value)
Definition: vsettings.cpp:633
void SetLayoutPaperHeight(qreal value)
Definition: vsettings.cpp:324
QString GetServer() const
Definition: vsettings.cpp:188
void SetFields(const QMarginsF &value)
Definition: vsettings.cpp:419
Cases GetLayoutGroup() const
Definition: vsettings.cpp:425
void SetPathPattern(const QString &value)
Definition: vsettings.cpp:147
void SetLayoutAutoCrop(bool value)
Definition: vsettings.cpp:525
qreal GetLayoutShift() const
Definition: vsettings.cpp:352
void setTiledPDFPaperHeight(qreal value, const Unit &unit)
VSettings::setTiledPDFPaperHeight sets the tiled pdf paper height.
Definition: vsettings.cpp:702
static quint8 GetDefMultiplier()
Definition: vsettings.cpp:609
void SetLayoutSaveLength(bool value)
Definition: vsettings.cpp:543
bool GetIgnoreAllFields() const
Definition: vsettings.cpp:567
bool GetProxy() const
Definition: vsettings.cpp:212
void SetServer(const QString &value)
Definition: vsettings.cpp:194
void SetPathLayout(const QString &value)
Definition: vsettings.cpp:168
static bool GetDefLayoutAutoCrop()
Definition: vsettings.cpp:519
void SetLayoutRotate(bool value)
Definition: vsettings.cpp:472
void SetMultiplier(quint8 value)
Definition: vsettings.cpp:615
QString GetPathPattern() const
Definition: vsettings.cpp:140
QMarginsF GetFields(const QMarginsF &def=QMarginsF()) const
Definition: vsettings.cpp:408
void SetLayoutRotationIncrease(int value)
Definition: vsettings.cpp:507
void SetLayoutWidth(qreal value)
Definition: vsettings.cpp:402
void SetLayoutPaperWidth(qreal value)
Definition: vsettings.cpp:346
qreal getTiledPDFPaperWidth(const Unit &unit) const
VSettings::getTiledPDFPaperWidth returns the paper height of tiled pdf in the desired unit.
Definition: vsettings.cpp:713
QMarginsF GetTiledPDFMargins(const Unit &unit) const
VSettings::GetTiledPDFMargins returns the tiled pdf margins in the given unit. When the setting is ca...
Definition: vsettings.cpp:646
QString getLayoutPath() const
Definition: vsettings.cpp:161
bool GetLayoutAutoCrop() const
Definition: vsettings.cpp:513
QString GetProxyPass() const
Definition: vsettings.cpp:260
QString GetProxyAddress() const
Definition: vsettings.cpp:224
static bool GetDefIgnoreAllFields()
Definition: vsettings.cpp:573
void SetUserPassword(const QString &value)
Definition: vsettings.cpp:302
static int GetDefLayoutRotationIncrease()
Definition: vsettings.cpp:501
void SetServerSecure(const bool &value)
Definition: vsettings.cpp:206
void SetLayoutShift(qreal value)
Definition: vsettings.cpp:374
qreal getTiledPDFPaperHeight(const Unit &unit) const
VSettings::getTiledPDFPaperHeight returns the paper height of tiled pdf in the desired unit.
Definition: vsettings.cpp:681
void SetStripOptimization(bool value)
Definition: vsettings.cpp:597
bool GetServerSecure() const
Definition: vsettings.cpp:200
bool GetLayoutUnitePages() const
Definition: vsettings.cpp:549
bool GetLayoutRotate() const
Definition: vsettings.cpp:460
void SetLayoutUnitePages(bool value)
Definition: vsettings.cpp:561
void SetProxyUser(const QString &value)
Definition: vsettings.cpp:254
void SetIgnoreAllFields(bool value)
Definition: vsettings.cpp:579
PageOrientation getTiledPDFOrientation() const
Definition: vsettings.cpp:742
void SetProxyPass(const QString &value)
Definition: vsettings.cpp:266
qreal GetLayoutPaperWidth() const
Definition: vsettings.cpp:330
bool GetTextAsPaths() const
Definition: vsettings.cpp:621
int GetLayoutRotationIncrease() const
Definition: vsettings.cpp:478
void setTiledPDFPaperWidth(qreal value, const Unit &unit)
VSettings::setTiledPDFPaperWidth sets the tiled pdf paper width.
Definition: vsettings.cpp:736
static qreal GetDefLayoutShift()
Definition: vsettings.cpp:368
static bool GetDefLayoutUnitePages()
Definition: vsettings.cpp:555
static bool GetDefStripOptimization()
Definition: vsettings.cpp:591
PageOrientation
Definition: def.h:110
Unit
Definition: def.h:105
Cases
Definition: vbank.h:71