InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IAnnotationOrchestrator.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Mudit Rastogi
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 // IAnnotation is the abstract interface to a annotation
24 //
25 //========================================================================================
26 
27 #ifndef __IAnnotationOrchestrator__
28 #define __IAnnotationOrchestrator__
29 
30 #include "IPMUnknown.h"
31 #include "PDFID.h"
32 #include <list>
33 
34 class IDocument;
35 class PMString;
37 class AnnotationItem;
38 
40 {
41 public:
42  enum {kDefaultIID = IID_IANNOTATIONORCHESTRATOR };
43 
44 
45  /* Import the annotations from a filepath. Importing involves steps such as fetching of comments, mapping them into ID space and saving into target document object model.
46  @param targetDoc IN - the target document where comments will be imported and persisted
47  @param sourceExtension IN - the extension of source file
48  @param filePath IN - the path of file from where annotations need to be imported
49  */
50  virtual ErrorCode ImportAnnotations(IDocument* targetDoc, const char * sourceExtension, const char * filePath) = 0;
51 
52 
53  /* Import the annotations from filepathList, thus enabling batch import of annotations. Importing involves steps such as fetching of comments, mapping them into ID space and saving into target document object model.
54  @param targetDoc IN - the target document where comments will be imported and persisted
55  @param sourceExtension IN - the extension of source file
56  @param filePathList IN - the list of file paths from where annotations need to be imported
57  */
58  virtual ErrorCode ImportAnnotations(IDocument* targetDoc, const char * sourceExtension, const std::vector<const char*> & filePathList) = 0;
59 
60  /* Import the annotations directly from list of annotations. Importing involves mapping all the given annotations into ID space and saving into target document object model.
61  @param targetDoc IN - the target document where comments will be imported and persisted
62  @param annotCollection IN - collection of all annotations
63  */
64  virtual void ImportAnnotations(IDocument* targetDoc, AnnotationCollection& annotCollection) = 0;
65 
66  /* Map the annotation directly to given page and save into target document object model.
67  @param pageRef IN - the UIDRef of target page
68  @param annotItem IN - annotation which will be mapped to page
69  */
70  virtual ErrorCode AddAnnotationToPage(const UIDRef &pageRef, const AnnotationItem &annotItem) = 0;
71 
72  /* Map the annotation directly to given page item and save into target document object model.
73  @param pageItemRef IN - the UIDRef of target page item
74  @param annotItem IN - annotation which will be mapped to page item
75  */
76  virtual ErrorCode AddAnnotationToPageItem(const UIDRef &pageItemRef, const AnnotationItem &annotItem) = 0;
77 
78  /* Map the annotation directly to given text range and save into target document object model.
79  @param textUIDRef IN - the UIDRef of target text frame model
80  @param startIndex IN - start index of text range
81  @param endIndex IN - end index of text range
82  @param annotItem IN - annotation which will be mapped to text range
83  */
84  virtual ErrorCode AddAnnotationToTextRange(const UIDRef &textUIDRef, const TextIndex &startIndex, const TextIndex &endIndex, const AnnotationItem &annotItem) = 0;
85 
86  /* Map the annotation list directly to given page and save into target document object model.
87  @param pageRef IN - the UIDRef of target page
88  @param annotItemList IN - annotation list which will be mapped to page
89  */
90  virtual void AddAnnotationListToPage(const UIDRef &pageRef, const std::list<AnnotationItem*> &annotItemList) = 0;
91 
92  /* Map the annotation list directly to given page item and save into target document object model.
93  @param pageItemRef IN - the UIDRef of target page item
94  @param annotItemList IN - annotation list which will be mapped to page item
95  */
96  virtual void AddAnnotationListToPageItem(const UIDRef &pageItemRef, const std::list<AnnotationItem*> &annotItemList) = 0;
97 
98  /* Map the annotation list directly to given text range and save into target document object model.
99  @param textUIDRef IN - the UIDRef of target text frame model
100  @param startIndex IN - start index of text range
101  @param endIndex IN - end index of text range
102  @param annotItemList IN - annotation list which will be mapped to text range
103  */
104  virtual void AddAnnotationListToTextRange(const UIDRef &textUIDRef, TextIndex startIndex, TextIndex endIndex, const std::list<AnnotationItem*> &annotItemList) = 0;
105 
106  /* Import the annotations from the review collaboration json data. Importing involves mapping all the given annotations into ID space and saving into target document object model.
107  @param targetDoc IN - the target document where comments will be imported and persisted
108  @param commentData IN - Json data from commenting component
109  */
110  virtual ErrorCode ImportRCAnnotations(IDocument* targetDoc, const std::string& commentData) = 0;
111 
112  /* Refresh annotation from cache.
113  @param targetDoc IN - the target document where comments will be imported and persisted
114  */
115  virtual ErrorCode RefreshRCAnnotationsFromCache(IDocument* targetDoc) = 0;
116 };
117 
118 #endif //__IAnnotationOrchestrator__