1 /************************************************************************
2  **
3  **  @file   ifcdef.h
4  **  @author Roman Telezhynskyi <dismine(at)gmail.com>
5  **  @date   10 12, 2014
6  **
7  **  @brief
8  **  @copyright
9  **  This source code is part of the Valentina project, a pattern making
10  **  program, whose allow create and modeling patterns of clothing.
11  **  Copyright (C) 2013-2015 Valentina project
12  **  <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
13  **
14  **  Valentina is free software: you can redistribute it and/or modify
15  **  it under the terms of the GNU General Public License as published by
16  **  the Free Software Foundation, either version 3 of the License, or
17  **  (at your option) any later version.
18  **
19  **  Valentina is distributed in the hope that it will be useful,
20  **  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  **  GNU General Public License for more details.
23  **
24  **  You should have received a copy of the GNU General Public License
25  **  along with Valentina.  If not, see <http://www.gnu.org/licenses/>.
26  **
27  *************************************************************************/
28 
29 #ifndef IFCDEF_H
30 #define IFCDEF_H
31 
32 #include <QtGlobal>
33 #ifdef Q_OS_WIN
34    extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
35 #  include <qt_windows.h>
36 #endif /*Q_OS_WIN*/
37 
38 #include <QFont>
39 #include <QString>
40 #include <QStringList>
41 
42 #include "../vmisc/typedef.h"
43 #include "../vmisc/def.h"
44 #include "../vmisc/diagnostic.h"
45 
46 extern const QString CustomMSign;
47 extern const QString CustomIncrSign;
48 
49 // Detect whether the compiler supports C++11 noexcept exception specifications.
50 #  if   defined(__clang__)
51 #    if __has_feature(cxx_noexcept)
52 #      define V_NOEXCEPT_EXPR(x) noexcept(x) // Clang 3.0 and above have noexcept
53 #    endif
54 #  elif defined(__GNUC__)
55 #    if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
56 #      define V_NOEXCEPT_EXPR(x) noexcept(x) // GCC 4.7 and following have noexcept
57 #    endif
58 #  elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026
59 #    define V_NOEXCEPT_EXPR(x) noexcept(x) // Visual Studio 2015 and following have noexcept
60 #  else
61 #    define V_NOEXCEPT_EXPR(x)
62 #  endif
63 
64 extern const QString AttrType;
65 extern const QString AttrMx;
66 extern const QString AttrMy;
67 extern const QString AttrName;
68 extern const QString AttrMx1;
69 extern const QString AttrMy1;
70 extern const QString AttrName1;
71 extern const QString AttrMx2;
72 extern const QString AttrMy2;
73 extern const QString AttrName2;
74 extern const QString AttrBaseLineP1;
75 extern const QString AttrBaseLineP2;
76 extern const QString AttrDartP1;
77 extern const QString AttrDartP2;
78 extern const QString AttrDartP3;
79 extern const QString AttrX;
80 extern const QString AttrY;
81 extern const QString AttrTypeLine;
82 extern const QString AttrCut;
83 extern const QString AttrLength;
84 extern const QString AttrBasePoint;
85 extern const QString AttrFirstPoint;
86 extern const QString AttrSecondPoint;
87 extern const QString AttrThirdPoint;
88 extern const QString AttrCenter;
89 extern const QString AttrRadius;
90 extern const QString AttrRadius1;
91 extern const QString AttrRadius2;
92 extern const QString AttrAngle;
93 extern const QString AttrAngle1;
94 extern const QString AttrAngle2;
95 extern const QString AttrRotationAngle;
96 extern const QString AttrLength1;
97 extern const QString AttrLength2;
98 extern const QString AttrP1Line;
99 extern const QString AttrP2Line;
100 extern const QString AttrP1Line1;
101 extern const QString AttrP2Line1;
102 extern const QString AttrP1Line2;
103 extern const QString AttrP2Line2;
104 extern const QString AttrPShoulder;
105 extern const QString AttrPoint1;
106 extern const QString AttrPoint2;
107 extern const QString AttrPoint3;
108 extern const QString AttrPoint4;
109 extern const QString AttrKAsm1;// TODO. Delete if minimal supported version is 0.2.7
110 extern const QString AttrKAsm2;// TODO. Delete if minimal supported version is 0.2.7
111 extern const QString AttrKCurve;// TODO. Delete if minimal supported version is 0.2.7
112 extern const QString AttrDuplicate;
113 extern const QString AttrAScale;
114 extern const QString AttrPathPoint;
115 extern const QString AttrPSpline;
116 extern const QString AttrAxisP1;
117 extern const QString AttrAxisP2;
118 extern const QString AttrCurve;
119 extern const QString AttrCurve1;
120 extern const QString AttrCurve2;
121 extern const QString AttrLineColor;
122 extern const QString AttrColor;
123 extern const QString AttrPenStyle;
124 extern const QString AttrFirstArc;
125 extern const QString AttrSecondArc;
126 extern const QString AttrCrossPoint;
127 extern const QString AttrVCrossPoint;
128 extern const QString AttrHCrossPoint;
129 extern const QString AttrAxisType;
130 extern const QString AttrC1Center;
131 extern const QString AttrC2Center;
132 extern const QString AttrC1Radius;
133 extern const QString AttrC2Radius;
134 extern const QString AttrCCenter;
135 extern const QString AttrTangent;
136 extern const QString AttrCRadius;
137 extern const QString AttrArc;
138 extern const QString AttrSuffix;
139 extern const QString AttrItem;
140 extern const QString AttrIdObject;
141 extern const QString AttrInLayout;
142 extern const QString AttrForbidFlipping;
143 extern const QString AttrForceFlipping;
144 extern const QString AttrClosed;
145 extern const QString AttrShowLabel;
146 extern const QString AttrShowLabel1;
147 extern const QString AttrShowLabel2;
148 extern const QString AttrWidth;
149 extern const QString AttrHeight;
150 extern const QString AttrPlaceLabelType;
151 extern const QString AttrVersion;
152 extern const QString AttrFirstToCountour;
153 extern const QString AttrLastToCountour;
154 extern const QString AttrNotes;
155 extern const QString AttrAlias;
156 extern const QString AttrAlias1;
157 extern const QString AttrAlias2;
158 extern const QString AttrCurve1Alias1;
159 extern const QString AttrCurve1Alias2;
160 extern const QString AttrCurve2Alias1;
161 extern const QString AttrCurve2Alias2;
162 
163 extern const QString TypeLineDefault;
164 extern const QString TypeLineNone;
165 extern const QString TypeLineLine;
166 extern const QString TypeLineDashLine;
167 extern const QString TypeLineDotLine;
168 extern const QString TypeLineDashDotLine;
169 extern const QString TypeLineDashDotDotLine;
170 
171 QStringList          StylesList();
172 Qt::PenStyle         LineStyleToPenStyle(const QString &typeLine);
173 QString              PenStyleToLineStyle(Qt::PenStyle penStyle);
174 QIcon                PenStylePic(Qt::PenStyle style);
175 QMap<QString, QIcon> LineStylesPics();
176 QMap<QString, QIcon> CurvePenStylesPics();
177 
178 extern const QString ColorDefault;
179 extern const QString ColorBlack;
180 extern const QString ColorGreen;
181 extern const QString ColorBlue;
182 extern const QString ColorDarkRed;
183 extern const QString ColorDarkGreen;
184 extern const QString ColorDarkBlue;
185 extern const QString ColorYellow;
186 extern const QString ColorLightSalmon;
187 extern const QString ColorGoldenRod;
188 extern const QString ColorOrange;
189 extern const QString ColorDeepPink;
190 extern const QString ColorViolet;
191 extern const QString ColorDarkViolet;
192 extern const QString ColorMediumSeaGreen;
193 extern const QString ColorLime;
194 extern const QString ColorDeepSkyBlue;
195 extern const QString ColorCornFlowerBlue;
196 
197 
198 // variables name
199 // Hacks for avoiding the linker error "undefined reference to"
200 #define SPL_ "Spl_"
201 #define ARC_ "Arc_"
202 #define ELARC_ "ElArc_"
203 
204 extern const QString measurement_;
205 extern const QString increment_;
206 extern const QString line_;
207 extern const QString angleLine_;
208 extern const QString arc_;
209 extern const QString elarc_;
210 extern const QString spl_;
211 extern const QString splPath;
212 extern const QString radius_V;
213 extern const QString radiusArc_;
214 extern const QString radius1ElArc_;
215 extern const QString radius2ElArc_;
216 extern const QString angle1_V;
217 extern const QString angle2_V;
218 extern const QString c1Length_V;
219 extern const QString c2Length_V;
220 extern const QString c1LengthSpl_;
221 extern const QString c2LengthSpl_;
222 extern const QString c1LengthSplPath;
223 extern const QString c2LengthSplPath;
224 extern const QString angle1Arc_;
225 extern const QString angle2Arc_;
226 extern const QString angle1ElArc_;
227 extern const QString angle2ElArc_;
228 extern const QString angle1Spl_;
229 extern const QString angle2Spl_;
230 extern const QString angle1SplPath;
231 extern const QString angle2SplPath;
232 extern const QString seg_;
233 extern const QString currentLength;
234 extern const QString currentSeamAllowance;
235 extern const QString rotation_V;
236 extern const QString rotationElArc_;
237 
238 extern const QStringList builInVariables;
239 
240 QT_WARNING_PUSH
241 QT_WARNING_DISABLE_GCC("-Weffc++")
242 
243 struct VLabelTemplateLine
244 {
245     QString line;
246     bool    bold;
247     bool    italic;
248     int     alignment;
249     int     fontSizeIncrement;
250 };
251 
252 struct VWatermarkData
253 {
254     int     opacity{20};
255     bool    showText{true};
256     QString text{};
257     int     textRotation{0};
258     QFont   font{};
259     bool    showImage{true};
260     QString path{};
261     int     imageRotation{0};
262     bool    grayscale{false};
263 };
264 
265 QT_WARNING_POP
266 
267 #endif // IFCDEF_H
268