Subversion Repositories Scribus

Rev

Rev 1972 | Rev 2030 | Go to most recent revision | Details | Compare with Previous | 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
 
1973 craig 41
        enum PDFVersion
42
        {
43
                PDFVersion_13 = 13,
44
                PDFVersion_14 = 14,
45
                PDFVersion_15 = 15,
46
                PDFVersion_X3 = 12,
47
        };
48
 
1972 craig 49
        /**
50
         * @author Craig Ringer
51
         * @brief Sanity check the options defined.
52
         *
53
         * Unimplemented, always returns Verify_OtherError
54
         *
55
         * Checks the PDF option structure for conflicts between mututally
56
         * exclusive options, ensures all options are within sane ranges,
57
         * and that there are no nonsensical options values set. If nothing
58
         * is wrong, returns Verify_NoError, otherwise returns error code from
59
         * PDFOptions::VerifyResults. If problemDescription is not NULL,
60
         * it will contain a human-readable description of the error on return.
61
         *
62
         * @warning DO NOT *EVER* TEST THE VALUE OF problemDescription. Rely on the
63
         *                      return code instead. problemDescription is subject to
64
         *                      translation and its contents may change without notice.
65
         *
66
         * @param problemDescription Error description
67
         * @return Verify_NoError for sane options, otherwise error code.
68
         */
69
        PDFOptions::VerifyResults verify(QString* problemDescription);
70
 
71
        /**
72
         * @author Craig Ringer
73
         * @brief Save the PDF settings to a file or other stream
74
         *
75
         * @warning unimplemented, always fails.
76
         *
77
         * @param outStream QTextStream to write output to.
78
         * @return True for success.
79
         */
80
        bool saveTo(QTextStream& outStream) const;
81
        bool saveTo(QString outFileName) const;
82
        bool saveTo(FILE* outFilePtr) const;
83
 
84
        /**
85
         * @author Craig Ringer
86
         * @brief Load the PDF settings from a file or other data stream, overwriting
87
         *        any current settings
88
         *
89
         * @warning unimplemented, always fails
90
         *
91
         * @warning on failure, struct contents are undefined.
92
         *
93
         * @param inStream QTextStream to settings data from.
94
         * @return True for success.
95
         */
96
        bool readFrom(QTextStream& inStream);
97
        bool readFrom(QString inFileName);
98
        bool readFrom(FILE* inFilePtr);
99
 
100
        bool Thumbnails;
101
        bool Articles;
102
        bool useLayers;
103
        bool Compress;
104
        int CompressMethod;
105
        int Quality;
106
        bool RecalcPic;
107
        bool Bookmarks;
108
        int PicRes;
1973 craig 109
        PDFVersion Version;
1972 craig 110
        int Resolution;
111
        int Binding;
112
        QValueList<QString> EmbedList;
113
        QValueList<QString> SubsetList;
114
        bool MirrorH;
115
        bool MirrorV;
116
        int RotateDeg;
117
        bool PresentMode;
118
        QValueList<PDFPresentationData> PresentVals;
119
        QString Datei;
120
        bool isGrayscale;
121
        bool UseRGB;
122
        bool UseProfiles;
123
        bool UseProfiles2;
124
        bool UseLPI;
125
        QMap<QString,LPIData> LPISettings;
126
        QString SolidProf;
127
        int SComp;
128
        QString ImageProf;
129
        bool EmbeddedI;
130
        int Intent2;
131
        QString PrintProf;
132
        QString Info;
133
        int Intent;
134
        double BleedTop;
135
        double BleedLeft;
136
        double BleedRight;
137
        double BleedBottom;
138
        bool Encrypt;
139
        QString PassOwner;
140
        QString PassUser;
141
        int Permissions;
142
};
143
 
144
#endif