InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPrintJobData.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: DBerggren
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 // based on IUIDListData.h - for managing list of inks
24 //
25 //========================================================================================
26 
27 #ifndef __IPrintJobData__
28 #define __IPrintJobData__
29 
30 #include "IPMUnknown.h"
31 #include "IInkResourceData.h"
32 #include "PrintID.h"
33 #include "K2Vector.h"
34 #include "IPathGeometry.h"
35 #include "BravoForwardDecl.h"
36 #include "PMRect.h"
37 
38 class TrapZoneInfo;
39 class Font_Info;
40 
45 class IPrintJobData : public IPMUnknown
46 {
47  public:
48  enum { kDefaultIID = IID_IPRINTJOBDATA };
49 
54  virtual IInkList* GetInkList(void) const = 0;
59  virtual void SetInkList(IInkList *iInkList) = 0;
60 
61  // Ink Resource methods - to get/set IInkResourceData for each page
69  virtual void InkRsrcInsert(int32 index, IInkResourceData *iInkRsrcData) = 0;
73  virtual void InkRsrcRemove(int32 index) = 0;
76  virtual void InkRsrcClear(void) = 0;
79  virtual int32 InkRsrcLength(void) = 0;
86  virtual IInkResourceData *GetNthInkRsrcData(int32 index) const = 0;
87 
93  virtual bool16 GetGradientUsed() const = 0;
99  virtual void SetGradientUsed(const bool16 bGradientUsed) = 0;
100 
105  virtual bool16 GetImagesUsed() const = 0;
110  virtual void SetImagesUsed(const bool16 bImagesUsed) = 0;
111 
115  virtual bool16 GetTransparencyUsedInJob() const = 0;
120  virtual bool16 GetTransparencyUsed(const int32 whichPage) const = 0;
124  virtual void SetTransparencyInfo(const K2Vector<int32>& xpPages) = 0;
128  virtual int32 NumberOfPagesWithTransparency() const = 0;
129 
130  // font collection methods
138  virtual void AppendGraphicSuppliedFontName(const PMString& fontName) = 0;
139 
147  virtual int32 NumGraphicSuppliedFonts() const = 0;
148 
157  virtual void GetNthGraphicSuppliedFontName(int32 n, PMString& fontName) const = 0;
158 
163  virtual bool16 GetSVGFontsUsed(const int32 whichPage) const = 0;
164 
168  virtual void SetSVGFontsInfo(const K2Vector<int32>& svgPages) = 0;
169 
174  virtual void AppendFontInfo(const Font_Info* fontInfo) = 0;
178  virtual int32 NumFontInfo() const = 0;
183  virtual Font_Info* GetNthFontInfo(int32 n) const = 0;
184 
188  virtual int32 NumMissingFonts() const = 0;
189 
194  virtual void GetNthMissingFontName(const int32 n, PMString& fontName) const = 0;
195 
199  virtual void AppendMissingFontName(const PMString& fontName) = 0;
200 
201  // trap zone information
207  virtual void TZPathsInsert(int32 index, K2Vector<TrapZoneInfo*> pathList) = 0;
211  virtual void TZPathsRemove(int32 index) = 0;
214  virtual void TZPathsClear(void) = 0;
218  virtual int32 TZPathsLength(void) = 0;
224  virtual K2Vector<TrapZoneInfo*> GetNthTZPathsList(int32 index) const = 0;
225 
230  virtual bool16 GetGradientMeshUsed() const = 0;
235  virtual void SetGradientMeshUsed(const bool16 bGradientMeshUsed) = 0;
236 
243  virtual void AddPageLabelString(int32 pageIndex, const PMString& pageLabelStr) = 0;
247  virtual void RemovePageLabelString(int32 pageIndex) = 0;
250  virtual void ClearPageLabelStrings(void) = 0;
260  virtual PMString GetPageLabelString(int32 pageIndex) const = 0;
261 
266  virtual void AppendLinks(const UIDList& links) = 0;
267 
274  virtual const UIDList& GetLinks(void) const = 0;
275 
276  // page gap information
285  virtual void PageGapsListInsertPage(int32 page, K2Vector<PMRect> vecPageGapsList) = 0;
289  virtual void PageGapsListRemovePage(int32 page) = 0;
292  virtual void PageGapsListClear(void) = 0;
298  virtual K2Vector<PMRect> GetPageGapsListForPage(int32 page) const = 0;
299 
300 };
301 
306 {
307 public:
308  typedef object_type data_type;
309 
315  TrapZoneInfo(PMString& trapStyleName, IPathGeometry *trapZonePath, PMReal offsetPathAmt = PMReal(0.0))
316  : fTrapStyleName(trapStyleName),
317  fTrapZonePath(trapZonePath, UseDefaultIID()),
318  fOffsetPathAmount(offsetPathAmt)
319  {}
323  PMString &GetTrapStyleName() { return fTrapStyleName; }
328  IPathGeometry *GetTrapZonePath() { return fTrapZonePath; }
332  PMReal GetOffsetPathAmount() { return fOffsetPathAmount; }
333 
334 private:
335  PMString fTrapStyleName;
336  InterfacePtr<IPathGeometry> fTrapZonePath;
337  PMReal fOffsetPathAmount;
338 };
339 
344 {
345 public:
346  typedef base_type data_type;
347 
355  Font_Info(const CTFontDict* ctFontDict, int32 numDesignVectors = 0, Fixed* designVectors = nil, uint32 flags = 0)
356  : fctFontDict(ctFontDict),
357  fnumDesignVectors(numDesignVectors),
358  fFlags(flags),fDesignVectors(nil)
359  {
360  if(numDesignVectors){
361  fDesignVectors = new Fixed[numDesignVectors];
362  std::memcpy(fDesignVectors, designVectors, sizeof(Fixed)*numDesignVectors);
363  }
364 
365  }
366 
367 
368  ~Font_Info(){
369  if(fDesignVectors)
370  delete[] fDesignVectors;
371  fDesignVectors = nil;
372  }
373 
377  const CTFontDict* GetCTFontDict() const { return fctFontDict; }
381  size_t GetNumDesignVectors() const { return fnumDesignVectors; }
386  void GetDesignVectors(Fixed* dV) const{
387  std::memcpy(dV, fDesignVectors, sizeof(Fixed)*fnumDesignVectors);
388  }
392  uint32 GetFlags() const { return fFlags; }
393 
397  {
398  if (this != &other)
399  {
400  fctFontDict = other.fctFontDict;
401  fnumDesignVectors = other.fnumDesignVectors;
402  Fixed *fiDV = nil;
403  if(fnumDesignVectors)
404  fiDV = new Fixed[fnumDesignVectors];
405  other.GetDesignVectors(fiDV);
406  std::memcpy(fDesignVectors, fiDV, sizeof(Fixed)*fnumDesignVectors);
407  fFlags = other.fFlags;
408  if(fiDV){
409  delete[] fiDV;
410  }
411  }
412  return *this;
413  }
414 
418  bool16 operator==(const Font_Info& fi) const
419  {
420  bool16 result = kTrue;
421  if (fctFontDict != fi.GetCTFontDict())
422  result = kFalse;
423  if (fnumDesignVectors != fi.GetNumDesignVectors())
424  result = kFalse;
425  if(result){
426  Fixed *fiDV = nil;
427  if(fnumDesignVectors)
428  fiDV = new Fixed[fnumDesignVectors];
429  fi.GetDesignVectors(fiDV);
430  if(std::memcmp(fiDV, fDesignVectors, sizeof(Fixed) * fnumDesignVectors) != 0)
431  result = kFalse;
432  if (fFlags != fi.GetFlags())
433  result = kFalse;
434  if(fnumDesignVectors>0)
435  delete [] fiDV;
436  }
437  return result;
438  }
439 
442  enum {
443  // horizontal/vertical
444  kIsVertical = 0x00000001
445  };
446 
447 private:
448  const CTFontDict* fctFontDict;
449  size_t fnumDesignVectors;
450  Fixed *fDesignVectors;
451  uint32 fFlags;
452 };
453 
454 
455 #endif // __IPrintJobData__