InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPDFHyperlinks.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Steve Flenniken
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 __IPDFHyperlinks__
25 #define __IPDFHyperlinks__
26 
27 #include "PMRect.h"
28 #include "KeyValuePair.h"
29 #include "PDFID.h"
30 class PMMatrix;
31 
32 typedef struct _t_PDDoc *PDDoc;
33 typedef struct _t_PDPage *PDPage;
34 typedef struct OPAQUE_64_BITS CosObj;
35 typedef OPAQUE_64_BITS PDAnnot;
36 
37 // Used to store a list of page indeces that documents start page
40 
44 {
45 public:
49 
52  int32 borderWidth;
53 
57 
61 
69 
73 
77 
81 
85 };
86 
98 class IPDFHyperlinks : public IPMUnknown
99 {
100 public:
101  enum { kDefaultIID = IID_IPDFHYPERLINKS };
102 
106  {
109  DestXYZ = 0,
110 
114 
119 
123 
127 
132 
136 
140  };
141 
146  {
147  public:
150  PageDestination() : fPageIndex(0), fDestinationType(DestXYZ), fInheritRect(true), fInheritZoom(true) {};
151 
160  PageDestination(const uint32 pageIndex, const DestinationType destinationType, const PMRect &destinationRect, const PMReal &zoomFactor) :
161  fPageIndex(pageIndex), fDestinationType(destinationType), fDestinationRect(destinationRect), fZoomFactor(zoomFactor),
162  fInheritRect(pageIndex), fInheritZoom(destinationType) {};
163  ~PageDestination() {};
164 
168  uint32 GetPageIndex() const {return fPageIndex;} ;
169 
173  DestinationType GetDestinationType() const {return fDestinationType;};
174 
178  const PMRect &GetDestinationRect() const {return fDestinationRect;};
179 
183  PMReal GetZoomFactor() const {return fZoomFactor;};
184 
188  bool32 GetInheritRect() const {return fInheritRect;};
189 
193  bool32 GetInheritZoom() const {return fInheritZoom;};
194 
195  private:
196  uint32 fPageIndex;
197  DestinationType fDestinationType;
198  PMRect fDestinationRect;
199  PMReal fZoomFactor;
200  bool32 fInheritRect;
201  bool32 fInheritZoom;
202  };
203 
216  virtual ErrorCode BeginBook(PDDoc thePDDoc, bool32 addHyperlinks, IDataBase *db, bool32 addBookmarks, bool32 bookExport, DocPageIndexList docIndexList, bool16 readerSpreads, bool16 layers = false) = 0;
217 
221  virtual ErrorCode EndBook() = 0;
222 
227  virtual ErrorCode BeginDocument(IDataBase *db) = 0;
228 
231  virtual ErrorCode EndDocument() = 0;
232 
238  virtual ErrorCode BeginPage(PDPage thePDPage, PMRect &pageBounds, PMMatrix &pageBoundsToSpreadMatrix, UID pageUID) = 0;
239 
242  virtual ErrorCode EndPage() = 0;
243 
252  virtual ErrorCode HyperlinkHotSpot(const PMRect &hotSpot, const PMString &name, const HotSpotAttributes *pAttributes = nil, int32 *pAnnotation = nil) = 0;
253 
262  virtual ErrorCode HyperlinkHotSpotPage(const PMRect &hotSpot, int32 pageIndex, const HotSpotAttributes *pAttributes = nil, int32 *pAnnotation = nil) = 0;
263 
273  virtual ErrorCode HyperlinkHotSpotURL(const PMRect &hotSpot, const PMString &theURL, const bool32 isMap, const HotSpotAttributes *pAttributes = nil, int32 *pAnnotation = nil) = 0;
274 
277  enum NamedType {
280  NextPage = 0,
290 
299  virtual ErrorCode HyperlinkHotSpotNamed(const PMRect &hotSpot, NamedType namedType, const HotSpotAttributes *pAttributes = nil, int32 *pAnnotation = nil) = 0;
300 
311  virtual ErrorCode HyperlinkHotSpotExternal(const PMRect &hotSpot, const PMString &name, const PMString &fullpath, bool32 bNewWindow = false, const HotSpotAttributes *pAttributes = nil, int32 *pAnnotation = nil) = 0;
312 
320  virtual ErrorCode HyperlinkDestination(const PMString &name, DestinationType destType, const PMRect *destRect = nil, const PMReal *zoomFactor = nil) = 0;
321 
329  virtual ErrorCode GetLinkAnnotation(int32 annotation, CosObj *page, PDAnnot *annot) = 0;
330 
339  virtual ErrorCode CreateHyperlink(IDataBase *db, UID hyperlinkUID, PMRect &hotSpot, int32 *linkAnnotation) = 0;
340 
352  virtual ErrorCode HyperlinkHotSpotExternalPage(const PMRect &hotSpot, const PageDestination &pageDestination, const PMString &fullpath, bool32 bNewWindow = false, const HotSpotAttributes *pAttributes = nil, int32 *pAnnotation = nil) = 0;
353 
357  virtual ErrorCode BeginLayer(CosObj layerInfo) = 0;
358 
361  virtual ErrorCode EndLayer() = 0;
362 
370  virtual ErrorCode CreateEndnoteRefLink(IDataBase *db, UID endnoteUID, PMRect &hotSpot, int32 *linkAnnotation) = 0;
371 
379  virtual ErrorCode CreateEndnoteRangeLink(IDataBase *db, UID endnoteRangeUID, PMRect &hotSpot, int32 *linkAnnotation) = 0;
380 
388  virtual ErrorCode GetEndnotelinkAnnotation(int32 annotation, CosObj *page, PDAnnot *annot) = 0;
389 
395  virtual ErrorCode GetHyperlinkAltText(int32 annotation, PMString& altText) = 0;
396 };
397 
398 #endif