InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SDKLayoutHelper.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Adobe Developer Technologies
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 __SDKLayoutHelper_H_DEFINED__
25 #define __SDKLayoutHelper_H_DEFINED__
26 
27 #include "IDocFileHandler.h" // or include from client code?
28 #include "PMPathPoint.h" // because I can't forward decl PMPathPointList?
29 class ITextModel;
30 class ITextFrameColumn;
31 class IGraphicFrameData;
32 
63 
64  public:
65 
69 
72  virtual ~SDKLayoutHelper();
73 
74  public:
75  // Document manipulation helper methods.
76 
89  UIDRef CreateDocument(const UIFlags uiFlags = K2::kFullUI,
90  const PMReal& width = 612,
91  const PMReal& height = 792,
92  const int32 pages = 1,
93  const int32 pagesPerSpread = 1,
94  const int32 pageBinding = 0);
95 
103  UIDRef OpenDocument(const IDFile& sysFile,
104  UIFlags uiFlags = K2::kFullUI);
105 
114  ErrorCode CloseDocument(const UIDRef& documentUIDRef,
115  bool16 saveOnClose = kFalse,
116  UIFlags uiFlags = K2::kFullUI,
117  bool8 allowCancel = kTrue,
118  IDocFileHandler::CloseCmdMode cmdMode = IDocFileHandler::kSchedule);
119 
128  ErrorCode SaveDocumentAs(const UIDRef& documentUIDRef,
129  const IDFile& sysFile,
130  UIFlags uiFlags = kFullUI);
131 
136  ErrorCode OpenLayoutWindow(const UIDRef& documentUIDRef);
137 
138  public:
139  // Spread & page manipulation:
140 
146  UIDRef GetActiveSpreadLayerRef(const UIDRef& spreadUIDRef,
147  bool16 wantGuideLayer=kFalse);
148 
158  UIDRef GetSpreadLayerRef(const UIDRef& spreadUIDRef,
159  int32 documentLayerIndex=1,
160  bool16 wantGuideLayer=kFalse);
161 
173  PMRect PageToSpread(const UIDRef& pageUIDRef, const PMRect& boundsInPageCoords);
174 
175  public:
176  // Frame creation:
177 
194  UIDRef PlaceFileInFrame(const IDFile& contentFile,
195  const UIDRef& parentUIDRef,
196  const PMRect& boundsInParentCoords,
197  const UIFlags uiFlags = K2::kFullUI,
198  const bool16 retainFormat = kTrue,
199  const bool16 convertQuotes = kTrue,
200  const bool16 applyCJKGrid = kFalse,
201  const UID& uidPreview = kInvalidUID);
202 
210  UIDRef CreateRectangleFrame(const UIDRef& parentUIDRef, const PMRect& boundsInParentCoords);
211 
226  UIDRef CreateTextFrame(const UIDRef& parentUIDRef,
227  const PMRect& boundsInParentCoords,
228  int32 numberOfColumns = 0,
229  bool16 verticalFrame = kFalse,
230  UIDRef* storyUIDRef = nil,
231  bool16 isLeftToRight = kTrue);
232 
241  UIDRef CreateRectangleGraphic(const UIDRef& parentUIDRef, const PMRect& boundsInParentCoords);
242 
257  UIDRef CreateSplineGraphic(const UIDRef& parentUIDRef,
258  const PMRect& boundsInParentCoords,
259  const PMRect& boundsInInnerCoords,
260  PMPathPointList& pathPointList,
261  bool16 bClosedPath = kTrue);
262 
263  public:
264  // Layout model navigation helpers.
265 
273 
279  UIDRef GetTextModelRef(const InterfacePtr<IGraphicFrameData>& graphicFrameData);
280 
281 };
282 
283 
284 
285 #endif // __SDKLayoutHelper_H_DEFINED__
286