InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CHMLFiltHelper.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 __CHMLFiltHelper_H_DEFINED__
25 #define __CHMLFiltHelper_H_DEFINED__
26 
27 #include <map>
28 #include "PMRect.h"
29 
35 public:
36  // (irp Apr 24 03) If this is not object_type, then the destructor won't get
37  // called and then you get a leak from the objects that are instance
38  // variables
39  typedef object_type data_type;
40 
47  eTextFrame,
50 
53  fPage(0),
54  fLayoutObjectType(eUnknown),
55  fDataLinkPath("UNDEFINEDDATALINK") {}
56 
62  CHMLGraphicFrameMetaData(LayoutObjectType type, int32 page, const PMRect& bboxRectInPage) :
63  fLayoutObjectType(type),
64  fRectInPage(bboxRectInPage),
65  fPage(page),
66  fDataLinkPath("UNDEFINEDDATALINK") {}
67 
74  CHMLGraphicFrameMetaData(LayoutObjectType type, int32 page, const PMRect& bboxRectInPage, const PMString& datalinkpath) :
75  fLayoutObjectType(type), fRectInPage(bboxRectInPage), fPage(page), fDataLinkPath(datalinkpath) {}
76 
77 
82  LayoutObjectType GetLayoutObjectType() const { return fLayoutObjectType; }
83 
88  int32 GetPage() const { return fPage; }
89 
94  PMRect GetRectInPage() const { return fRectInPage; }
95 
99  PMString GetDataLinkPath() const { return fDataLinkPath;}
100 
104  void SetDataLinkPath(const PMString& path) { this->fDataLinkPath = path;}
105 private:
106  int32 fPage;
107  PMRect fRectInPage;
108  LayoutObjectType fLayoutObjectType;
109  PMString fDataLinkPath;
110 };
111 
112 class IDocument;
113 class IPMStream;
114 class ISpreadList;
115 
120 
121  public:
122 
124  CHMLFiltHelper();
125 
127  virtual ~CHMLFiltHelper();
128 
129 
135  ErrorCode ExportLayout(IPMStream* stream, IDocument* doc, IPMUnknown* targetBoss=nil);
136 
142  void ExportLayout(const IDFile& sysFile, IDocument* doc, IPMUnknown* targetBoss=nil);
143 
149  int32 GlobalFromLocalPageIndex(ISpreadList* spreadList, int32 inSpreadIndex, int32 relativePageIndex);
150 
161  UIDRef GetDefaultSpreadLayerRef(const UIDRef& docUIDRef, int32 spreadIndex);
162 
163 private:
164  void collectGraphicFrames(const UIDRef& docRef, K2Vector<CHMLGraphicFrameMetaData>& collectFrames);
165  void addGraphicFrameDescription(const UIDRef& docRef,
166  const UIDRef& pageItemRef,
168  int32 absolPage);
169  void writeStream(IPMStream* stream, const CHMLGraphicFrameMetaData& metadata);
170  void writeStream(IPMStream* stream, const PMString& str);
171 
172 };
173 
174 
175 
176 
177 
178 
179 
180 #endif // __CHMLFiltHelper_H_DEFINED__
181