InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ILayoutUtils.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 __ILayoutUtils__
25 #define __ILayoutUtils__
26 
27 
28 
29 #include "LayoutID.h"
30 #include "IPMUnknown.h"
31 #include "Utils.h"
32 
33 #include "PMRect.h"
34 #include "ILayoutControlData.h"
35 #include "ISnapTo.h" // SnapType
36 #include "UIDRef.h"
37 #include "PMMatrix.h"
38 #include "UIDList.h"
39 #include "HitTestDragConstants.h"
40 #include "TransformTypes.h"
41 
42 class IControlView;
43 class IDocument;
44 class ISpread;
45 class IWindow;
46 class IViewPort;
47 class IHierarchy;
48 class IMargins;
49 class IColumns;
50 class IMasterSpreadList;
52 class IRulerData;
53 class IGraphicsContext;
55 class IPanorama;
56 class ISpreadList;
57 class ICommand;
58 class ILayoutData;
59 class ISnapTo;
60 class IWorkspace;
61 class IFrameList;
62 class IUIDListData;
63 
65 enum PageType {
67  kLeftPage = 0,
69  kUnisexPage,
71  kRightPage };
72 
74 enum DocPageBinding {
76  kDefaultBinding = -1,
78  kLeftToRightBinding,
80  kRightToLeftBinding };
81 
87 class ILayoutUtils : public IPMUnknown
88 {
89 public:
90  enum { kDefaultIID = IID_ILAYOUTUTILS };
91 
96  virtual bool16 FindDocument(const UIDRef& docRef) = 0;//SEIssue <sheridan>
97 
108  virtual UID GetOwnerPageUID(const IHierarchy* pageItemHier, bool16 enlargeForSlug = kFalse) = 0;
109 
121  virtual UID GetDrawingPageUID(const IHierarchy* pageItemHier, bool16 enlargeForSlug = kFalse) = 0;
122 
141  virtual void EnlargePagesRectBySlug(IDataBase *db, PMRect& pageRect, int32 pageIndex, int32 spreadPageCount, PageType pageType, bool16 bPrintingOrExporting = kFalse, int32 trueSpreadPageCount = 0) = 0;
142 
155  virtual UID GetIntersectingPageUID(const UIDRef& spreadRef, const PBPMRect& itemBounds, bool16 enlargeForSlug = kFalse, const Transform::CoordinateSpace &coordinateSpace = Transform::PasteboardCoordinates()) = 0;
156 
165  virtual PageType GetPageType(const UIDRef& pageRef) = 0;
166 
167 
174  virtual DocPageBinding GetDocumentPageBinding(const UIDRef& docRef) = 0;
175 
182  virtual IPMUnknown *QueryParentFor(const IPMUnknown *pUnknown, const PMIID &rIID) = 0;
183 
190  virtual IPMUnknown *QueryOutermostParentFor(const IPMUnknown *pUnknown, const PMIID &rIID) = 0;
191 
199  virtual int32 GetMaxSpreadSize(const ISpread *theSpread = nil,
200  bool16 bFactorInIslandness = kTrue,
201  bool16 bFactorInFirstOddPage = kTrue,
202  bool16 bFactorInPagesPerSpreadPref = kTrue) = 0;
203 
204  // For now, hard code the limits on spreads & pages. Eventually, these should
205  // come from a resource. TODO : convert the tagged into real functions, initialized from
206  // a resource
207  //
211  virtual int32 GetMinNumPages() = 0;
213  virtual int32 GetMaxNumPages() = 0; /* CONVERT TO RESOURCE BASED */
215  virtual int32 GetMinPagesPerSpread() = 0;
217  virtual int32 GetMaxPagesPerSpread() = 0; /* CONVERT TO RESOURCE BASED */
219  virtual int32 GetMinPageWidth() = 0; /* CONVERT TO RESOURCE BASED */
221  virtual int32 GetMaxPageWidth() = 0; /* 18 Feet. CONVERT TO RESOURCE BASED */
223  virtual int32 GetMinPageLength() = 0; /* CONVERT TO RESOURCE BASED */
225  virtual int32 GetMaxPageLength() = 0; /* 18 Feet. CONVERT TO RESOURCE BASED */
227 
240  virtual bool16 DoesPageHaveContent(const UIDList& pageUIDList) = 0;
241 
250  virtual IMargins* QueryMargins(int32 whichPage, const ISpread* currentSpread) = 0;
251 
260  virtual IColumns* Query_Columns(int32 whichPage, const ISpread* currentSpread) = 0;
261 
269  virtual ICommand* MakeShuffleCmd(IDocument* doc,
270  const UIDRef& firstSpread = UIDRef::gNull,
271  const UIDRef& lastSpread = UIDRef::gNull) = 0;
272 
278  virtual bool16 IsAMaster(UID spreadOrPageUID, IDataBase *db) = 0;
279 
285  virtual void InvalidateViews(IDocument* document) = 0;
286 
296  virtual IPMUnknown* SpreadQueryHitTestPageItemNew(const ISpread* mySpread, const PBPMPoint& where, ClassID handlerClass, const PMIID& interfaceID, int16 tolerance = kHitTestTolerance) = 0;
297 
298 #ifdef ID_DEPRECATED
299 
324  virtual void M2MValidateAll(IDataBase* db) = 0;
325 #endif
326 
327 };
328 
329 
330 #endif // __ILayoutUtils__