Subversion Repositories Scribus

Rev

Rev 6369 | Rev 6454 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 1
/*
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.
6
*/
838 cbradney 7
#ifndef SCRIBUSSTRUCTS_H
8
#define SCRIBUSSTRUCTS_H
9
 
10
#ifdef HAVE_CONFIG_H
2688 craig 11
#include "scconfig.h"
838 cbradney 12
#endif
13
 
14
#include <qvaluestack.h>
15
#include <qvaluelist.h>
1429 subik 16
#include <qvaluevector.h>
838 cbradney 17
#include <qstring.h>
1208 cbradney 18
#include <qaction.h>
3933 avox 19
#include <qkeysequence.h>
839 cbradney 20
#include <vector>
838 cbradney 21
 
3878 cbradney 22
#include "sctextstruct.h"
838 cbradney 23
#include "scfonts.h"
24
#include "fpointarray.h"
25
#include "vgradient.h"
4084 cbradney 26
#include "annotation.h"
838 cbradney 27
#include "pageitem.h"
28
 
1065 cbradney 29
struct CopyPasteBuffer
1429 subik 30
{
1460 cbradney 31
        PageItem::ItemType PType;
844 fschmid 32
        double Xpos;
33
        double Ypos;
34
        double Width;
35
        double Height;
36
        double RadRect;
37
        int FrameType;
38
        bool ClipEdited;
39
        double Pwidth;
40
        QString Pcolor;
41
        QString Pcolor2;
42
        int Shade;
43
        int Shade2;
44
        QString GrColor;
45
        QString GrColor2;
46
        int GrShade;
47
        int GrShade2;
48
        VGradient fill_gradient;
49
        int GrType;
6369 fschmid 50
        QString pattern;
6414 fschmid 51
        double patternScaleX;
52
        double patternScaleY;
53
        double patternOffsetX;
54
        double patternOffsetY;
55
        double patternRotation;
844 fschmid 56
        double GrStartX;
57
        double GrStartY;
58
        double GrEndX;
59
        double GrEndY;
60
        QString TxtStroke;
61
        QString TxtFill;
62
        int ShTxtStroke;
63
        int ShTxtFill;
64
        int TxtScale;
2230 fschmid 65
        int TxtScaleV;
844 fschmid 66
        int TxTStyle;
2234 fschmid 67
        int TxTBase;
2247 fschmid 68
        int TxtShadowX;
69
        int TxtShadowY;
2257 fschmid 70
        int TxtOutline;
2262 fschmid 71
        int TxtUnderPos;
72
        int TxtUnderWidth;
2272 fschmid 73
        int TxtStrikePos;
74
        int TxtStrikeWidth;
844 fschmid 75
        double Rot;
76
        int PLineArt;
77
        int PLineJoin;
78
        int PLineEnd;
79
        double LineSp;
2309 fschmid 80
        int LineSpMode;
2382 fschmid 81
        int ExtraV;
844 fschmid 82
        double LocalScX;
83
        double LocalScY;
84
        double LocalX;
85
        double LocalY;
86
        bool PicArt;
1392 cbradney 87
        bool flippedH;
88
        bool flippedV;
844 fschmid 89
        bool isPrintable;
90
        bool isBookmark;
4084 cbradney 91
        bool m_isAnnotation;
92
        Annotation m_annotation;
93
        QString AnName;
844 fschmid 94
        double Extra;
95
        double TExtra;
96
        double BExtra;
97
        double RExtra;
98
        QString Pfile;
99
        QString Pfile2;
100
        QString Pfile3;
101
        QString IProfile;
102
        QString EmProfile;
103
        int IRender;
104
        bool UseEmbedded;
1065 cbradney 105
        QString itemText;
844 fschmid 106
        QPointArray Clip;
107
        FPointArray PoLine;
108
        FPointArray ContourLine;
109
        bool PoShow;
110
        double BaseOffs;
5620 jghali 111
        int TextflowMode;
1065 cbradney 112
        int textAlignment;
844 fschmid 113
        QString IFont;
114
        int ISize;
115
        QValueStack<int> Groups;
116
        int LayerNr;
117
        bool ScaleType;
118
        bool AspectRatio;
119
        bool Locked;
120
        bool LockRes;
121
        double Transparency;
122
        double TranspStroke;
5746 fschmid 123
        int TransBlend;
124
        int TransBlendS;
844 fschmid 125
        bool Reverse;
126
        QString NamedLStyle;
127
        QString Language;
128
        QString guiLanguage;
129
        int Cols;
130
        double ColGap;
5184 avox 131
        QValueList<ParagraphStyle::TabRecord> TabValues;
844 fschmid 132
        QValueList<double> DashValues;
133
        double DashOffset;
134
        bool isTableItem;
135
        bool TopLine;
136
        bool LeftLine;
137
        bool RightLine;
138
        bool BottomLine;
139
        int LeftLinkID;
140
        int RightLinkID;
141
        int TopLinkID;
142
        int BottomLinkID;
143
        int startArrowIndex;
144
        int endArrowIndex;
1655 cbradney 145
        ObjAttrVector pageItemAttributes;
844 fschmid 146
};
838 cbradney 147
 
4579 cbradney 148
struct CopyContentsBuffer
149
{
150
        PageItem::ItemType sourceType;
151
        QString contentsFileName;
152
        double LocalScX;
153
        double LocalScY;
154
        double LocalX;
155
        double LocalY;
4831 cbradney 156
        double ItemX;
157
        double ItemY;
4581 cbradney 158
        QString inputProfile;
159
        bool useEmbedded;
160
        int renderingIntent;
4579 cbradney 161
};
162
 
5087 subik 163
/** \brief Pagemargins */
1065 cbradney 164
struct MarginStruct
1429 subik 165
{
3987 craig 166
        MarginStruct() : Top(0), Left(0), Bottom(0), Right(0) {}
167
        MarginStruct(double top, double left, double bottom, double right) :
168
                Top(top), Left(left), Bottom(bottom), Right(right) {}
844 fschmid 169
        double Top;
170
        double Left;
3987 craig 171
        double Bottom;
844 fschmid 172
        double Right;
173
};
838 cbradney 174
 
5789 cbradney 175
struct DocPagesSetup
176
{
177
        DocPagesSetup() : pageArrangement(0), firstPageLocation(0), firstPageNumber(0), orientation(0), autoTextFrames(false), columnDistance(0), columnCount(1) {}
178
        DocPagesSetup(int pa, int fpl, int fpn, int o, bool atf, double cd, double cc) :
179
                pageArrangement(pa), firstPageLocation(fpl), firstPageNumber(fpn), orientation(o), autoTextFrames(atf),
180
                columnDistance(cd), columnCount(cc) {}
181
        int pageArrangement;
182
        int firstPageLocation;
183
        int firstPageNumber;
184
        int orientation;
185
        bool autoTextFrames;
186
        double columnDistance;
187
        double columnCount;
188
};
189
 
3016 fschmid 190
struct PageSet
191
{
192
        QString Name;
193
        int FirstPage;
194
        int Rows;
195
        int Columns;
196
        double GapHorizontal;
197
        double GapVertical;
198
        double GapBelow;
3026 fschmid 199
        QStringList pageNames;
3016 fschmid 200
};
201
 
1065 cbradney 202
struct CMSData
844 fschmid 203
{
204
        QString DefaultMonitorProfile;
205
        QString DefaultPrinterProfile;
2984 fschmid 206
        QString DefaultImageRGBProfile;
207
        QString DefaultImageCMYKProfile;
5345 mrdocs 208
        QString DefaultSolidColorRGBProfile;
209
        QString DefaultSolidColorCMYKProfile;
844 fschmid 210
        int ComponentsInput2;
5345 mrdocs 211
        int ComponentsInput3;
844 fschmid 212
        int ComponentsPrinter;
2984 fschmid 213
        int DefaultIntentImages;
5345 mrdocs 214
        int DefaultIntentColors;
844 fschmid 215
        bool CMSinUse;
216
        bool SoftProofOn;
5345 mrdocs 217
        bool SoftProofFullOn;
844 fschmid 218
        bool GamutCheck;
219
        bool BlackPoint;
220
} ;
838 cbradney 221
 
1065 cbradney 222
struct SingleLine
1429 subik 223
{
844 fschmid 224
        double Width;
225
        int Dash;
226
        int LineEnd;
227
        int LineJoin;
228
        QString Color;
229
        int Shade;
230
};
838 cbradney 231
 
1065 cbradney 232
struct ArrowDesc
844 fschmid 233
{
234
        QString name;
235
        bool userArrow;
236
        FPointArray points;
237
};
838 cbradney 238
 
844 fschmid 239
struct Layer
1429 subik 240
{
844 fschmid 241
        int LNr;
242
        int Level;
5572 fschmid 243
        int blendMode;
1065 cbradney 244
        bool isPrintable;
245
        bool isViewable;
4832 fschmid 246
        bool isEditable;
5359 fschmid 247
        bool flowControl;
5572 fschmid 248
        bool outlineMode;
5373 fschmid 249
        double transparency;
5572 fschmid 250
        QColor markerColor;
251
        QString Name;
844 fschmid 252
};
838 cbradney 253
 
1065 cbradney 254
struct PDFPresentationData
1429 subik 255
{
1065 cbradney 256
        int pageEffectDuration;
257
        int pageViewDuration;
258
        int effectType;
844 fschmid 259
        int Dm;
260
        int M;
261
        int Di;
262
};
838 cbradney 263
 
1065 cbradney 264
struct LPIData
1429 subik 265
{
844 fschmid 266
        int Frequency;
267
        int Angle;
268
        int SpotFunc;
269
};
838 cbradney 270
 
844 fschmid 271
struct Keys
1429 subik 272
{
1230 cbradney 273
        QString actionName;
1392 cbradney 274
        QString cleanMenuText;
3933 avox 275
        QKeySequence keySequence;
1392 cbradney 276
        int tableRow;
5352 cbradney 277
        QString menuName;
278
        int menuPos;
844 fschmid 279
};
838 cbradney 280
 
1429 subik 281
struct PrintOptions
844 fschmid 282
{
838 cbradney 283
        QString printer;
284
        QString filename;
285
        bool toFile;
286
        bool useAltPrintCommand;
287
        QString printerCommand;
288
        int PSLevel;
289
        bool outputSeparations;
290
        QString separationName;
3068 fschmid 291
        QStringList allSeparations;
292
        bool useSpotColors;
838 cbradney 293
        bool useColor;
294
        bool mirrorH;
295
        bool mirrorV;
296
        bool useICC;
297
        bool doGCR;
4649 fschmid 298
        bool doClip;
1861 fschmid 299
        bool setDevParam;
5308 fschmid 300
        bool doOverprint;
838 cbradney 301
        int copies;
302
        std::vector<int> pageNumbers;
303
        QString printerOptions;
304
};
305
 
844 fschmid 306
typedef QMap<QString,QString> ProfilesL;
1065 cbradney 307
typedef QValueVector<SingleLine> multiLine;
1460 cbradney 308
 
4512 cbradney 309
 
310
typedef enum {
311
        MissingGlyph=1,
312
        TextOverflow=2,
313
        ObjectNotOnPage=3,
314
        MissingImage=4,
315
        ImageDPITooLow=5,
316
        Transparency=6,
317
        PDFAnnotField=7,
5239 fschmid 318
        PlacedPDF=8,
5269 subik 319
        ImageDPITooHigh=9,
5674 fschmid 320
        ImageIsGIF=10,
321
        BlendMode=11
4512 cbradney 322
} PreflightError;
323
 
324
typedef QMap<PreflightError, int> errorCodes;
325
 
1065 cbradney 326
enum AppMode
327
{
2603 cbradney 328
        modeNormal,
329
        modeDrawShapes,
330
        modeStoryEditor,
331
        modeDrawPicture,
332
        modeDrawText,
333
        modeMagnifier,
334
        modeEdit,
335
        modeDrawLine,
336
        modeRotation,
337
        modeLinkFrames,
338
        modeUnlinkFrames,
339
        modeDrawRegularPolygon,
340
        modeDrawBezierLine,
341
        modeInsertPDFButton,
342
        modeInsertPDFTextfield,
343
        modeInsertPDFCheckbox,
344
        modeInsertPDFCombobox,
345
        modeInsertPDFListbox,
346
        modeInsertPDFTextAnnotation,
347
        modeInsertPDFLinkAnnotation,
348
        modeDrawFreehandLine,
349
        modeDrawTable,
350
        modePanning,
351
        modeMeasurementTool,
352
        modeEditGradientVectors,
353
        modeEyeDropper,
354
        modeCopyProperties
1065 cbradney 355
};
844 fschmid 356
 
2355 cbradney 357
struct AlignObjs
358
{
359
        int ObjNr;
360
        int Group;
361
        double x1;
362
        double y1;
363
        double x2;
364
        double y2;
2380 cbradney 365
        double width;
366
        double height;
2355 cbradney 367
        QPtrList<PageItem> Objects;
368
};
1641 cbradney 369
 
5087 subik 370
/*! \brief Human readable orientations */
3071 subik 371
enum PageOrientation
372
{
373
        portraitPage = 0,
374
        landscapePage = 1,
375
        customPage = 30
376
};
377
 
5087 subik 378
//! \brief Common type for guides list
379
typedef QValueList<double> Guides;
380
 
5642 cbradney 381
//! \brief from ols scribusXml
382
struct Linked
383
{
384
        int Start;
385
        int StPag;
386
};
387
 
388
// this is a quick hack to combine runs until I've thought of something better -- AV
389
class LastStyles {
390
public:
391
        CharStyle Style;
392
        int StyleStart;
393
        int ParaStyle;
394
        LastStyles() {
395
                StyleStart = 0;
396
                ParaStyle = -1;
397
        }
398
};
5789 cbradney 399
 
838 cbradney 400
#endif