InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPreflightUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Matt Phillips
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 // General (application-wide) preflight utilities. Note that there are other utility
24 // files such as IPreflightProfileUtils which address specific kinds of objects.
25 //
26 //========================================================================================
27 
28 
29 #include "IPMUnknown.h"
30 #include "PackageAndPreflightID.h"
31 #include "Utils.h"
32 
33 #include "IPreflightArtworkShapeContext.h"
34 #include "IPreflightArtworkTextContext.h"
35 #include "IPreflightArtworkTableContext.h"
36 #include "IViewPortAttributes.h"
37 #include "IGraphicsPort.h"
38 #include "TransformTypes.h"
39 
40 class IPreflightManager;
45 class IPreflightOptions;
46 class IDocument;
47 class IDataBase;
48 class ISubject;
49 class IPreflightProcess;
50 class IPreflightProfile;
52 class IShape;
53 class ISpread;
54 
67 {
68 public:
69  enum { kDefaultIID = IID_IPREFLIGHTUTILS };
70 
71 public:
75  virtual IPreflightManager *QueryPreflightManager() const = 0;
76 
80  virtual IPreflightObjectModel *QueryObjectModel() const = 0;
81 
85  virtual IPreflightRuleManager *QueryRuleManager() const = 0;
86 
90  virtual IPreflightProcessManager *QueryProcessManager() const = 0;
91 
97  virtual IPreflightProfileManager *QueryProfileManager(IDocument* iDoc) const = 0;
98 
106  virtual IPreflightProfileManager *QueryProfileManager(IDataBase* iDataBase) const = 0;
107 
119  virtual ISubject* QueryAppMessageSubject() const = 0;
120 
131  virtual ISubject* QueryDocumentSubject(IDataBase* iDB) const = 0;
132 
137  virtual IPreflightOptions* QueryPreflightOptions (IDataBase* iDB) const = 0;
138 
145  virtual IPreflightProcess* QueryProcessForDocument(IDataBase* iDocDB) const = 0;
146 
163  virtual void ApplyOptionsToDocument
164  (
165  IDataBase* iDocDB,
166  const IPreflightOptions* iNewOptions
167  ) const = 0;
168 
177  virtual IPreflightProfile* QueryEmbeddedProfile(IDataBase* iDocDB) const = 0;
178 
184  virtual IPreflightProfile* QueryWorkingProfile() const = 0;
185 
192  virtual IPreflightProfile* QueryDefaultProfile() const = 0;
193 
199  virtual void BeginShapeGroup(IGraphicsPort* iPort, UID itemUID, ClassID subpartID) const = 0;
200 
206  virtual void EndShapeGroup(IGraphicsPort* iPort, UID itemUID, ClassID subpartID) const = 0;
207 
215  {
216  IGraphicsPort* fPort;
217  bool fIssueGroup;
218  ClassID fSubPartID;
219  UID fUID;
220 
221  public:
233  (
234  IGraphicsPort* iPort,
235  IPMUnknown* iThing,
236  ClassID subPartID,
237  bool issueGroup = kTrue
238  )
239  : fPort(iPort), fUID(kInvalidUID), fIssueGroup(kFalse), fSubPartID(subPartID)
240  {
241  if (issueGroup)
242  {
244  fIssueGroup = (iAttr && iAttr->GetAttr(kPreflightIssuePortGroupsVPAttr));
245  if (fIssueGroup)
246  {
247  fUID = ::GetUID(iThing);
248  Utils<IPreflightUtils>()->BeginShapeGroup(iPort, fUID, subPartID);
249  }
250  }
251  }
252 
253  ~AutoShapeGroup()
254  {
255  if (fIssueGroup) Utils<IPreflightUtils>()->EndShapeGroup(fPort, fUID, fSubPartID);
256  }
257  };
258 
263  virtual bool SelectPageItem(const UIDRef& itemRef) const = 0;
264 
269  virtual PMString GetPageDescription(IShape* iPageShape) const = 0;
270 
275  virtual PMString GetSpreadDescription(ISpread* iSpread) const = 0;
276 
284 // virtual void GetSpreadRect(ISpread* iSpread, Transform::CoordinateSpace coordSpace, PMRect& r) const = 0;
285 
300  virtual ErrorCode NewProfile
301  (
302  IDataBase* iTargetDB,
303  const PMString& profileName,
304  const PMString& profileDesc,
305  bool prepopulateRules,
306  UID* pNewProfileUID
307  ) = 0;
308 
328  virtual ErrorCode CopyProfileData
329  (
330  const UIDRef& dstProfileRef,
331  const IPreflightProfile* iSrcProfile
332  ) = 0;
333 
343  virtual ErrorCode SetProfileStrings
344  (
345  const UIDRef& dstProfileRef,
346  bool setName,
347  const PMString& newName,
348  bool setDesc,
349  const PMString& newDesc
350  ) = 0;
351 
352 
362  (
363  IDataBase* iBookDB
364  ) const = 0;
365 
375  (
376  IDataBase* iBookDB
377  ) const = 0;
378 
390  (
391  const IPreflightBookOptions* iSrc = nil
392  ) const = 0;
393 
400  virtual ErrorCode SetPreflightBookOptions
401  (
402  IDataBase* iBookDB,
403  const IPreflightBookOptions* iOptions
404  ) = 0;
405 
415  virtual ErrorCode SetActivePreflightBookOptions
416  (
417  IDataBase* iBookDB,
418  const IPreflightBookOptions* iOptions
419  ) = 0;
420 
429  virtual const IPreflightOptions* QueryOptions
430  (
431  IDataBase* iDocumentDB
432  ) const = 0;
433 
446  (
447  const IPreflightOptions* iSrc = nil
448  ) const = 0;
449 
459  virtual ErrorCode UpdateActivePreflightOptions
460  (
461  IDataBase* iDataBase,
462  const IPreflightOptions* iOptions
463  ) = 0;
464 
473  virtual ErrorCode SetPreflightOptions
474  (
475  IDataBase* iDataBase,
476  const IPreflightOptions* iOptions
477  ) = 0;
478 };
479 
480 
481