2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
14
#include "scribusapi.h"
16
#ifdef NLS_CONFORMANCE
17
#define NLS_PRIVATE private
19
#define NLS_PRIVATE public
27
/* Struktur fuer Pageitem Text */
34
* Created by Andreas Vox on 29.07.05.
35
* Copyright 2005 under GPL2. All rights reserved.
41
ScStyle_Superscript = 1,
44
ScStyle_Underline = 8,
45
ScStyle_Strikethrough = 16,
47
ScStyle_SmallCaps = 64,
48
ScStyle_HyphenationPossible=128, //Hyphenation possible here (Smart Hyphen)
49
ScStyle_Shadowed = 256,
50
ScStyle_UnderlineWords=512,
51
ScStyle_Reserved01 = 1024, //free, not used in the moment
52
ScStyle_DropCap = 2048,
53
ScStyle_SuppressSpace = 4096,//internal use in PageItem (Suppresses spaces when in Block alignment)
54
ScStyle_SmartHyphenVisible=8192, //Smart Hyphen visible at line end
55
ScStyle_StartOfLine = 16384,
56
ScStyle_UserStyles = 1919
60
class SCRIBUS_API CharStyle {
62
static const short NOVALUE = -16000;
63
static const QString NOCOLOR;
77
cunderwidth = NOVALUE;
79
cstrikewidth = NOVALUE;
87
CharStyle(Foi * font, int size, int style = ScStyle_Default) {
109
CharStyle(const CharStyle & other);
111
bool operator==(const CharStyle & other) const;
112
bool operator!=(const CharStyle & other) const { return ! (*this==other); }
113
CharStyle & operator=(const CharStyle & other);
115
void applyStyle(const CharStyle & other);
116
void eraseStyle(const CharStyle & other);
122
short cstyle; // see enum StyleFlag
141
inline bool CharStyle::operator==(const CharStyle & other) const
143
return (csize == other.csize &&
144
cshade == other.cshade &&
145
cshade2 == other.cshade2 &&
146
cstyle == other.cstyle &&
147
cscale == other.cscale &&
148
cscalev == other.cscalev &&
149
cbase == other.cbase &&
150
cshadowx == other.cshadowx &&
151
cshadowy == other.cshadowy &&
152
coutline == other.coutline &&
153
cunderpos == other.cunderpos &&
154
cunderwidth == other.cunderwidth &&
155
cstrikepos == other.cstrikepos &&
156
cstrikewidth == other.cstrikewidth &&
157
cextra == other.cextra &&
158
cfont == other.cfont &&
159
ccolor == other.ccolor &&
160
cstroke == other.cstroke );
163
inline CharStyle & CharStyle::operator=(const CharStyle & other)
166
cshade = other.cshade;
167
cshade2 = other.cshade2;
168
cstyle = other.cstyle;
169
cscale = other.cscale;
170
cscalev = other.cscalev;
172
cshadowx = other.cshadowx;
173
cshadowy = other.cshadowy;
174
coutline = other.coutline;
175
cunderpos = other.cunderpos;
176
cunderwidth = other.cunderwidth;
177
cstrikepos = other.cstrikepos;
178
cstrikewidth = other.cstrikewidth;
179
cextra = other.cextra;
181
ccolor = other.ccolor;
182
cstroke = other.cstroke;
186
inline CharStyle::CharStyle(const CharStyle & other)
189
cshade = other.cshade;
190
cshade2 = other.cshade2;
191
cstyle = other.cstyle;
192
cscale = other.cscale;
193
cscalev = other.cscalev;
195
cshadowx = other.cshadowx;
196
cshadowy = other.cshadowy;
197
coutline = other.coutline;
198
cunderpos = other.cunderpos;
199
cunderwidth = other.cunderwidth;
200
cstrikepos = other.cstrikepos;
201
cstrikewidth = other.cstrikewidth;
202
cextra = other.cextra;
204
ccolor = other.ccolor;
205
cstroke = other.cstroke;
209
inline void CharStyle::applyStyle(const CharStyle & other)
211
if (other.csize != NOVALUE)
213
if (other.cshade != NOVALUE)
214
cshade = other.cshade;
215
if (other.cshade2 != NOVALUE)
216
cshade2 = other.cshade2;
217
if (other.cstyle != NOVALUE)
218
cstyle = (cstyle & ScStyle_UserStyles) | (other.cstyle & ScStyle_UserStyles);
219
if (other.cscale != NOVALUE)
220
cscale = other.cscale;
221
if (other.cscalev != NOVALUE)
222
cscalev = other.cscalev;
223
if (other.cbase != NOVALUE)
225
if (other.cshadowx != NOVALUE)
226
cshadowx = other.cshadowx;
227
if (other.cshadowy != NOVALUE)
228
cshadowy = other.cshadowy;
229
if (other.coutline != NOVALUE)
230
coutline = other.coutline;
231
if (other.cunderpos != NOVALUE)
232
cunderpos = other.cunderpos;
233
if (other.cunderwidth != NOVALUE)
234
cunderwidth = other.cunderwidth;
235
if (other.cstrikepos != NOVALUE)
236
cstrikepos = other.cstrikepos;
237
if (other.cstrikewidth != NOVALUE)
238
cstrikewidth = other.cstrikewidth;
239
if (other.cextra != NOVALUE)
240
cextra = other.cextra;
241
if (other.cfont != NULL)
243
if (other.ccolor != NOCOLOR)
244
ccolor = other.ccolor;
245
if (other.cstroke != NOCOLOR)
246
cstroke = other.cstroke;
249
inline void CharStyle::eraseStyle(const CharStyle & other)
251
if (other.csize == csize)
253
if (other.cshade == cshade)
255
if (other.cshade2 == cshade2)
257
if ((other.cstyle & ScStyle_UserStyles) == (cstyle & ScStyle_UserStyles))
259
if (other.cscale == cscale)
261
if (other.cscalev == cscalev)
263
if (other.cbase == cbase)
265
if (other.cshadowx == cshadowx)
267
if (other.cshadowy == cshadowy)
269
if (other.coutline == coutline)
271
if (other.cunderpos == cunderpos)
273
if (other.cunderwidth == cunderwidth)
274
cunderwidth = NOVALUE;
275
if (other.cstrikepos == cstrikepos)
276
cstrikepos = NOVALUE;
277
if (other.cstrikewidth == cstrikewidth)
278
cstrikewidth = NOVALUE;
279
if (other.cextra == cextra)
281
if (other.cfont == cfont)
283
if (other.ccolor == ccolor)
285
if (other.cstroke == cstroke)
291
class SCRIBUS_API ScText : public CharStyle
304
#endif // SCTEXTSTRUCT_H