InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
INewSpreadCmdData.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Tommy Donovan
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 // Command data interface for new spreads.
24 //
25 //========================================================================================
26 
27 #ifndef __INewSpreadCmdData__
28 #define __INewSpreadCmdData__
29 
30 #include "IPMUnknown.h"
31 #include "SpreadID.h"
32 #include "UIDRef.h"
33 #include "PMRect.h"
34 #include "PMPageSize.h"
35 
36 class IDataBase;
37 
41 {
42 public:
43  enum { kDefaultIID = IID_INEWSPREADCMDDATA };
44 
56  enum SpreadIsIslandChoice { kPagesMayShuffleThroughNewSpread, kPreventPagesFromShufflingThroughNewSpread};
57 
58  inline void SetNewSpreadCmdData(
59  const UIDRef& doc,
60  int32 numberOfSpreadsToAdd,
61  int32 spreadIndexForInsertion /* the value ISpreadList::kAtTheEnd == -1 is allowed*/,
62  SpreadIsIslandChoice bIslandSpread /*= kPagesMayShuffleThroughNewSpread*/,
63  int32 pagesPerNewSpread /* -1 means use default (i.e., 2 for a facing page document, 1 otherwise)*/,
64  const K2Vector<PMRect>* pageBoundingBoxes /* nil for default size, otherwise a K2Vector with pagesPerNewSpread PMRects*/,
65  const K2Vector<PMMatrix>* pageTransforms /*nil for default placement, otherwise a K2Vector with pagesPerNewSpread PMMatrices*/,
66  const K2Vector<PMMatrix>* spreadTransforms /* nil for default placement, otherwise a K2Vector with numberOfSpreadsToAdd PMMatrices */)
67  {
68  SetNewSpreadCmdData_(
69  doc, numberOfSpreadsToAdd, spreadIndexForInsertion,bIslandSpread /*= kPagesMayShuffleThroughNewSpread*/,
70  pagesPerNewSpread, pageBoundingBoxes, pageTransforms, spreadTransforms, pageBoundingBoxes && pageTransforms ? kPMPageSizeDefine : kPMPageSizeDefault /*use pageBoundingBoxes and pageTransforms*/);
71  }
72 
73 
74 
75  inline void SetNewSpreadCmdData( const UIDRef& doc,
76  int32 numberOfSpreadsToAdd,
77  int32 spreadIndexForInsertion /* the value ISpreadList::kAtTheEnd == -1 is allowed*/,
78  SpreadIsIslandChoice bIslandSpread,
79  int32 pagesPerNewSpread,
80  const PMPageSize& pageSize /* = kPMPageSizeNeighbor*/ /* kPMPageSizeNeighbor means use the page size of location where spread is inserting. kPMPageSizeDefault means use document default page size. */,
81  const PMMatrix* spreadTransform = nil )
82  {
83  if ( spreadTransform )
84  {
85  K2Vector<PMMatrix> spreadTransforms;
86  spreadTransforms.push_back(*spreadTransform);
87  SetNewSpreadCmdData_(doc, numberOfSpreadsToAdd, spreadIndexForInsertion, bIslandSpread, pagesPerNewSpread, nil, nil, &spreadTransforms, pageSize);
88  }
89  else
90  SetNewSpreadCmdData_(doc, numberOfSpreadsToAdd, spreadIndexForInsertion, bIslandSpread, pagesPerNewSpread, nil, nil, nil, pageSize);
91  }
92 
93 
98  virtual const UIDRef& GetNewSpreadDocument() const = 0;
99 
104  virtual const int32 GetNewSpreadInsertCount() const = 0;
105 
112  virtual const int32 GetNewSpreadInsertPosition() const = 0;
113 
118  virtual const int32 GetPagesPerNewSpread() const = 0;
119 
124  virtual const K2Vector<PMRect>* GetNewSpreadPageBoundingBoxes() const = 0;
125  virtual const K2Vector<PMMatrix>* GetNewSpreadPageTransforms() const = 0;
126  virtual PMPageSize GetNewSpreadPageSize() const = 0;
127  virtual const K2Vector<PMMatrix>* GetNewSpreadTransforms() const = 0;
128 
134  virtual const SpreadIsIslandChoice GetNewSpreadIsIslandSpread() const = 0;
135 
136  // TEMPORARY api
137  virtual void SetNewSpreadCmdData_(
138  const UIDRef& doc,
139  int32 numberOfSpreadsToAdd,
140  int32 spreadIndexForInsertion /* the value ISpreadList::kAtTheEnd == -1 is allowed*/,
141  SpreadIsIslandChoice bIslandSpread /*= kPagesMayShuffleThroughNewSpread*/,
142  int32 pagesPerNewSpread /* -1 means use default (i.e., 2 for a facing page document, 1 otherwise)*/,
143  const K2Vector<PMRect>* pageBoundingBoxes /* nil for default size, otherwise a K2Vector with pagesPerNewSpread PMRects*/,
144  const K2Vector<PMMatrix>* pageTransforms /*nil for default placement, otherwise a K2Vector with pagesPerNewSpread PMMatrices*/,
145  const K2Vector<PMMatrix>* spreadTransforms /* nil for default placement, otherwise a K2Vector with numberOfSpreadsToAdd PMMatrices */,
146  const PMPageSize& pageSize) = 0;
147 
148 };
149 
150 
151 
152 
153 #endif // __INewSpreadCmdData__