Foxit PDF SDK
fs_compare.h
Go to the documentation of this file.
1 
15 #ifndef FS_COMPARE_H_
16 #define FS_COMPARE_H_
17 
18 #include "common/fs_common.h"
19 #include "pdf/fs_pdfdoc.h"
20 #include "pdf/fs_pdfpage.h"
21 
27 namespace foxit {
31 namespace addon {
35 namespace comparison {
37 class CompareResultInfo FS_FINAL : public Object {
38  public:
44  typedef enum _CompareResultType {
80 
81 
91  this->type = type;
92  this->rect_array = rect_array;
93  this->diff_contents = diff_contents;
94  }
95 
99 
105  CompareResultInfo(const CompareResultInfo& result_info) {
106  this->type = result_info.type;
107  this->rect_array = result_info.rect_array;
108  this->diff_contents = result_info.diff_contents;
109  }
110 
119  this->type = result_info.type;
120  this->rect_array = result_info.rect_array;
121  this->diff_contents = result_info.diff_contents;
122 
123  return *this;
124  }
125 
131 
134 
137 };
138 
141 
142 
148 class CompareResults FS_FINAL : public Object {
149  public:
156  CompareResults(CompareResultInfoArray base_doc_results, CompareResultInfoArray compared_doc_results)
157  : base_doc_results(base_doc_results), compared_doc_results(compared_doc_results) {
158  }
159 
162 
168  CompareResults(const CompareResults& compare_results)
169  : base_doc_results(compare_results.base_doc_results)
170  , compared_doc_results(compare_results.compared_doc_results) {}
171 
179  CompareResults& operator = (const CompareResults& compare_results) {
180  base_doc_results = compare_results.base_doc_results;
181  compared_doc_results = compare_results.compared_doc_results;
182 
183  return *this;
184  }
185 
191  void Clear()
192  {
193  base_doc_results.RemoveAll();
194  compared_doc_results.RemoveAll();
195  }
196 
202 
208 };
209 
213 class Comparison FS_FINAL : public Base {
214  public:
220  typedef enum _CompareType {
222  e_CompareTypeAll = 0x00000000,
224  e_CompareTypeText = 0x00000001,
227  } CompareType;
228 
229 
240  explicit Comparison(const pdf::PDFDoc& base_doc, const pdf::PDFDoc& compared_doc);
241 
247  Comparison(const Comparison& other);
248 
249  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
250  explicit Comparison(FS_HANDLE handle);
251 
253  ~Comparison();
254 
262  Comparison& operator = (const Comparison& other);
263 
271  bool operator == (const Comparison& other) const;
272 
280  bool operator != (const Comparison& other) const;
281 
289  bool IsEmpty() const;
290 
304  CompareResults DoCompare(int base_page_index, int compared_page_index, foxit::uint32 compare_flags);
305 
318 
333  pdf::PDFDoc GenerateComparedDoc(foxit::uint32 compare_flags, bool is_show_all_layers);
334 };
335 } // namespace comparison
336 } // namespace addon
337 } // namespace foxit
338 
339 #endif // FS_COMPARE_H_
340 
Result type: delete annotation.
Definition: fs_compare.h:72
CompareResultInfo(const CompareResultInfo &result_info)
Constructor, with another result information object.
Definition: fs_compare.h:105
Compare all content. This value should be used alone.
Definition: fs_compare.h:222
CompareType
Enumeration for compare type flags.
Definition: fs_compare.h:220
CFX_Object Object
Object type.
Definition: fs_basictypes.h:221
Header file for PDF document related definitions and classes.
CompareResultInfo(CompareResultType type, RectFArray rect_array, WString diff_contents)
Constructor, with parameters.
Definition: fs_compare.h:90
Result type: replace annotation.
Definition: fs_compare.h:76
bool operator==(const Comparison &other) const
Equal operator.
bool IsEmpty() const
Check whether current object is empty or not.
Comparison(const pdf::PDFDoc &base_doc, const pdf::PDFDoc &compared_doc)
Constructor, from PDF document object.
WIDE STRING CLASS.
Definition: fx_string.h:1461
CompareResults()
Constructor.
Definition: fs_compare.h:161
Compare text only.
Definition: fs_compare.h:224
Definition: fs_pdfdoc.h:648
CompareResultInfo & operator=(const CompareResultInfo &result_info)
Assign operator.
Definition: fs_compare.h:118
Result type: delete path.
Definition: fs_compare.h:60
Result type: delete image.
Definition: fs_compare.h:54
Comparison & operator=(const Comparison &other)
Assign operator.
Result type: delete shading.
Definition: fs_compare.h:66
Definition: fs_compare.h:213
CompareResults(CompareResultInfoArray base_doc_results, CompareResultInfoArray compared_doc_results)
Constructor, with parameters.
Definition: fs_compare.h:156
CompareResultInfo()
Constructor.
Definition: fs_compare.h:97
Result type: replace path.
Definition: fs_compare.h:64
Result type: insert image.
Definition: fs_compare.h:56
CompareResultInfoArray base_doc_results
A result information array, which contains all the compared results of a PDF page (which has been com...
Definition: fs_compare.h:201
Result type: insert shading.
Definition: fs_compare.h:68
Result type: replace image.
Definition: fs_compare.h:58
WString diff_contents
Different contents as compared result.
Definition: fs_compare.h:136
Result type: delete text.
Definition: fs_compare.h:48
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:196
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
Header file for common definitions and classes.
pdf::PDFDoc GenerateComparedDoc(foxit::uint32 compare_flags)
Compare the base document with the compared document (which are used to construct current object) and...
Compare annotation only.
Definition: fs_compare.h:226
Definition: fs_basictypes.h:443
Header file for PDF page related definitions and classes.
Result type: insert annotation.
Definition: fs_compare.h:74
CompareResults DoCompare(int base_page_index, int compared_page_index, foxit::uint32 compare_flags)
Compare a PDF page of base document with a PDF page in compared document. "base document" and "compar...
void Clear()
Clear all the result information.
Definition: fs_compare.h:191
RectFArray rect_array
Rectangle array which specifies the location of parameter diff_contents in the PDF page to be compare...
Definition: fs_compare.h:133
Foxit namespace.
Definition: fs_taggedpdf.h:27
(Reserved, not supported yet) Result type: text attribute change.
Definition: fs_compare.h:78
Result type: insert text.
Definition: fs_compare.h:50
Result type: insert path.
Definition: fs_compare.h:62
Result type: replace shading.
Definition: fs_compare.h:70
Result type: replace text.
Definition: fs_compare.h:52
bool operator !=(const Comparison &other) const
Not equal operator.
CompareResultType type
Result type. Please refer to values starting from CompareResultInfo::e_CompareResultTypeNone and this...
Definition: fs_compare.h:130
CompareResultInfoArray compared_doc_results
A result information array, which contains all the compared results of a PDF page (which has been com...
Definition: fs_compare.h:207
Result type: unsupported or invalid.
Definition: fs_compare.h:46
CompareResults(const CompareResults &compare_results)
Constructor, with another compare results object.
Definition: fs_compare.h:168
CompareResultType
Enumeration for compare result type.
Definition: fs_compare.h:44
Definition: fs_compare.h:148