Subversion Repositories Scribus

Rev

Rev 1973 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1972 craig 1
#ifndef PDFOPTIONS_H
2
#define PDFOPTIONS_H
3
 
4
/**
5
 * @file pdfoptions.h
6
 * @author Franz Schmidt
7
 * @author Craig Ringer
8
 * @brief Defines class PDFOptions, used for loading/saving/passing around PDF options
9
 */
10
 
11
#include "qstring.h"
12
#include "qmap.h"
13
#include "qvaluelist.h"
14
 
15
struct LPIData;
16
struct PDFPresentationData;
17
 
18
/**
19
 * @brief PDF Options struture. Capable of saving and loading to/from file and verifying its self.
20
 */
21
class PDFOptions
22
{
23
public:
24
        // Note: A default constructor, copy constructor, and
25
        // assignment operator must be defined so that this class
26
        // can be used as a value.
27
        // The automatically generated ones are quite sufficient.
28
        //PDFOptions();
29
        //PDFOptions(const PDFOptions& other);
30
        //PDFOptions& operator=(const PDFOptions& other);
31
        //~PDFOptions() {};
32
 
33
        enum VerifyResults
34
        {
35
                Verify_NoError = 0,
36
                Verify_OptionConflict,
37
                Verify_OptionOutOfRange,
38
                Verify_OtherError
39
        };
40
 
41
        /**
42
         * @author Craig Ringer
43
         * @brief Sanity check the options defined.
44
         *
45
         * Unimplemented, always returns Verify_OtherError
46
         *
47
         * Checks the PDF option structure for conflicts between mututally
48
         * exclusive options, ensures all options are within sane ranges,
49
         * and that there are no nonsensical options values set. If nothing
50
         * is wrong, returns Verify_NoError, otherwise returns error code from
51
         * PDFOptions::VerifyResults. If problemDescription is not NULL,
52
         * it will contain a human-readable description of the error on return.
53
         *
54
         * @warning DO NOT *EVER* TEST THE VALUE OF problemDescription. Rely on the
55
         *                      return code instead. problemDescription is subject to
56
         *                      translation and its contents may change without notice.
57
         *
58
         * @param problemDescription Error description
59
         * @return Verify_NoError for sane options, otherwise error code.
60
         */
61
        PDFOptions::VerifyResults verify(QString* problemDescription);
62
 
63
        /**
64
         * @author Craig Ringer
65
         * @brief Save the PDF settings to a file or other stream
66
         *
67
         * @warning unimplemented, always fails.
68
         *
69
         * @param outStream QTextStream to write output to.
70
         * @return True for success.
71
         */
72
        bool saveTo(QTextStream& outStream) const;
73
        bool saveTo(QString outFileName) const;
74
        bool saveTo(FILE* outFilePtr) const;
75
 
76
        /**
77
         * @author Craig Ringer
78
         * @brief Load the PDF settings from a file or other data stream, overwriting
79
         *        any current settings
80
         *
81
         * @warning unimplemented, always fails
82
         *
83
         * @warning on failure, struct contents are undefined.
84
         *
85
         * @param inStream QTextStream to settings data from.
86
         * @return True for success.
87
         */
88
        bool readFrom(QTextStream& inStream);
89
        bool readFrom(QString inFileName);
90
        bool readFrom(FILE* inFilePtr);
91
 
92
        bool Thumbnails;
93
        bool Articles;
94
        bool useLayers;
95
        bool Compress;
96
        int CompressMethod;
97
        int Quality;
98
        bool RecalcPic;
99
        bool Bookmarks;
100
        int PicRes;
101
        int Version;
102
        int Resolution;
103
        int Binding;
104
        QValueList<QString> EmbedList;
105
        QValueList<QString> SubsetList;
106
        bool MirrorH;
107
        bool MirrorV;
108
        int RotateDeg;
109
        bool PresentMode;
110
        QValueList<PDFPresentationData> PresentVals;
111
        QString Datei;
112
        bool isGrayscale;
113
        bool UseRGB;
114
        bool UseProfiles;
115
        bool UseProfiles2;
116
        bool UseLPI;
117
        QMap<QString,LPIData> LPISettings;
118
        QString SolidProf;
119
        int SComp;
120
        QString ImageProf;
121
        bool EmbeddedI;
122
        int Intent2;
123
        QString PrintProf;
124
        QString Info;
125
        int Intent;
126
        double BleedTop;
127
        double BleedLeft;
128
        double BleedRight;
129
        double BleedBottom;
130
        bool Encrypt;
131
        QString PassOwner;
132
        QString PassUser;
133
        int Permissions;
134
};
135
 
136
#endif