Foxit PDF SDK
fs_compliancecommon.h
Go to the documentation of this file.
1 
16 #ifndef FS_COMPLIANCEENGINE_H_
17 #define FS_COMPLIANCEENGINE_H_
18 
19 #include "common/fs_common.h"
20 
26 namespace foxit {
30 namespace addon {
34 namespace compliance {
44 class ComplianceEngine FS_FINAL : public Object{
45  public:
78  static ErrorCode Initialize(const wchar_t* compliance_resource_folder_path, const char* compliance_engine_unlockcode);
79 
88  static void Release();
89 
102  static void SetTempFolderPath(const wchar_t* temp_folder_path);
103 
120  static void SetLanguage(const char* language);
121 };
122 
128  public:
134  virtual void Release() = 0;
135 
144  virtual void UpdateCurrentStateData(int current_rate, const WString& current_state_string) = 0;
145 
146  protected:
147  ~ProgressCallback() {}
148 };
149 
153 class FixupData : public Object {
154  public:
160  typedef enum _FixupState {
167  } FixupState;
168 
169 
172  : used_count(0)
174 
180  FixupData(const FixupData& other)
181  : used_count(other.used_count)
182  , state(other.state)
183  , name(other.name)
184  , comment(other.comment)
185  , reasons(other.reasons) {}
186 
194  FixupData& operator = (const FixupData& other) {
195  used_count = other.used_count;
196  state = other.state;
197  name = other.name;
198  comment = other.comment;
199  reasons = other.reasons;
200  return *this;
201  }
202 
210  bool operator == (const FixupData& other) const {
211  bool is_equal = (used_count == other.used_count && state == other.state &&
212  name == other.name && comment == other.comment);
213  if (is_equal) {
214  for (int i=0; i<(int)reasons.GetSize(); i++) {
215  if (reasons[i] != other.reasons[i]) {
216  is_equal = false;
217  break;
218  }
219  }
220  }
221  return is_equal;
222  }
223 
231  bool operator != (const FixupData& other) const {
232  return !((*this) == other);
233  }
234 
248 };
249 
253 class HitData : public Object {
254  public:
260  typedef enum _CheckSeverity {
267  } CheckSeverity;
268 
269 
272  : triggered_count(0)
274  , page_index(-1){}
275 
281  HitData(const HitData& other)
283  , severity(other.severity)
284  , name(other.name)
285  , comment(other.comment)
287  , page_index(other.page_index) {}
288 
296  HitData& operator = (const HitData& other) {
298  severity = other.severity;
299  name = other.name;
300  comment = other.comment;
302  page_index = other.page_index;
303  return *this;
304  }
305 
313  bool operator == (const HitData& other) const {
314  bool is_equal = (triggered_count == other.triggered_count && severity == other.severity &&
315  name == other.name && comment == other.comment && page_index == other.page_index);
316  if (is_equal) {
317  for (int i=0; i<(int)trigger_values.GetSize(); i++) {
318  if (trigger_values[i] != other.trigger_values[i]) {
319  is_equal = false;
320  break;
321  }
322  }
323  }
324  return is_equal;
325  }
326 
334  bool operator != (const HitData& other) const {
335  return !((*this) == other);
336  }
337 
353 };
354 
359 class ResultInformation FS_FINAL : public Base {
360  public:
363  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
364  explicit ResultInformation(FS_HANDLE handle);
372  ResultInformation(const ResultInformation& other);
373 
389  bool operator == (const ResultInformation& other) const;
390 
398  bool operator != (const ResultInformation& other) const;
399 
407  bool IsEmpty() const;
408 
414  int GetFixupDataCount() const;
423  FixupData GetFixupData(int index) const;
424 
430  int GetHitDataCount() const;
439  HitData GetHitData(int index) const;
440 };
441 
442 } // namespace compliance
443 } // namespace addon
444 } // namespace foxit
445 
446 #endif // FS_COMPLIANCEENGINE_H_
447 
virtual void Release()=0
A callback function used to release current callback object itself.
FixupData & operator=(const FixupData &other)
Assign operator.
Definition: fs_compliancecommon.h:194
Error severity.
Definition: fs_compliancecommon.h:266
bool operator !=(const HitData &other) const
Not equal operator.
Definition: fs_compliancecommon.h:334
int page_index
Page index, starting from 0. -1 means current hit data was hit in document level.
Definition: fs_compliancecommon.h:352
CFX_Object Object
Object type.
Definition: fs_basictypes.h:217
HitData GetHitData(int index) const
Get a hit data.
Definition: fs_basictypes.h:224
Definition: fs_compliancecommon.h:359
FixupData GetFixupData(int index) const
Get a fixup data.
uint32 triggered_count
Represents how many times the hit operation for current data has been triggered during verifying or c...
Definition: fs_compliancecommon.h:339
FixupData()
Constructor.
Definition: fs_compliancecommon.h:171
A fixup succeeded.
Definition: fs_compliancecommon.h:162
WStringArray trigger_values
Array of trigger values. The count of triggered values is no more then triggered_count.
Definition: fs_compliancecommon.h:350
CheckSeverity severity
The check severity of current hit data. Please refer to values starting from HitData::e_CheckSeverity...
Definition: fs_compliancecommon.h:344
WIDE STRING CLASS.
Definition: fx_string.h:1452
HitData & operator=(const HitData &other)
Assign operator.
Definition: fs_compliancecommon.h:296
Definition: fs_compliancecommon.h:253
int GetHitDataCount() const
Get count of hit data.
HitData()
Constructor.
Definition: fs_compliancecommon.h:271
HitData(const HitData &other)
Constructor, with another hit data object.
Definition: fs_compliancecommon.h:281
FixupState state
Fixup state. Please refer to values starting from FixupData::e_FixupStateSuccess and this should be o...
Definition: fs_compliancecommon.h:241
WStringArray reasons
Fixup reasons. This may be an empty array. The count of reasons is no more then used_times.
Definition: fs_compliancecommon.h:247
virtual void UpdateCurrentStateData(int current_rate, const WString &current_state_string)=0
A callback function used to update current progress state data to user in order that user can update ...
int GetFixupDataCount() const
Get count of fixup data.
bool operator==(const ResultInformation &other) const
Equal operator.
WString comment
Hit rule comment to explain more details about the rule.
Definition: fs_compliancecommon.h:348
FixupData(const FixupData &other)
Constructor, with another fixup data object.
Definition: fs_compliancecommon.h:180
bool operator==(const FixupData &other) const
Equal operator.
Definition: fs_compliancecommon.h:210
FixupState
Enumeration for the state of a fixup data.
Definition: fs_compliancecommon.h:160
Definition: fs_compliancecommon.h:127
WString name
Fixup rule name.
Definition: fs_compliancecommon.h:243
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:233
bool operator==(const HitData &other) const
Equal operator.
Definition: fs_compliancecommon.h:313
static void SetTempFolderPath(const wchar_t *temp_folder_path)
Set a temp folder for compliance engine.
Definition: fs_compliancecommon.h:44
A fixup failed.
Definition: fs_compliancecommon.h:164
bool operator !=(const ResultInformation &other) const
Not equal operator.
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.
WString comment
Fixup rule comment to explain more details about the rule.
Definition: fs_compliancecommon.h:245
bool operator !=(const FixupData &other) const
Not equal operator.
Definition: fs_compliancecommon.h:231
Info severity.
Definition: fs_compliancecommon.h:262
Warning severity.
Definition: fs_compliancecommon.h:264
uint32 used_count
Represents how many times the fixup operation for current data has been triggered during converting p...
Definition: fs_compliancecommon.h:236
Definition: fs_basictypes.h:407
static void Release()
Release compliance engine.
CheckSeverity
Enumeration for check severity of a hit data.
Definition: fs_compliancecommon.h:260
WString name
Hit rule name.
Definition: fs_compliancecommon.h:346
Foxit namespace.
Definition: fs_taggedpdf.h:27
size_t GetSize() const
Get the size of elements in current array.
bool IsEmpty() const
Check whether current object is empty or not.
static ErrorCode Initialize(const wchar_t *compliance_resource_folder_path, const char *compliance_engine_unlockcode)
Initialize compliance engine.
static void SetLanguage(const char *language)
Set language for compliance engine.
ResultInformation & operator=(const ResultInformation &other)
Assign operator.
A fixup was not required.
Definition: fs_compliancecommon.h:166
Definition: fs_compliancecommon.h:153