InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IXMLExportUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Dave Stephens
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 __IXMLExportUtils__
25 #define __IXMLExportUtils__
26 
27 #include "IPMUnknown.h"
28 #include "IXMLExportOptions.h"
29 #include "TransformTypes.h"
30 
31 class IPMStream;
32 class XMLReference;
33 class IXMLExportOptions;
34 class IXMLOutStream;
35 class PMString;
36 class ILinkObject;
37 class ILinkResource;
38 
39 typedef void* ExportSessionToken;
40 
44 {
45 public:
46  enum {kDefaultIID = IID_IXMLEXPORTUTILS};
47 
51  {
61  };
62 
63 
72  virtual ErrorCode GenerateOptimizedImage(const IPMUnknown *pageItem, IPMStream *outStream, const IXMLExportOptions* options, const PMReal& desiredWidth = 0) = 0;
73 
87  virtual ErrorCode GenerateFormattedImage(const IPMUnknown *pageItem, IPMStream *outStream, const IXMLExportOptions* options, bool32 includeFrameInRendering = kTrue,bool16 bItemBackgroundExportAsPng = kFalse, bool16 bDrawNonPrintingObjects = kTrue, PMReal greekBelowPtSize = 0.0) = 0;
88 
95  virtual IXMLExportOptions::ImageType GetBestOptimizedImageType(const IPMUnknown *pageItem) const = 0;
96 
104  virtual IXMLExportOptions::ImageType GetBestFormattedImageType(const IPMUnknown *pageItem, bool16 shouldKeepSVGAsEmbededSVGImage = kFalse) const = 0;
105 
114  virtual void CopyOriginal(IXMLOutStream *stream, const IDFile& imagesFolder, ILinkObject* iLinkObject, ExportSessionToken sessionToken, const PMString* linkName = nil) const = 0;
115 
122  virtual void CopyOriginal(IXMLOutStream *stream, const IDFile& imagesFolder, const IDFile& sourceFile, ExportSessionToken sessionToken) const = 0;
123 
134  virtual void OptimizeOriginal(IXMLOutStream *stream, IXMLExportOptions* exportOptions, const IDFile& imagesFolder, ILinkObject* iLinkObject, ExportSessionToken sessionToken, const PMReal& desiredWidth = 0) const = 0;
135 
148  virtual void FormatOriginal(IXMLOutStream *stream,
149  IXMLExportOptions* exportOptions,
150  const IDFile& imagesFolder,
151  ILinkObject* iLinkObject,
152  const XMLReference *element,
153  ExportSessionToken sessionToken,
154  bool32 includeFrameInRendering = kTrue) const = 0;
155 
159  virtual bool16 HasTransparency(const IPMUnknown *pageItem) const = 0;
160 
169  virtual PMString GetDestinationImageName( ExportImageOption exportImageOption, const IDFile& imagesFolder, ILinkObject* iLinkObject, const IXMLExportOptions* exportOptions, bool16 overwriteDestination = kFalse ) const = 0;
170 
177  virtual void WriteDocumentHeader(IXMLOutStream *xmlStream, IXMLExportOptions* exportOptions, const PMString& rootName) const = 0;
178 
184  virtual void OpenFileInApp( const IDFile& appFile, const PMString& fileURL ) const = 0;
185 
195  virtual bool32 NeedsRasterizationOrSVG(const IPMUnknown *imageItem,
196  bool32 checkForRotationOrSkew = kTrue,
197  bool32 checkForTransparency = kTrue,
198  bool32 checkForImageClipping = kTrue,
199  bool32 checkForFrameCropping = kTrue,
200  bool32 checkForVectorGraphic = kTrue) const = 0;
204  virtual bool16 isSVGItem(const IPMUnknown *imageItem) const = 0;
205 
218  virtual void OptimizeOriginal2(IXMLOutStream *stream, IXMLExportOptions* exportOptions, const IDFile& imagesFolder, bool32 useOriginalImageNameOnly, ILinkObject* iLinkObject, ExportSessionToken sessionToken, const PMReal& desiredWidth = 0) const = 0;
219 
234  virtual void FormatOriginal2(IXMLOutStream *stream,
235  IXMLExportOptions* exportOptions,
236  const IDFile& imagesFolder,
237  bool32 useOriginalImageNameOnly,
238  ILinkObject* iLinkObject,
239  const XMLReference *element,
240  ExportSessionToken sessionToken,
241  bool32 includeFrameInRendering = kTrue
242  ) const = 0;
243 
257  virtual ErrorCode GenerateFormattedImageForText(const IPMUnknown *pageItem,
258  IPMStream *outStream,
259  const IXMLExportOptions* options,
260  bool32 includeFrameInRendering = kTrue,
261  bool16 bItemBackgroundExportAsPng = kTrue, // by default export as PNG
262  bool16 excludeText = kFalse
263  ) = 0;
264 
265 
275  virtual PMRect GetPrintedBBoxForTextFrame(const UIDRef &textFrameRef, const PMMatrix& theMatrix, const Transform::CoordinateSpace& coordinateSpace /*= Transform::PasteboardCoordinates()*/, bool32 includeAdornments = kTrue) = 0;
276 
291  virtual ErrorCode GenerateFormattedImage2(const IPMUnknown *pageItem, IPMStream *outStream, const IXMLExportOptions* options, bool32 includeFrameInRendering = kTrue, bool16 bItemBackgroundExportAsPng = kFalse, bool16 bDrawNonPrintingObjects = kTrue, PMReal greekBelowPtSize = 0.0, bool16 includeOtherBackgroundObjects = kFalse) = 0;
292 
307  virtual ErrorCode GenerateFormattedImageForText2(const IPMUnknown *pageItem,
308  IPMStream *outStream,
309  const IXMLExportOptions* options,
310  bool32 includeFrameInRendering = kTrue,
311  bool16 bItemBackgroundExportAsPng = kTrue, // by default export as PNG
312  bool16 excludeText = kFalse,
313  bool16 includeOtherBackgroundObjects = kFalse
314  ) = 0;
315 
324  virtual void CopyOriginal(IXMLOutStream *stream, const IDFile& imagesFolder, ILinkResource* iLinkResource, ExportSessionToken sessionToken, const PMString* linkName = nil) const = 0;
325 };
326 
327 
328 #endif