00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 #ifndef INC_PRINTCTL
00102 #define INC_PRINTCTL
00103
00104
00105
00106 #include "colplate.h"
00107
00108 class Spread;
00109 class DocView;
00110 class PrintPatchInfo;
00111 class RenderRegion;
00112 class PrintView;
00113
00114
00115
00116 enum PrintOrient { PRINTORIENTATION_UPRIGHT, PRINTORIENTATION_SIDEWAYS };
00117 enum PrintFitType { PRINTFIT_BEST,PRINTFIT_CUSTOM,PRINTFIT_MULTIPLE,PRINTFIT_BESTPAPER };
00118 enum PrintLayers { PRINTLAYERS_ALLFOREGROUND, PRINTLAYERS_VISIBLEFOREGROUND };
00119 enum PSLevel { PSLEVEL_AUTO, PSLEVEL_1, PSLEVEL_2 };
00120 enum PrintMethodType { PRINTMETHOD_NORMAL, PRINTMETHOD_BITMAP, PRINTMETHOD_AABITMAP };
00121 enum BitmapResMethod { BITMAPRES_AUTO, BITMAPRES_MANUAL };
00122 enum PrintRangeObj { PRINTRANGEOBJ_ALL, PRINTRANGEOBJ_SELECTED };
00123 enum PrintRangeDPS { PRINTRANGEDPS_BOTH, PRINTRANGEDPS_LEFTPAGES, PRINTRANGEDPS_RIGHTPAGES };
00124 enum PrintFillQuality { PRINTFILLQUALITY_HIGH, PRINTFILLQUALITY_MEDIUM, PRINTFILLQUALITY_LOW };
00125 enum PrintTextOptions { PRINTTEXTOPTIONS_NORMAL, PRINTTEXTOPTIONS_ALLTEXTASSHAPES };
00126
00127
00128 #define DEF_SCREEN_FREQ 60
00129 #define DEF_SCREEN_ANG 15
00130 #define DEF_SCREEN_FUNC SCRTYPE_SPOT1
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 class TypesetInfo : public CC_CLASS_MEMDUMP
00152 {
00153 CC_DECLARE_MEMDUMP(TypesetInfo)
00154
00155 public:
00156 TypesetInfo();
00157 virtual ~TypesetInfo();
00158
00159 static TypesetInfo *FindTypesetInfoForDoc(Document *pDoc = NULL);
00160
00161 TypesetInfo& operator=(TypesetInfo& other);
00162
00163 public:
00164 void SetSeparations(BOOL sep);
00165
00166 BOOL AreSeparating() const { return MakeSeparations; }
00167 BOOL AreScreening() const { return UseScreening; }
00168
00169 public:
00170 void SetScreening(BOOL screen, BOOL SetAllPlates = TRUE);
00171 void SetPrintResolution(INT32 res, BOOL SetAllPlates = TRUE);
00172 void SetDefaultScreenFrequency(double Freq, BOOL SetAllPlates = TRUE);
00173 void SetScreenFunction(ScreenType func, BOOL SetAllPlates = TRUE);
00174
00175 void ResetAllPlatesToDefaultScreens(void);
00176 void EnsureAllPlatesHaveGlobalSettings(void);
00177
00178 INT32 GetPrintResolution() const { return PrintResolution; }
00179 double GetDefaultScreenFrequency() const { return ScreenFrequency; }
00180 ScreenType GetScreenFunction() const { return DefaultScreenType; }
00181 BOOL GetScreenName(ScreenType type, StringBase *pName);
00182
00183 public:
00184 void SetOutputPrintersMarks(BOOL ShowThem) { ShowPrintersMarks = ShowThem; }
00185 BOOL OutputPrintersMarks(void) const { return(ShowPrintersMarks); }
00186
00187 public:
00188
00189 void SetEmulsionDown(BOOL On) { EmulsionDown = On; }
00190 BOOL PrintEmulsionDown() const { return EmulsionDown; }
00191
00192
00193 void SetPhotoNegative(BOOL On);
00194 BOOL PrintPhotoNegative() const { return PhotoNegative; }
00195
00196
00197 void SetOverprintBlack(BOOL Always);
00198 BOOL AlwaysOverprintBlack() const { return OverprintBlack; }
00199
00200 public:
00201
00202
00203
00204
00205
00206
00207 BOOL CreatePlateList();
00208 void UpdatePlateList();
00209 ColourPlate* CreateColourPlate();
00210
00211 void AddPlate(ColourPlate* pPlate);
00212 void DestroyPlateList();
00213
00214 ColourPlate* GetCurrentPlate() const;
00215 void SetCurrentPlate(ColourPlate* pPlate);
00216 DWORD GetNumPlates() const;
00217
00218 inline ColourPlate* GetFirstPlate() const;
00219 inline ColourPlate* GetNextPlate(const ColourPlate* pPlate) const;
00220 inline ColourPlate* GetPrevPlate(const ColourPlate* pPlate) const;
00221
00222
00223
00224 void InitPlatesForPrinting();
00225 ColourPlate* GetFirstPrintPlate();
00226 ColourPlate* GetNextPrintPlate();
00227 DWORD GetNumPrintPlates() const;
00228 ColourPlate* GetCurrentPrintPlate() const;
00229 INT32 NumPrintPlatesRemaining() const;
00230 void SetNextCompositePlate();
00231
00232
00233
00234 private:
00235 BOOL CheckForExistingPlate(ColourPlateType Type, IndexedColour *SpotColour = NULL);
00236 ColourPlate* GetPrintPlate(DWORD num, ColourPlate* pPlate);
00237
00238 private:
00239 BOOL MakeSeparations;
00240 INT32 PrintResolution;
00241 double ScreenFrequency;
00242 ScreenType DefaultScreenType;
00243
00244 BOOL UseScreening;
00245
00246 BOOL ShowPrintersMarks;
00247
00248 BOOL EmulsionDown;
00249 BOOL PhotoNegative;
00250 BOOL OverprintBlack;
00251 BOOL PrintSpotAsProcess;
00252
00253 private:
00254 List PrintingPlates;
00255
00256 DWORD NumPrintPlates;
00257 DWORD CurrPrintPlateNum;
00258 DWORD PrintPlatesToGo;
00259 ColourPlate* CurrentPlate;
00260 ColourPlate* CurrentPrintPlate;
00261 };
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277 inline ColourPlate* TypesetInfo::GetFirstPlate() const
00278 {
00279 return (ColourPlate*)PrintingPlates.GetHead();
00280 }
00281
00282 inline ColourPlate* TypesetInfo::GetNextPlate(const ColourPlate* pPlate) const
00283 {
00284 return (ColourPlate*)PrintingPlates.GetNext((ListItem*)pPlate);
00285 }
00286
00287 inline ColourPlate* TypesetInfo::GetPrevPlate(const ColourPlate* pPlate) const
00288 {
00289 return (ColourPlate*)PrintingPlates.GetPrev((ListItem*)pPlate);
00290 }
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309 class PrintControl : public CC_CLASS_MEMDUMP
00310 {
00311 CC_DECLARE_MEMDUMP(PrintControl)
00312
00313 public:
00314 PrintControl();
00315 ~PrintControl();
00316
00317
00318 BOOL SetUp(Spread* pSpread, BOOL RedrawPrintBorders = TRUE);
00319
00320
00321 String_256 BuildPrintInfoStr();
00322 String_256 BuildPaperSizeStr();
00323
00324
00325 BOOL IsWholeSpread() { return WholeSpread; }
00326 void SetWholeSpread(BOOL State);
00327
00328 BOOL IsDoublePageSpread() { return DPS; }
00329 void SetDoublePageSpread(BOOL State) { DPS = State; }
00330
00331 FIXED16 GetScale() { return Scale; }
00332 void SetScale(FIXED16 NewScale);
00333
00334 PrintOrient GetPrintOrient() { return Orient; }
00335 void SetPrintOrient(PrintOrient NewOrient);
00336
00337 PrintFitType GetFitType() { return FitType; }
00338 void SetFitType(PrintFitType NewFitType);
00339
00340 TypesetInfo* GetTypesetInfo() { return &Typesetting; }
00341
00342
00343 INT32 GetTopMargin() { return TopMargin; }
00344 void SetTopMargin(INT32 NewVal) { TopMargin = NewVal; }
00345 INT32 GetLeftMargin() { return LeftMargin; }
00346 void SetLeftMargin(INT32 NewVal) { LeftMargin = NewVal; }
00347 INT32 GetWidth() { return ScaledWidth; }
00348 void SetWidth(INT32 NewVal);
00349 INT32 GetHeight() { return ScaledHeight;}
00350 void SetHeight(INT32 NewVal);
00351
00352 INT32 GetRows() { return Rows; }
00353 BOOL SetRows(INT32 NewVal);
00354 INT32 GetColumns() { return Columns; }
00355 BOOL SetColumns(INT32 NewVal);
00356 INT32 GetGutter() { return Gutter; }
00357 BOOL SetGutter(INT32 NewVal);
00358
00359
00360 PrintLayers GetPrintLayers() { return Layers; }
00361 void SetPrintLayers(PrintLayers NewVal) { Layers = NewVal; }
00362 PSLevel GetPSLevel() { return PSLangLevel; }
00363 void SetPSLevel(PSLevel NewVal) { PSLangLevel = NewVal; }
00364 PrintMethodType GetPrintMethod();
00365 void SetPrintMethod(PrintMethodType NewVal);
00366 BitmapResMethod GetBitmapResMethod() { return BitmapResolutionMethod; }
00367 void SetBitmapResMethod(BitmapResMethod BRM) { BitmapResolutionMethod = BRM; }
00368 INT32 GetDotsPerInch();
00369 void SetDotsPerInch(INT32 NewVal);
00370 PrintFillQuality GetFillQuality() { return FillQuality; }
00371 void SetFillQuality(PrintFillQuality Qual) { FillQuality = Qual; }
00372 PrintTextOptions GetTextOptions() { return TextOptions; }
00373 void SetTextOptions(PrintTextOptions pto) { TextOptions = pto; }
00374
00375
00376
00377 static PrintMethodType AppPrintMethod;
00378
00379
00380 BOOL IsCollated() { return Collated; }
00381 void SetCollated(BOOL NewVal) { Collated = NewVal; }
00382 INT32 GetNumCopies() { return NumCopies; }
00383 void SetNumCopies(INT32 NewVal) { NumCopies = NewVal; }
00384 BOOL GetPrintToFile() { return PrintToFile; }
00385 void SetPrintToFile(BOOL NewVal) { PrintToFile = NewVal; }
00386 PrintRangeObj GetObjPrintRange();
00387 void SetObjPrintRange(PrintRangeObj NewVal) { ObjPrintRange = NewVal; }
00388 PrintRangeDPS GetDPSPrintRange() { return DPSPrintRange; }
00389 void SetDPSPrintRange(PrintRangeDPS NewVal) { DPSPrintRange = NewVal; }
00390
00391
00392 INT32 GetNumPrintablePages();
00393
00394
00395 PrintControl& operator=(PrintControl& other);
00396
00397
00398
00399 BOOL StartPrinting();
00400 BOOL MorePaper();
00401 BOOL GetNextPaper();
00402 BOOL ReprintPaper();
00403 BOOL GetNextPatch(PrintPatchInfo* pPatchInfo);
00404 BOOL EndPrinting();
00405
00406 BOOL StartPlatePrinting(PrintView *pPrintView, UINT32* const errID);
00407 BOOL MorePlates();
00408 BOOL SetNextPlate(PrintView *pPrintView);
00409 void EndPlatePrinting(PrintView *pPrintView);
00410
00411
00412 void StartImport();
00413 void EndImport();
00414 void RenderPrintBorder(RenderRegion* pRRegion);
00415
00416 static BOOL RedrawPrintableArea(DocView* pDocView);
00417
00418 private:
00419
00420
00421
00422 BOOL CalcNumPaper();
00423
00424 BOOL Printing;
00425 BOOL SelectionPresent;
00426 DocRect PatchClipRect;
00427
00428 INT32 NumPrintablePages;
00429
00430 INT32 NumPaper;
00431 INT32 PaperNumber;
00432 INT32 MaxPaperNumber;
00433 BOOL Reprint;
00434
00435 INT32 NumPatches;
00436 INT32 PatchNumber;
00437 INT32 MaxPatchNumber;
00438
00439
00440 INT32 PatchRow;
00441 INT32 PatchColumn;
00442 MILLIPOINT SectionWidth;
00443 MILLIPOINT SectionHeight;
00444
00445 private:
00446
00447
00448
00449 BOOL PrintAreaSetUp;
00450 BOOL SetUpFailed;
00451 Spread* pSpread;
00452
00453
00454
00455
00456
00457
00458
00459
00460 DocRect TotalPrintArea;
00461
00462
00463 DocRect PrintableArea;
00464 INT32 PALeftMargin;
00465 INT32 PATopMargin;
00466
00467 DocCoord Origin;
00468
00469 INT32 PageWidth;
00470 INT32 PageHeight;
00471 INT32 PaperWidth;
00472 INT32 PaperHeight;
00473
00474 INT32 OrigPageWidth;
00475 INT32 OrigPageHeight;
00476
00477 BOOL DPS;
00478 MILLIPOINT Bleed;
00479 MILLIPOINT CropArea;
00480
00481
00482 BOOL WholeSpread;
00483
00484 FIXED16 Scale;
00485 PrintOrient Orient;
00486
00487 PrintFitType FitType;
00488
00489 INT32 TopMargin;
00490 INT32 LeftMargin;
00491 INT32 ScaledWidth;
00492 INT32 ScaledHeight;
00493 INT32 CropTopMargin;
00494 INT32 CropLeftMargin;
00495
00496 INT32 Rows;
00497 INT32 Columns;
00498 INT32 Gutter;
00499
00500
00501 TypesetInfo Typesetting;
00502
00503
00504 PrintLayers Layers;
00505 PSLevel PSLangLevel;
00506
00507 BitmapResMethod BitmapResolutionMethod;
00508 INT32 DotsPerInch;
00509 PrintFillQuality FillQuality;
00510 PrintTextOptions TextOptions;
00511
00512
00513 BOOL Collated;
00514 INT32 NumCopies;
00515 BOOL PrintToFile;
00516 PrintRangeObj ObjPrintRange;
00517 PrintRangeDPS DPSPrintRange;
00518
00519
00520 BOOL UpdateDependants;
00521
00522
00523
00524
00525 void SetScaleFactor(double ScaleFactor);
00526 BOOL CalcPrintAreaVars(BOOL RedrawPrintBorders = TRUE);
00527
00528
00529
00530 BOOL CalcFit();
00531
00532 void CalcMultipleFit(INT32 NumRows,INT32 NumColumns,INT32 GutterVal,INT32 Wd,INT32 Ht,INT32 Extra);
00533 INT32 GetCropAdjust() const;
00534
00535 double CalcPatchWidth(INT32 PaperWidth,INT32 NumColumns,INT32 GutterVal);
00536 double CalcPatchHeight(INT32 PaperHeight,INT32 NumRows,INT32 GutterVal);
00537 INT32 CalcMaxRows(INT32 GutterVal);
00538 INT32 CalcMaxColumns(INT32 GutterVal);
00539 INT32 CalcMaxGutter(INT32 NumRows,INT32 NumColumns);
00540
00541 void RenderRect(RenderRegion* pRRegion,DocRect Rect,BOOL Fill);
00542 };
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558 class PrintPatchInfo : public CC_CLASS_MEMDUMP
00559 {
00560 CC_DECLARE_MEMDUMP(PrintPatchInfo)
00561
00562 friend class PrintControl;
00563
00564 public:
00565 PrintPatchInfo();
00566 ~PrintPatchInfo();
00567
00568
00569 DocRect GetClipRect(BOOL AddBleed=FALSE, BOOL AddCropArea=FALSE) const;
00570 void InflateRectBy(DocRect *pRect, BOOL AddBleed=FALSE, BOOL AddCropArea=FALSE) const;
00571 void InflateRectBy(OilRect *pRect, BOOL AddBleed=FALSE, BOOL AddCropArea=FALSE) const;
00572 void DeflateRectBy(DocRect *pRect, BOOL AddBleed=FALSE, BOOL AddCropArea=FALSE) const;
00573 MILLIPOINT GetBleed() const;
00574 MILLIPOINT GetCropArea() const;
00575
00576 public:
00577 FIXED16 Scale;
00578 MILLIPOINT XTrans;
00579 MILLIPOINT YTrans;
00580 BOOL Rotate;
00581 BOOL SelectedOnly;
00582 BOOL VisibleLayers;
00583 BOOL EmulsionDown;
00584 Spread* pSpread;
00585 MILLIPOINT PaperWidth;
00586 MILLIPOINT PaperHeight;
00587 INT32 ScaledWidth;
00588 INT32 ScaledHeight;
00589 INT32 PaperNumber;
00590 INT32 MaxPaperNumber;
00591 INT32 PatchNumber;
00592 INT32 MaxPatchNumber;
00593 INT32 PALeftMargin;
00594 INT32 PATopMargin;
00595
00596 private:
00597 DocRect ClipRect;
00598 MILLIPOINT Bleed;
00599 MILLIPOINT CropArea;
00600
00601 };
00602
00603
00604
00605 #endif