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 
102 
108  CompareResultInfo(const CompareResultInfo& result_info) {
109  this->type = result_info.type;
110  this->rect_array = result_info.rect_array;
111  this->diff_contents = result_info.diff_contents;
112  }
113 
122  this->type = result_info.type;
123  this->rect_array = result_info.rect_array;
124  this->diff_contents = result_info.diff_contents;
125 
126  return *this;
127  }
128 
134 
137 
140 };
141 
144 
145 
151 class CompareResults FS_FINAL : public Object {
152  public:
159  CompareResults(CompareResultInfoArray base_doc_results, CompareResultInfoArray compared_doc_results)
160  : base_doc_results(base_doc_results), compared_doc_results(compared_doc_results) {
161  }
162 
165 
168 
174  CompareResults(const CompareResults& compare_results)
175  : base_doc_results(compare_results.base_doc_results)
176  , compared_doc_results(compare_results.compared_doc_results) {}
177 
185  CompareResults& operator = (const CompareResults& compare_results) {
186  base_doc_results = compare_results.base_doc_results;
187  compared_doc_results = compare_results.compared_doc_results;
188 
189  return *this;
190  }
191 
197  void Clear()
198  {
199  base_doc_results.RemoveAll();
200  compared_doc_results.RemoveAll();
201  }
202 
208 
214 };
215 
219 class Comparison FS_FINAL : public Base {
220  public:
226  typedef enum _CompareType {
228  e_CompareTypeAll = 0x00000000,
230  e_CompareTypeText = 0x00000001
231  } CompareType;
232 
233 
244  explicit Comparison(const pdf::PDFDoc& base_doc, const pdf::PDFDoc& compared_doc);
245 
251  Comparison(const Comparison& other);
252 
253  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
254  explicit Comparison(FS_HANDLE handle);
255 
257  ~Comparison();
258 
266  Comparison& operator = (const Comparison& other);
267 
275  bool operator == (const Comparison& other) const;
276 
284  bool operator != (const Comparison& other) const;
285 
293  bool IsEmpty() const;
294 
308  CompareResults DoCompare(int base_page_index, int compared_page_index, foxit::uint32 compare_flags);
309 
322 };
323 } // namespace comparison
324 } // namespace addon
325 } // namespace foxit
326 
327 #endif // FS_COMPARE_H_
328 
Result type: delete shading.
Definition: fs_compare.h:66
Comparison & operator=(const Comparison &other)
Assign operator.
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
Result type: replace image.
Definition: fs_compare.h:58
Result type: insert annotation.
Definition: fs_compare.h:74
Result type: insert text.
Definition: fs_compare.h:50
bool operator==(const Comparison &other) const
Equal operator.
Result type: delete annotation.
Definition: fs_compare.h:72
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
WString diff_contents
Different contents as compared result.
Definition: fs_compare.h:139
CompareResultType type
Result type. Please refer to values starting from CompareResultInfo::e_CompareResultTypeNone and this...
Definition: fs_compare.h:133
Header file for common definitions and classes.
CompareResults(CompareResultInfoArray base_doc_results, CompareResultInfoArray compared_doc_results)
Constructor, with parameters.
Definition: fs_compare.h:159
Result type: replace text.
Definition: fs_compare.h:52
CompareResultType
Enumeration for compare result type.
Definition: fs_compare.h:44
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:207
bool IsEmpty() const
Check whether current object is empty or not.
Result type: delete path.
Definition: fs_compare.h:60
RectFArray rect_array
Rectangle array which specifies the location of parameter diff_contents in the PDF page to be compare...
Definition: fs_compare.h:136
CompareResultInfo(CompareResultType type, RectFArray rect_array, WString diff_contents)
Constructor, with parameters.
Definition: fs_compare.h:90
(Reserved, not supported yet) Result type: text attribute change.
Definition: fs_compare.h:78
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...
CompareResults()
Constructor.
Definition: fs_compare.h:164
Result type: delete image.
Definition: fs_compare.h:54
~CompareResultInfo()
Destructor.
Definition: fs_compare.h:101
Compare all content. This value should be used alone.
Definition: fs_compare.h:228
pdf::PDFDoc GenerateComparedDoc(foxit::uint32 compare_flags)
Compare the base document with compared document (which are used to construct current object) and the...
Result type: replace path.
Definition: fs_compare.h:64
Result type: replace shading.
Definition: fs_compare.h:70
CompareResultInfo & operator=(const CompareResultInfo &result_info)
Assign operator.
Definition: fs_compare.h:121
Header file for PDF page related definitions and classes.
Result type: insert shading.
Definition: fs_compare.h:68
Foxit namespace.
Definition: fs_compare.h:27
void Clear()
Clear all the result information.
Definition: fs_compare.h:197
Result type: insert image.
Definition: fs_compare.h:56
Header file for PDF document related definitions and classes.
CompareResultInfo()
Constructor.
Definition: fs_compare.h:97
CompareResults(const CompareResults &compare_results)
Constructor, with another compare result object.
Definition: fs_compare.h:174
Result type: delete text.
Definition: fs_compare.h:48
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:213
Definition: fs_pdfdoc.h:389
CompareResultInfo(const CompareResultInfo &result_info)
Constructor, with another result information object.
Definition: fs_compare.h:108
CompareType
Enumeration for compare type flags.
Definition: fs_compare.h:226
Result type: insert path.
Definition: fs_compare.h:62
Definition: fs_compare.h:151
WIDE STRING CLASS.
Definition: fx_string.h:1452
Definition: fs_compare.h:219
Comparison(const pdf::PDFDoc &base_doc, const pdf::PDFDoc &compared_doc)
Constructor, from PDF document object.
Compare text only.
Definition: fs_compare.h:230
Result type: replace annotation.
Definition: fs_compare.h:76
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
~CompareResults()
Destructor.
Definition: fs_compare.h:167
bool operator !=(const Comparison &other) const
Not equal operator.
Result type: unsupported or invalid.
Definition: fs_compare.h:46
Definition: fs_basictypes.h:399