00001
00002
00003
00004
00005
00006
00007 #ifndef SCRIBUSSTRUCTS_H
00008 #define SCRIBUSSTRUCTS_H
00009
00010 #ifdef HAVE_CONFIG_H
00011 #include "scconfig.h"
00012 #endif
00013
00014 #include <QAction>
00015 #include <QByteArray>
00016 #include <QKeySequence>
00017 #include <QList>
00018 #include <QPolygon>
00019 #include <QStack>
00020 #include <QString>
00021 #include <QMap>
00022
00023 #include <vector>
00024
00025 #include "scribusapi.h"
00026 #include "scimagestructs.h"
00027 #include "sctextstruct.h"
00028 #include "scfonts.h"
00029 #include "fpointarray.h"
00030 #include "vgradient.h"
00031 #include "annotation.h"
00032 #include "pageitem.h"
00033
00034 extern bool SCRIBUS_API compareDouble(double, double);
00035
00036 typedef struct
00037 {
00038 int r;
00039 int g;
00040 int b;
00041 void getValues(int& vr, int& vg, int& vb) {vr = r; vg = g; vb = b;}
00042 } RGBColor;
00043
00044 typedef struct
00045 {
00046 int c;
00047 int m;
00048 int y;
00049 int k;
00050 void getValues(int& vc, int& vm, int& vy, int& vk) {vc = c; vm = m; vy = y; vk = k;}
00051 } CMYKColor;
00052
00053 struct CopyPasteBuffer
00054 {
00055 PageItem::ItemType PType;
00056 double Xpos;
00057 double Ypos;
00058 double Width;
00059 double Height;
00060 double RadRect;
00061 int FrameType;
00062 bool ClipEdited;
00063 double Pwidth;
00064 QString Pcolor;
00065 QString Pcolor2;
00066 double Shade;
00067 double Shade2;
00068 int FillRule;
00069 QString GrColor;
00070 QString GrColor2;
00071 int GrShade;
00072 int GrShade2;
00073 VGradient fill_gradient;
00074 int GrType;
00075 QString pattern;
00076 double patternScaleX;
00077 double patternScaleY;
00078 double patternOffsetX;
00079 double patternOffsetY;
00080 double patternRotation;
00081 double GrStartX;
00082 double GrStartY;
00083 double GrEndX;
00084 double GrEndY;
00085 QString TxtStroke;
00086 QString TxtFill;
00087 int ShTxtStroke;
00088 int ShTxtFill;
00089 int TxtScale;
00090 int TxtScaleV;
00091 int TxTStyle;
00092 int TxTBase;
00093 int TxtShadowX;
00094 int TxtShadowY;
00095 int TxtOutline;
00096 int TxtUnderPos;
00097 int TxtUnderWidth;
00098 int TxtStrikePos;
00099 int TxtStrikeWidth;
00100 double Rot;
00101 int PLineArt;
00102 int PLineJoin;
00103 int PLineEnd;
00104 double LineSp;
00105 int LineSpMode;
00106 int ExtraV;
00107 double LocalScX;
00108 double LocalScY;
00109 double LocalX;
00110 double LocalY;
00111 bool PicArt;
00112 bool flippedH;
00113 bool flippedV;
00114 bool isPrintable;
00115 bool isBookmark;
00116 bool m_isAnnotation;
00117 Annotation m_annotation;
00118 QString AnName;
00119 double Extra;
00120 double TExtra;
00121 double BExtra;
00122 double RExtra;
00123 QString Pfile;
00124 QString Pfile2;
00125 QString Pfile3;
00126 QString IProfile;
00127 QString EmProfile;
00128 int IRender;
00129 bool UseEmbedded;
00130 QString itemText;
00131 QPolygon Clip;
00132 FPointArray PoLine;
00133 FPointArray ContourLine;
00134 bool PoShow;
00135 double BaseOffs;
00136 int textPathType;
00137 bool textPathFlipped;
00138 int TextflowMode;
00139 int textAlignment;
00140 QString IFont;
00141 int ISize;
00142 QStack<int> Groups;
00143 int LayerNr;
00144 bool ScaleType;
00145 bool AspectRatio;
00146 bool Locked;
00147 bool LockRes;
00148 double Transparency;
00149 double TranspStroke;
00150 int TransBlend;
00151 int TransBlendS;
00152 bool Reverse;
00153 QString NamedLStyle;
00154 QString Language;
00155 QString guiLanguage;
00156 int Cols;
00157 double ColGap;
00158 QList<ParagraphStyle::TabRecord> TabValues;
00159 QList<double> DashValues;
00160 double DashOffset;
00161 bool isTableItem;
00162 bool TopLine;
00163 bool LeftLine;
00164 bool RightLine;
00165 bool BottomLine;
00166 int LeftLinkID;
00167 int RightLinkID;
00168 int TopLinkID;
00169 int BottomLinkID;
00170 int startArrowIndex;
00171 int endArrowIndex;
00172 ObjAttrVector pageItemAttributes;
00173 };
00174
00175 struct CopyContentsBuffer
00176 {
00177 PageItem::ItemType sourceType;
00178 QString contentsFileName;
00179 double LocalScX;
00180 double LocalScY;
00181 double LocalX;
00182 double LocalY;
00183 double ItemX;
00184 double ItemY;
00185 ScImageEffectList effects;
00186 QString inputProfile;
00187 bool useEmbedded;
00188 int renderingIntent;
00189 };
00190
00192 class MarginStruct
00193 {
00194 public:
00195 MarginStruct() : Top(0), Left(0), Bottom(0), Right(0) {}
00196 MarginStruct(double top, double left, double bottom, double right) :
00197 Top(top), Left(left), Bottom(bottom), Right(right) {}
00198 MarginStruct(const MarginStruct& rhs) {Top=rhs.Top;Bottom=rhs.Bottom;Left=rhs.Left;Right=rhs.Right;}
00199 double Top;
00200 double Left;
00201 double Bottom;
00202 double Right;
00203 };
00204
00205 struct DocPagesSetup
00206 {
00207 DocPagesSetup() : pageArrangement(0), firstPageLocation(0), firstPageNumber(0), orientation(0), autoTextFrames(false), columnDistance(0), columnCount(1) {}
00208 DocPagesSetup(int pa, int fpl, int fpn, int o, bool atf, double cd, double cc) :
00209 pageArrangement(pa), firstPageLocation(fpl), firstPageNumber(fpn), orientation(o), autoTextFrames(atf),
00210 columnDistance(cd), columnCount(cc) {}
00211 int pageArrangement;
00212 int firstPageLocation;
00213 int firstPageNumber;
00214 int orientation;
00215 bool autoTextFrames;
00216 double columnDistance;
00217 double columnCount;
00218 };
00219
00220 struct PageSet
00221 {
00222 QString Name;
00223 int FirstPage;
00224 int Rows;
00225 int Columns;
00226
00227
00228
00229 QStringList pageNames;
00230 };
00231
00232 struct CMSData
00233 {
00234 QString DefaultMonitorProfile;
00235 QString DefaultPrinterProfile;
00236 QString DefaultImageRGBProfile;
00237 QString DefaultImageCMYKProfile;
00238 QString DefaultSolidColorRGBProfile;
00239 QString DefaultSolidColorCMYKProfile;
00240 int ComponentsInput2;
00241 int ComponentsInput3;
00242 int ComponentsPrinter;
00243 int DefaultIntentImages;
00244 int DefaultIntentColors;
00245 bool CMSinUse;
00246 bool SoftProofOn;
00247 bool SoftProofFullOn;
00248 bool GamutCheck;
00249 bool BlackPoint;
00250 } ;
00251
00252 struct SingleLine
00253 {
00254 double Width;
00255 int Dash;
00256 int LineEnd;
00257 int LineJoin;
00258 QString Color;
00259 int Shade;
00260
00261 void setLineWidth(double value) { Width = value; }
00262 void setDash(int value) { Dash = value; }
00263 void setLineEnd(int value) { LineEnd = value; }
00264 void setLineJoin(int value) { LineJoin = value; }
00265 void setColor(const QString& name) { Color = name; }
00266 void setShade(int value) { Shade = value; }
00267 bool operator==(const SingleLine& other) const
00268 {
00269 if (!compareDouble(Width, other.Width) )
00270 return false;
00271 if ((Dash != other.Dash) || (LineEnd != other.LineEnd) || (LineJoin != other.LineJoin) ||
00272 (Color != other.Color)|| (Shade != other.Shade))
00273 return false;
00274 return true;
00275 }
00276 bool operator!=(const SingleLine& other) const
00277 {
00278 return !(*this == other);
00279 }
00280 };
00281
00282 struct ArrowDesc
00283 {
00284 QString name;
00285 bool userArrow;
00286 FPointArray points;
00287 };
00288
00289 struct PDFPresentationData
00290 {
00291 int pageEffectDuration;
00292 int pageViewDuration;
00293 int effectType;
00294 int Dm;
00295 int M;
00296 int Di;
00297 };
00298
00299 struct LPIData
00300 {
00301 int Frequency;
00302 int Angle;
00303 int SpotFunc;
00304 };
00305
00306 struct Keys
00307 {
00308 QString actionName;
00309 QString cleanMenuText;
00310 QKeySequence keySequence;
00311 int tableRow;
00312 QString menuName;
00313 int menuPos;
00314 };
00315
00316 enum PrintEngine
00317 {
00318 PostScript1 = 1,
00319 PostScript2 = 2,
00320 PostScript3 = 3,
00321 WindowsGDI = 4
00322 };
00323 typedef QMap<QString, PrintEngine> PrintEngineMap;
00324
00325 struct PrintOptions
00326 {
00327 bool firstUse;
00328 bool toFile;
00329 bool useAltPrintCommand;
00330 bool outputSeparations;
00331 bool useSpotColors;
00332 bool useColor;
00333 bool mirrorH;
00334 bool mirrorV;
00335 bool useICC;
00336 bool doGCR;
00337 bool doClip;
00338 bool setDevParam;
00339 bool doOverprint;
00340 bool cropMarks;
00341 bool bleedMarks;
00342 bool registrationMarks;
00343 bool colorMarks;
00344 int copies;
00345 PrintEngine prnEngine;
00346 double markOffset;
00347 MarginStruct bleeds;
00348 std::vector<int> pageNumbers;
00349 QString printerOptions;
00350 QString printer;
00351 QString filename;
00352 QString separationName;
00353 QStringList allSeparations;
00354 QString printerCommand;
00355 QByteArray devMode;
00356 };
00357
00358 typedef QMap<QString,QString> ProfilesL;
00359
00360
00361 class multiLine : public QList<SingleLine> {
00362 public:
00363 QString shortcut;
00364 bool operator!=(const multiLine& other) const
00365 {
00366 return !(this->operator ==(other));
00367 }
00368 };
00369
00370 typedef enum {
00371 MissingGlyph=1,
00372 TextOverflow=2,
00373 ObjectNotOnPage=3,
00374 MissingImage=4,
00375 ImageDPITooLow=5,
00376 Transparency=6,
00377 PDFAnnotField=7,
00378 PlacedPDF=8,
00379 ImageDPITooHigh=9,
00380 ImageIsGIF=10,
00381 BlendMode=11,
00382 WrongFontInAnnotation=12
00383 } PreflightError;
00384
00385 typedef QMap<PreflightError, int> errorCodes;
00386
00387 enum AppMode
00388 {
00389 modeNormal,
00390 modeDrawShapes,
00391 modeStoryEditor,
00392 modeDrawImage,
00393 modeDrawText,
00394 modeMagnifier,
00395 modeEdit,
00396 modeDrawLine,
00397 modeRotation,
00398 modeLinkFrames,
00399 modeUnlinkFrames,
00400 modeDrawRegularPolygon,
00401 modeDrawBezierLine,
00402 modeInsertPDFButton,
00403 modeInsertPDFTextfield,
00404 modeInsertPDFCheckbox,
00405 modeInsertPDFCombobox,
00406 modeInsertPDFListbox,
00407 modeInsertPDFTextAnnotation,
00408 modeInsertPDFLinkAnnotation,
00409 modeDrawFreehandLine,
00410 modeDrawTable,
00411 modePanning,
00412 modeMeasurementTool,
00413 modeEditGradientVectors,
00414 modeEyeDropper,
00415 modeCopyProperties,
00416 modeEditClip,
00417 modeDrawLatex
00418 };
00419
00420 struct AlignObjs
00421 {
00422 int ObjNr;
00423 int Group;
00424 double x1;
00425 double y1;
00426 double x2;
00427 double y2;
00428 double width;
00429 double height;
00430 QList<PageItem*> Objects;
00431 };
00432
00434 enum PageOrientation
00435 {
00436 portraitPage = 0,
00437 landscapePage = 1,
00438 customPage = 30
00439 };
00440
00442 typedef QList<double> Guides;
00443
00445 struct Linked
00446 {
00447 int Start;
00448 int StPag;
00449 };
00450
00451
00452 class LastStyles {
00453 public:
00454 CharStyle Style;
00455 int StyleStart;
00456 QString ParaStyle;
00457 LastStyles() {
00458 StyleStart = 0;
00459 ParaStyle = "";
00460 }
00461 };
00462
00463 #endif
00464
00465