Subversion Repositories Scribus

Rev

Rev 18491 | Rev 19584 | 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
*/
2832 cbradney 7
#ifndef PREFSSTRUCTS_H
8
#define PREFSSTRUCTS_H
9
 
10
#ifdef HAVE_CONFIG_H
11
#include "scconfig.h"
12
#endif
13
 
17223 jghali 14
#include <cstring>
15
 
10170 fschmid 16
#include <QColor>
17
#include <QString>
9803 fschmid 18
#include <QList>
10170 fschmid 19
#include <QSet>
20
#include <QHash>
17223 jghali 21
 
22
#include "documentinformation.h"
15037 cbradney 23
#include "pagestructs.h"
2969 craig 24
#include "pdfoptions.h"
2832 cbradney 25
#include "scfonts.h"
16016 fschmid 26
#include "scpattern.h"
14150 fschmid 27
#include "vgradient.h"
2832 cbradney 28
 
13889 cbradney 29
struct CheckerPrefs
2832 cbradney 30
{
18410 jghali 31
        CheckerPrefs() {
32
                memset(this, 0, sizeof(CheckerPrefs));
33
        }
34
 
13955 cbradney 35
        bool ignoreErrors;
36
        bool autoCheck;
37
        bool checkGlyphs;
38
        bool checkOverflow;
39
        bool checkOrphans;
40
        bool checkPictures;
41
        bool checkResolution;
42
        double minResolution;
43
        double maxResolution;
44
        bool checkTransparency;
45
        bool checkAnnotations;
46
        bool checkRasterPDF;
47
        bool checkForGIF;
48
        bool ignoreOffLayers;
14541 cbradney 49
        bool checkOffConflictLayers; //Check whether layers are marked as visible but not to be printed or vice versa
14043 jghali 50
        bool checkNotCMYKOrSpot; // colors must be either CMYK or spot (PDF/X-1a)
18410 jghali 51
        bool checkDeviceColorsAndOutputIntent; // unmanaged colors (device colors) must agree with output intend
14043 jghali 52
        bool checkFontNotEmbedded; // embedded PDF might use fonts without embedding
53
        bool checkFontIsOpenType; // embedded PDF might use OpenType font program (only allowed in PDF/X-4 and PDF 1.6)
16357 petr 54
        bool checkPartFilledImageFrames;
18485 craig 55
        bool checkOppositePageMaster;
18490 craig 56
        bool checkAppliedMasterDifferentSide;
18491 craig 57
        bool checkEmptyTextFrames;
2832 cbradney 58
};
59
 
13889 cbradney 60
typedef QMap<QString, CheckerPrefs> CheckerPrefsList;
3082 fschmid 61
 
14849 cbradney 62
struct VerifierPrefs
63
{
64
        CheckerPrefsList checkerPrefsList;
65
        bool showPagesWithoutErrors;
14850 cbradney 66
        bool showNonPrintingLayerErrors;
14849 cbradney 67
        QString curCheckProfile;
68
};
69
 
13889 cbradney 70
struct TypoPrefs
2832 cbradney 71
{
13955 cbradney 72
        int valueSuperScript; //! Displacement of superscript
73
        int scalingSuperScript; //! Scaling of superscript
74
        int valueSubScript; //! Displacement of subscript
75
        int scalingSubScript; //! Scaling of subscript
76
        int valueSmallCaps; //! Scaling of small caps
77
        int autoLineSpacing; //! Automatic line spacing percentage
78
        int valueUnderlinePos; //! Underline displacement
79
        int valueUnderlineWidth; //! Underline width
80
        int valueStrikeThruPos; //! Strike-through displacement
81
        int valueStrikeThruWidth; //! Strike-through line width
17223 jghali 82
 
83
        inline bool operator==(const TypoPrefs &other)
84
        {
85
                return (memcmp(this, &other, sizeof(TypoPrefs)) == 0);
86
        }
87
        inline bool operator!=(const TypoPrefs &other)
88
        {
89
                return (memcmp(this, &other, sizeof(TypoPrefs)) != 0);
90
        }
2832 cbradney 91
};
92
 
13889 cbradney 93
struct WindowPrefs
2832 cbradney 94
{
13955 cbradney 95
        int xPosition;
96
        int yPosition;
97
        int width;
98
        int height;
99
        bool visible;
100
        bool docked;
101
        bool maximized;
2832 cbradney 102
};
103
 
13876 cbradney 104
//User Interface
105
struct UIPrefs
106
{
13955 cbradney 107
        int mouseMoveTimeout; //! Mouse move timeout for move/resize operations
108
        int wheelJump; //! Distance to jump with mouse wheel scrolling
109
        int applicationFontSize; //! Font size to use in the application, apart from p├čalettes
13967 cbradney 110
        int paletteFontSize; //! Font size to use in the palettes
13955 cbradney 111
        QString style;  //! Currently used QStyle name
112
        int recentDocCount; //! Number of recent documents to remember
13967 cbradney 113
        QStringList RecentDocs; //! List of recent documents
13955 cbradney 114
        QString language; //! Language of the user interface
115
        bool useSmallWidgets; //! Use small widgets in the palettes
16357 petr 116
        bool useTabs;            //! Use a tabbed MainWidget a la FireFox 
13955 cbradney 117
        bool showStartupDialog; //! Whether to show the startup dialog or not
14203 cbradney 118
        bool showSplashOnStartup; //! Whether to show the splashscreen or not
13967 cbradney 119
        bool stickyTools; //! Whether a user's tool section remains after use or the normal tool is reselected
120
        bool grayscaleIcons; //! Show icons in toolbars as grayscale
13955 cbradney 121
        WindowPrefs mainWinSettings;
122
        QByteArray mainWinState;
13876 cbradney 123
};
124
 
125
//Paths
126
struct PathPrefs
127
{
13955 cbradney 128
        QString documents; //! Default document location
129
        QString colorProfiles; //! Default color profile location
130
        QString scripts; //! Default script location
131
        QString documentTemplates; //! Default document template location
13876 cbradney 132
};
133
 
134
//Document Setup
135
struct DocumentSetupPrefs
136
{
13955 cbradney 137
        QString pageSize; //! Default page size of a document
138
        int pageOrientation; //! Default orientation of the page
139
        double pageWidth; //! Width of a page
140
        double pageHeight; //! Height of a page
141
        MarginStruct margins; //! Margins for a page
142
        MarginStruct bleeds; //! Bleeds for a page
143
        int marginPreset; //! Use a preset ratio margin setup
144
        int pagePositioning; //! Show pages in 1,2,3,4 pages side by side on screen
145
        int docUnitIndex; //! The index of the default unit
13967 cbradney 146
        bool AutoSave;
147
        int AutoSaveTime;
14762 cbradney 148
        bool saveCompressed;
13876 cbradney 149
};
150
 
13889 cbradney 151
//Guides
152
struct GuidesPrefs
153
{
16990 fschmid 154
        QList<int> renderStackOrder;
155
        // render stack id 0 = PageMargins
156
        // render stack id 1 = BaselineGrid
157
        // render stack id 2 = Grid
158
        // render stack id 3 = Guides
159
        // render stack id 4 = Items
16992 fschmid 160
        int gridType;
161
        // type 0 lines
162
        // type 1 crosses and dots
13889 cbradney 163
 
13955 cbradney 164
        int grabRadius;
165
        double guideRad;
13889 cbradney 166
 
13955 cbradney 167
        bool guidesShown; //! Show the guides or not
168
        bool marginsShown; //! Show the margins or not
169
        bool gridShown; //! Show the grid or not
170
        bool baselineGridShown; //! Show the baseline grid or not
171
        bool framesShown; //! Show frame borders or not
172
        bool colBordersShown; //! Show text frame column borders or not
173
        bool layerMarkersShown; //! Show a layer indicator when layers are active or not
174
        bool linkShown; //! Show text frame links or not
175
        bool rulersShown; //! Show the page rulers or not
13889 cbradney 176
 
13955 cbradney 177
        double majorGridSpacing; //! Major grid spacing
178
        double minorGridSpacing; //! Minor grid spacing
179
        double valueBaselineGrid; //! Baseline grid spacing
180
        double offsetBaselineGrid; //! Offset of first line of baseline grid from top of page
13889 cbradney 181
 
13955 cbradney 182
        bool showPic;
183
        bool showControls;
184
        bool showBleed;
185
        bool rulerMode;
13889 cbradney 186
 
187
 
188
 
13955 cbradney 189
        QColor guideColor; //! Color of guides
190
        QColor marginColor; //! Color of margins
191
        QColor majorGridColor; //! Color of major grid
192
        QColor minorGridColor; //! Color of minor grid
193
        QColor baselineGridColor; //! Color of baseline grid
13889 cbradney 194
};
195
 
13953 cbradney 196
struct ItemToolPrefs
197
{
13955 cbradney 198
        /* Texttool */
14014 cbradney 199
        QString textFont; //! Default font for text frames, should be default font for default style
200
        int textSize; //! Default font size
201
        QString textColor; //! Default text color
202
        int textShade; //! Default text color shade
203
        QString textStrokeColor; //! Default text stroke color
204
        int textStrokeShade; //! Default text stroke color shade
205
        QString textFillColor; //! Default text frame fill color
206
        QString textLineColor; //! Default text frame line color
207
        int textFillColorShade; //! Default text frame fill shade
208
        int textLineColorShade; //! Default text frame line shade
209
        int textColumns; //! Default number of columns in a text frame
210
        double textColumnGap; //! Default gap between columns of a text frame
211
        QString textTabFillChar; //! Default tab fill character
15138 cbradney 212
        MarginStruct textDistances; //! Default text to frame distances
14014 cbradney 213
        double textTabWidth; //! Default tab width
13955 cbradney 214
        /* ShapeTool */
14014 cbradney 215
        QString shapeLineColor; //! Default shape line color
216
        QString shapeFillColor; //! Default shape fill color
217
        int shapeFillColorShade; //! Default shape fill color shade
218
        int shapeLineColorShade; //! Default shape line color shade
219
        int shapeLineStyle; //! Line style of shapes
220
        double shapeLineWidth; //! Line width of shape
13955 cbradney 221
        /* Line Tool */
14014 cbradney 222
        QString lineColor; //! Color of a line
223
        int lineColorShade; //! Shade of line color
224
        double lineWidth; //! Width of line
225
        int lineStyle; //! Style of line
226
        int lineStartArrow; //! Starting arrow, 0 = none
227
        int lineEndArrow; //! Ending arrow, 0 = none
13955 cbradney 228
        /* Regular Polygon Tool */
13996 cbradney 229
        int polyCorners;  //! Number of corners for a polygon
14022 cbradney 230
        double polyFactor; //! Convex/Concave factor as a double
13996 cbradney 231
        bool polyUseFactor; //! Whether to use a factor for shaping
232
        double polyRotation; //! Rotation of a polygon
16191 fschmid 233
        double polyInnerRot; //! Rotation of the inner points of a star
13996 cbradney 234
        double polyCurvature; //! Curvature of polygon
16192 fschmid 235
        double polyOuterCurvature; //! outer Curvature of polygon
13996 cbradney 236
        /* Image Tool */
14014 cbradney 237
        QString imageFillColor; //! Default fill color of an image frame
238
        int imageFillColorShade; //! Default shade of fill color of an image grame
17054 fschmid 239
        QString imageStrokeColor; //! Default stroke color of an image frame
240
        int imageStrokeColorShade; //! Default shade of stroke color of an image grame
14014 cbradney 241
        double imageScaleX; //! X scale of an image within an image frame
242
        double imageScaleY; //! Y scale of an image within an image frame
243
        bool imageScaleType; //! Scale type of image
244
        bool imageAspectRatio; //! Use stored aspect ratio for the image
245
        int imageLowResType; //! Preview type for an image frame
246
        bool imageUseEmbeddedPath; //! Use embedded path, eg from an EPS etc.
15847 fschmid 247
        /* Calligraphic Pen Tool */
19378 craig 248
        QString calligraphicPenFillColor; //! Default calligrapicPen fill color
249
        QString calligraphicPenLineColor; //! Default calligrapicPen line color
250
        int calligraphicPenFillColorShade; //! Default calligrapicPen fill shade
251
        int calligraphicPenLineColorShade; //! Default calligrapicPen line shade
252
        double calligraphicPenLineWidth; //! Width of line
253
        double calligraphicPenAngle;            //! Angle of the calligraphics Brush
254
        double calligraphicPenWidth;            //! Width of the calligraphics Brush
255
        int calligraphicPenStyle; //! Line style of the calligraphics Brush
16215 fschmid 256
        /* Arc Tool */
16357 petr 257
        double arcStartAngle;   //! angle where the arc starts
258
        double arcSweepAngle;   //! angle the arc spans
16311 fschmid 259
        /* Spiral Tool */
16357 petr 260
        double spiralStartAngle;        //! angle where the spiral starts
261
        double spiralEndAngle;  //! angle where the spiral ends
16311 fschmid 262
        double spiralFactor;    //! factor the spiral gets smaller
13953 cbradney 263
};
13889 cbradney 264
 
13953 cbradney 265
struct OperatorToolPrefs
266
{
13955 cbradney 267
        /* Magnifier Tool */
13967 cbradney 268
        int magMin; //! Magnification minimum
269
        int magMax; //! Magnification maximum
270
        int magStep; //! Default step between magnification levels
13955 cbradney 271
        /* Item Duplicate Offset */
272
        double dispX;
273
        double dispY;
274
        /* Rotation Tool constrain value */
13967 cbradney 275
        double constrain; //! Angle to constrain rotation to when constraining is active
13953 cbradney 276
};
277
 
13955 cbradney 278
struct HyphenatorPrefs
2832 cbradney 279
{
13967 cbradney 280
        int MinWordLen; //! Minimum word length to hyphenate
281
        int HyCount; //! Maximum number of consecutive rows to hyphenate
282
        QString Language; //! Language to use for hyphenation
283
        QHash<QString, QString> specialWords; //! List of special words to hyphenate
284
        QSet<QString> ignoredWords; //! List of words the hyphenator ignores
13955 cbradney 285
        bool Automatic;
286
        bool AutoCheck;
287
};
13870 cbradney 288
 
13955 cbradney 289
struct FontPrefs
290
{
13967 cbradney 291
        SCFonts AvailFonts; //! Fonts that Scribus has available to it, or the current document has available to use
292
        bool askBeforeSubstitute; //! Request that the user confirms a font substituion or not
293
        QMap<QString,QString> GFontSub;
13955 cbradney 294
};
13870 cbradney 295
 
13955 cbradney 296
struct PrinterPrefs
297
{
13967 cbradney 298
        QString PrinterName; //! Default Printer name (source from CUPS)
299
        QString PrinterFile; //! File to print to
300
        QString PrinterCommand; //! Special printer command to use
301
        bool ClipMargin; //! When printing, clip the print job to the margins
302
        bool GCRMode;
13955 cbradney 303
};
13870 cbradney 304
 
13967 cbradney 305
struct ColorPrefs
13955 cbradney 306
{
13967 cbradney 307
        ColorList DColors;
308
        QString DColorSet;
309
        CMSData DCMSset;
13955 cbradney 310
};
13870 cbradney 311
 
13955 cbradney 312
struct ItemAttrPrefs
313
{
13967 cbradney 314
        ObjAttrVector defaultItemAttributes; //! The default item attributes
13955 cbradney 315
};
13876 cbradney 316
 
13955 cbradney 317
struct TOCPrefs
318
{
13967 cbradney 319
        ToCSetupVector defaultToCSetups; //! Default Tables of Contents
13955 cbradney 320
};
2832 cbradney 321
 
13955 cbradney 322
struct KeyboardShortcutsPrefs
323
{
13967 cbradney 324
        QMap<QString,Keys> KeyActions; //! Keyboard Shortcuts lists for the ScrActions
13955 cbradney 325
};
13876 cbradney 326
 
13955 cbradney 327
struct ScrapbookPrefs
328
{
13967 cbradney 329
        QStringList RecentScrapbooks; //! List of recently used scrapbooks
13955 cbradney 330
        int numScrapbookCopies;
13967 cbradney 331
        bool doCopyToScrapbook; //! When copying (copy/paste), also copy to a scrapbook
332
        bool persistentScrapbook; //! Keep the scrapbook contents between sessions
14715 fschmid 333
        bool writePreviews;             //! Write previews to the scrapbook dir;
13955 cbradney 334
};
13870 cbradney 335
 
13955 cbradney 336
struct DisplayPrefs
337
{
13974 cbradney 338
        bool marginColored; //! Indicates if the margin to edge of page area will be colored in some other color or not
339
        bool showPageShadow; //! Show a shadow around the pages
340
        QColor paperColor; //! Color of paper (onscreen only)
15139 cbradney 341
        QColor scratchColor; //! Color of scratch space (onscreen only)
13974 cbradney 342
        QColor frameColor; //! Color of frame border (onscreen only)
343
        QColor frameNormColor; //! Color of normal frame border (onscreen only)
344
        QColor frameGroupColor; //! Color of border of grouped frames (onscreen only)
345
        QColor frameLinkColor; //! Color of frame link indicators (onscreen only)
346
        QColor frameLockColor; //! Color of locked frame border (onscreen only)
347
        QColor frameAnnotationColor; //! Color of annotation frames border (onscreen only)
348
        QColor pageBorderColor; //! Color of page border (onscreen only)
349
        QColor controlCharColor; //! Color of control characters in text frames if they are shown (onscreen only)
350
        bool showToolTips; //! Show tool tips in the GUI or not.
351
        bool showMouseCoordinates; //! Show mouse coordinates when interaction with frames
352
        MarginStruct scratch; //! Scratch space distances
353
        double pageGapHorizontal; //! Horizontal gap between pages
354
        double pageGapVertical; //! Vertical gap between pages
355
        double displayScale; //! Display scale, typically used to set the scale of the display to 100% of real values.
14811 cbradney 356
        bool showVerifierWarningsOnCanvas; //! Show preflight verifier warnings on canvas
17805 fschmid 357
        bool showAutosaveClockOnCanvas; //! Show autosave countdown on canvas
13955 cbradney 358
};
13876 cbradney 359
 
13955 cbradney 360
struct ExternalToolsPrefs
361
{
13974 cbradney 362
        QString gs_exe; //! Location on the system of the Ghostscript interpreter (gs, gswin32c.exe, etc) incl path
363
        bool gs_AntiAliasText; //! Tell Ghostscript to antialias text or not
364
        bool gs_AntiAliasGraphics; //! Tell Ghostscript to antialias graphics or not
365
        int gs_Resolution; //! Resolution of Ghostscript rendered graphics
13996 cbradney 366
        QString imageEditorExecutable; //! Editor for graphics, defaults to Gimp
367
        QString extBrowserExecutable; //! External browser for launching URLs in
368
        QString uniconvExecutable; //! Uniconverter executable location
13955 cbradney 369
        QStringList latexConfigs;
370
        QMap<QString, QString> latexCommands;
13996 cbradney 371
        QString latexEditorExecutable; //! LaTeX executable location
372
        int latexResolution; //! LaTeX export resolution
13955 cbradney 373
        bool latexForceDpi;
374
        bool latexStartWithEmptyFrames;
15130 cbradney 375
        QString pdfViewerExecutable; //! Viewer for PDF files
13955 cbradney 376
};
13870 cbradney 377
 
13955 cbradney 378
struct MiscellaneousPrefs
379
{
13996 cbradney 380
        bool haveStylePreview; //! Show previews in the Style setup areas like Style Manager
13876 cbradney 381
 
13955 cbradney 382
        // lorem ipsum
13996 cbradney 383
        bool useStandardLI; //! Use the standard Lorem Ipsum text
384
        int paragraphsLI; //! Number of paragraphs to insert with Lorem Ipsum text
13955 cbradney 385
};
13870 cbradney 386
 
13967 cbradney 387
struct StoryEditorPrefs
388
{
14823 cbradney 389
        QColor guiFontColorBackground; //! Color of the background for text used in the Story Editor window
13996 cbradney 390
        QString guiFont; //! Font of the text used in the Story Editor window
14823 cbradney 391
        bool smartTextSelection; //! Use smart text selection (relates to spacing mostly)
13967 cbradney 392
};
393
 
394
struct PrintPreviewPrefs
395
{
396
        bool PrPr_Mode;
397
        bool PrPr_AntiAliasing;
398
        bool PrPr_Transparency;
399
        bool PrPr_C;
400
        bool PrPr_M;
401
        bool PrPr_Y;
402
        bool PrPr_K;
403
        bool PrPr_InkCoverage;
404
        int PrPr_InkThreshold;
405
};
406
 
13955 cbradney 407
struct PluginPrefs
408
{
409
};
13870 cbradney 410
 
13955 cbradney 411
struct ShortWordPrefs
412
{
413
};
13953 cbradney 414
 
13955 cbradney 415
struct ScripterPrefs
416
{
2832 cbradney 417
};
418
 
14539 jghali 419
// Image Cache
420
struct ImageCachePrefs
421
{
16357 petr 422
        bool cacheEnabled;      //!< Enable the image cache
14539 jghali 423
        int maxCacheSizeMiB;  //!< Maximum total size of image cache in MiB
424
        int maxCacheEntries;  //!< Maximum number of cache entries
425
        int compressionLevel; //!< Cache image compression level (see QImage)
426
};
427
 
13955 cbradney 428
struct ApplicationPrefs
429
{
15037 cbradney 430
        ColorPrefs colorPrefs;
431
        DisplayPrefs displayPrefs;
13955 cbradney 432
        DocumentSetupPrefs docSetupPrefs;
15037 cbradney 433
        ExternalToolsPrefs extToolPrefs;
434
        FontPrefs fontPrefs;
13955 cbradney 435
        GuidesPrefs guidesPrefs;
436
        HyphenatorPrefs hyphPrefs;
15037 cbradney 437
        ImageCachePrefs imageCachePrefs;
13955 cbradney 438
        ItemAttrPrefs itemAttrPrefs;
15037 cbradney 439
        ItemToolPrefs itemToolPrefs;
13955 cbradney 440
        KeyboardShortcutsPrefs keyShortcutPrefs;
441
        MiscellaneousPrefs miscPrefs;
15037 cbradney 442
        OperatorToolPrefs opToolPrefs;
443
        PDFOptions pdfPrefs;
444
        PathPrefs pathPrefs;
13955 cbradney 445
        PluginPrefs pluginPrefs;
15037 cbradney 446
        PrintPreviewPrefs printPreviewPrefs;
447
        PrinterPrefs printerPrefs;
448
        ScrapbookPrefs scrapbookPrefs;
449
        ScripterPrefs scripterPrefs;
13955 cbradney 450
        ShortWordPrefs shortwordPrefs;
15037 cbradney 451
        StoryEditorPrefs storyEditorPrefs;
452
        TOCPrefs tocPrefs;
453
        TypoPrefs typoPrefs;
454
        UIPrefs uiPrefs;
14849 cbradney 455
        VerifierPrefs verifierPrefs;
13955 cbradney 456
 
457
        QList<ArrowDesc> arrowStyles;
17400 fschmid 458
        QHash<QString, VGradient> defaultGradients;
459
        QHash<QString, ScPattern> defaultPatterns;
13955 cbradney 460
        QList<PageSet> pageSets;
15105 cbradney 461
        QStringList activePageSizes;
13955 cbradney 462
 
463
 
14849 cbradney 464
 
13955 cbradney 465
        //TODO : Remove these no longer used items
466
        //! System default QStyle name for current instance, seemingly unused
467
        QString ui_SystemTheme;
13967 cbradney 468
        //      bool Gcr_Mode;
15037 cbradney 469
 
470
        //Added for Doc Only
471
        DocumentInformation docInfo;
472
        DocumentSectionMap docSectionMap;
13955 cbradney 473
};
474
 
2832 cbradney 475
#endif