InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IXPUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Bernd Paradies
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __IXPUtils__
25 #define __IXPUtils__
26 
27 #include "XPID.h"
28 #include "IPMUnknown.h"
29 #include "Utils.h"
30 
31 #include "IXPManager.h"
32 #include "IFlattenerSettings.h"
33 #include "IViewPortAttributes.h"
34 #include "BravoForwardDecl.h"
35 
36 class IDocument;
37 class IControlView;
38 
41 class IXPUtils : public IPMUnknown
42 {
43 public:
44  enum { kDefaultIID = IID_IXPUTILS };
45 
46  // Used for CreateFlattener() below
47  typedef enum
48  {
49  kModeLegacy, // Preserve spots/overprint
50  kModeSimPress, // Do OPP
51  kModeSimScreen // Without OPP (no spots declared)
52  } FlattenOutputMode;
53 
54  // Used for CreateFlattener() below
56  {
57  public:
58  PMReal fLevel;
59  PMReal fInternalDPI;
60  PMReal fExternalDPI;
61  PMReal fMapDPI;
62  PMReal fPathDPI;
63 
64  // Note: if CreateFlattener() returns a non-nil value here, you're
65  // responsible for releasing it via IXPUtils::ReleaseBlendSpace().
66  // Otherwise you'll get a memory leak.
67  AGMColorSpace* fBlendSpace;
68  };
69 
70  // QueryXPManager: Gets the transparency manager for the specified doc.
71  // Note: If doc == nil, fails (there is no xpmanager on the default doc).
72  // The IDataBase form requires a non-nil iDB, which must be a doc DB.
73  virtual IXPManager *QueryXPManager(IDocument *iDoc) = 0;
74  virtual IXPManager *QueryXPManager(IDataBase *iDB) = 0;
75 
76  // Determines whether OPP is enabled in the specified view.
77  virtual bool32 IsOPPEnabledInView(IControlView* iView) = 0;
78 
79  enum
80  {
81  // If not set, honors spread overrides.
82  kXPCF_IgnoreSpreadOverrides = (1L<<0),
83 
84  // If not set, we'll tell the flattener to set up doc spots in
85  // legacy and simPress modes.
86  kXPCF_NoSpotSetup = (1L<<1),
87 
88  // Forces flattener to rasterize bad boy paints.
89  kXPCF_RasterizeAGMPrintIncompatiblePaints = (1L<<2),
90 
91  // Don't use page's doc for inklist, use active book's inklist.
92  kXPCF_UseActiveBookInkList = (1L<<3)
93  };
94 
95  // CreateFlattener: This utility creates a flattening port using a flattening style
96  // and applying any spread overrides (depending on 'kXPCF_IgnoreSpreadOverrides'). The
97  // output mode determines whether spots will be added to the flattening port and
98  // how various flags get set up. If you need to know what the final settings were
99  // you can pass a FlattenSettings object and this fn will fill it in for you.
100  // NOTE: This method will return an invalid (nil) port if an error occurs OR if
101  // the spread override says not to enable the flattener.
102  virtual AGMPort* CreateFlattener(
103  UIDRef pageRef, // The page or spread you're exporting
104  UID flatStyleUID, // The UID of the global flattening style
105  uint32 xpcfFlags, // kXPCF_*
106  IXPUtils::FlattenOutputMode mode, // Determines spot and flag setup
107  const PMRect& pgBounds, // The drawing bounds
108  IXPUtils::FlattenSettings* returnSettings = nil,
109  void* pAGMFlattenerSettings = nil,
110  AGMColorSpace* preferredBlendSpace = nil) = 0;
111 
112  // This is used to release the blend space optionally returned from CreateFlattener().
113  virtual void ReleaseBlendSpace(AGMColorSpace* theBlendSpace) = 0;
114 
115  // This is used to obtain a suitable output profile to eliminate stitching
116  // artifacts caused by a different blend and device (and proofing, and
117  // overprint simulation) profiles. Pass in your profiles, and this will
118  // return an appropriate new device profile to match the planar map vs non
119  // planar mapped object path. Note that you need to release the profile
120  // via the appropriate BIB dereferencer or ReleaseProfile, below.
121  virtual AGMColorProfile* CreateAntistitchingProfile
122  (
123  AGMColorProfile* profBlend, // required; if not flattening, then don't call this function
124  AGMColorProfile* profDevice, // required
125  AGMColorProfile* profCMYK = nil, // nil = not doing overprint preview
126  AGMColorProfile* profProof = nil // nil = not proofing anything
127  ) = 0;
128 
129  virtual void ReleaseProfile(AGMColorProfile*) = 0;
130 
136  UID uidFlatStyle ) = 0;
137 
143  virtual bool16 GetFlattenerSettings( IWorkspace* pWorkspace,
144  UID uidFlatStyle,
145  bool16 bIgnoreSpreadOverrides,
146  UIDRef& uidPageItem,
148  InterfacePtr<IFlattenerSettings>& pOverrides ) = 0;
149 
154  virtual bool16 SetupViewPortAttrs( IWorkspace* pWorkspace,
155  UID uidFlatStyle,
156  bool32 bIgnoreOverrides,
157  UIDRef const& uidPage,
158  IViewPortAttributes* iAttr) = 0;
159 
176  virtual AGMPaint* CreateImagePaintServer( _t_AGMImageRecord* imgRec,
177  PMMatrix* m,
178  int32 flags,
179  AGMColorSpace* theSpace) = 0;
180 
186  virtual void ReleasePaintServer(AGMPaint* agmPaint) = 0;
187 
203  virtual UIDList* GetGraphicsAffectedByTransparency(UIDRef spreadRef, const PMString& styleName = PMString(), bool32 ignoreSpreadOverrides = kFalse) = 0;
204 
217  virtual bool32 IsStrokeTransparent(IPMUnknown* item) = 0;
218 };
219 
220 
221 #endif // __IXPUtils__