Foxit PDF SDK
fs_compliancecommon.h
浏览该文件的文档.
1 
15 #ifndef FS_COMPLIANCEENGINE_H_
16 #define FS_COMPLIANCEENGINE_H_
17 
18 #include "common/fs_common.h"
19 
25 namespace foxit {
29 namespace addon {
33 namespace compliance {
34 class ResultInformation;
35 class ProgressCallback;
38 class Preflight;
39 
49 class ComplianceEngine FS_FINAL : public Object{
50  public:
56  typedef enum _ViewOrPrintCondition {
68 
69 
100  static ErrorCode Initialize(const wchar_t* compliance_resource_folder_path, const char* compliance_engine_unlockcode);
101 
109  static void Release();
110 
111 #if !defined(_MAC_JAVA_)
112 
133 
142  static void ReleaseThreadContext();
143 #endif
144 
156  static void SetTempFolderPath(const wchar_t* temp_folder_path);
157 
167  static void EnableHandleTransparency(bool enable_handle_transparency);
168 
185  static void SetLanguage(const char* language);
186 };
187 
193  public:
199  virtual void Release() = 0;
200 
209  virtual void UpdateCurrentStateData(int current_rate, const WString& current_state_string) = 0;
210 
211  protected:
212  ~ProgressCallback() {}
213 };
214 
216 class PreflightSettingData FS_FINAL : public Object{
217  public:
223  typedef enum _LibraryType {
230  } LibraryType;
231 
237  typedef enum _OperateType {
244  } OperateType;
245 
246 
249  : preflight_key(L"")
251  , src_pdf_path(L"")
252  , saved_pdf_path(L"")
253  , first_page_index(0)
254  , last_page_index(-1) {}
255 
273  this->preflight_key = preflight_key;
274  this->operate_type = operate_type;
275  this->src_pdf_path = src_pdf_path;
276  this->saved_pdf_path = saved_pdf_path;
277  this->first_page_index = first_page_index;
278  this->last_page_index = last_page_index;
279  }
280 
290  operate_type = data.operate_type;
291  src_pdf_path = data.src_pdf_path;
295  return (*this);
296  }
297 
300 
307 
310 
313 
316 
323 };
324 
326 class PreflightReportSettingData FS_FINAL : public Object{
327  public:
333  typedef enum _ReportFileFormatType {
343 
349  typedef enum _ProblemsHighlightMethod {
355 
356 
360  , to_generate_overview(true)
361  , to_highlight_problems(true)
363  , report_file_path(L"") {}
364 
381  ProblemsHighlightMethod problem_highlight_method, const wchar_t* report_file_path) {
382  this->report_file_format_type = report_file_format_type;
383  this->to_generate_overview = to_generate_overview;
384  this->to_highlight_problems = to_highlight_problems;
385  this->problems_highlight_method = problem_highlight_method;
386  this->report_file_path = report_file_path;
387  }
388 
402  return (*this);
403  }
404 
410 
413 
416 
423 
426 };
427 
431 class Preflight FS_FINAL : public Base {
432  public:
434  Preflight();
435 
436  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
437  explicit Preflight(FS_HANDLE handle);
438 
440  ~Preflight();
441 
447  Preflight(const Preflight& other);
448 
456  Preflight& operator = (const Preflight& other);
457 
465  bool operator == (const Preflight& other) const;
466 
474  bool operator != (const Preflight& other) const;
475 
483  bool IsEmpty() const;
484 
496 
504  StringArray GetItemKeysArray(const String& group_name);
505 
514  void Analyze(const PreflightSettingData& preflight_setting_data, ProgressCallback* progress_callback = NULL);
515 
524  void AnalyzeAndFixup(const PreflightSettingData& preflight_setting_data, ProgressCallback* progress_callback = NULL);
525 
534  bool GenerateReport(const PreflightReportSettingData& preflight_report_setting_data, ProgressCallback* progress_callback = NULL);
535 
543  bool CanFixup(const String& item_key);
544 };
545 
549 class FixupData : public Object {
550  public:
556  typedef enum _FixupState {
563  } FixupState;
564 
565 
568  : used_count(0)
570 
576  FixupData(const FixupData& other)
577  : used_count(other.used_count)
578  , state(other.state)
579  , name(other.name)
580  , comment(other.comment)
581  , reasons(other.reasons) {}
582 
590  FixupData& operator = (const FixupData& other) {
591  used_count = other.used_count;
592  state = other.state;
593  name = other.name;
594  comment = other.comment;
595  reasons = other.reasons;
596  return *this;
597  }
598 
606  bool operator == (const FixupData& other) const {
607  bool is_equal = (used_count == other.used_count && state == other.state &&
608  name == other.name && comment == other.comment);
609  if (is_equal) {
610  for (int i=0; i<(int)reasons.GetSize(); i++) {
611  if (reasons[i] != other.reasons[i]) {
612  is_equal = false;
613  break;
614  }
615  }
616  }
617  return is_equal;
618  }
619 
627  bool operator != (const FixupData& other) const {
628  return !((*this) == other);
629  }
630 
644 };
645 
649 class HitData : public Object {
650  public:
656  typedef enum _CheckSeverity {
663  } CheckSeverity;
664 
665 
668  : triggered_count(0)
670  , page_index(-1){}
671 
677  HitData(const HitData& other)
679  , severity(other.severity)
680  , name(other.name)
681  , comment(other.comment)
683  , page_index(other.page_index) {}
684 
692  HitData& operator = (const HitData& other) {
694  severity = other.severity;
695  name = other.name;
696  comment = other.comment;
698  page_index = other.page_index;
699  return *this;
700  }
701 
709  bool operator == (const HitData& other) const {
710  bool is_equal = (triggered_count == other.triggered_count && severity == other.severity &&
711  name == other.name && comment == other.comment && page_index == other.page_index);
712  if (is_equal) {
713  for (int i=0; i<(int)trigger_values.GetSize(); i++) {
714  if (trigger_values[i] != other.trigger_values[i]) {
715  is_equal = false;
716  break;
717  }
718  }
719  }
720  return is_equal;
721  }
722 
730  bool operator != (const HitData& other) const {
731  return !((*this) == other);
732  }
733 
749 };
750 
755 class ResultInformation FS_FINAL : public Base {
756  public:
759  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
760  explicit ResultInformation(FS_HANDLE handle);
768  ResultInformation(const ResultInformation& other);
769 
785  bool operator == (const ResultInformation& other) const;
786 
794  bool operator != (const ResultInformation& other) const;
795 
803  bool IsEmpty() const;
804 
810  int GetFixupDataCount() const;
819  FixupData GetFixupData(int index) const;
820 
826  int GetHitDataCount() const;
827 
836  HitData GetHitData(int index) const;
837 };
838 } // namespace compliance/**
839 } // namespace addon
840 } // namespace foxit
841 
842 #endif // FS_COMPLIANCEENGINE_H_
virtual void Release()=0
用于释放当前回调对象本身的回调函数。
LibraryType
预检库类型的枚举。
Definition: fs_compliancecommon.h:223
PreflightReportSettingData()
构造函数。
Definition: fs_compliancecommon.h:358
FixupData & operator=(const FixupData &other)
赋值操作符。
Definition: fs_compliancecommon.h:590
错误严重性。
Definition: fs_compliancecommon.h:662
报告文件格式类型:XML。
Definition: fs_compliancecommon.h:337
bool operator !=(const HitData &other) const
不相等操作符。
Definition: fs_compliancecommon.h:730
int page_index
页面索引,从0开始。-1表示当前命中数据在文档级别被命中。
Definition: fs_compliancecommon.h:748
bool to_generate_overview
是否生成概述。true表示生成概述,false表示不生成。
Definition: fs_compliancecommon.h:412
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:221
预检库类型:Foxit。
Definition: fs_compliancecommon.h:225
HitData GetHitData(int index) const
获取命中数据。
int first_page_index
要分析或修复的第一页的索引,从0开始。默认值:0。
Definition: fs_compliancecommon.h:315
bool CanFixup(const String &item_key)
检查项目密钥是否可以修复。
Definition: fs_basictypes.h:228
Definition: fs_compliancecommon.h:755
FixupData GetFixupData(int index) const
获取修复数据。
uint32 triggered_count
表示在文档验证或转换过程中当前数据的命中操作被触发的次数。
Definition: fs_compliancecommon.h:735
ReportFileFormatType
预检报告文件格式类型的枚举。
Definition: fs_compliancecommon.h:333
FixupData()
构造函数。
Definition: fs_compliancecommon.h:567
修复成功。
Definition: fs_compliancecommon.h:558
StringArray GetItemKeysArray(const String &group_name)
使用特定组名获取项目密钥数组。
WStringArray trigger_values
触发值数组。触发值的数量不超过triggered_count。
Definition: fs_compliancecommon.h:746
bool GenerateReport(const PreflightReportSettingData &preflight_report_setting_data, ProgressCallback *progress_callback=0)
分析或修复后生成报告。
CheckSeverity severity
当前命中数据的检查严重性。请参考从HitData::e_CheckSeverityInfo开始的值, 这应该是这些值之一。
Definition: fs_compliancecommon.h:740
宽字符串类
Definition: fx_string.h:1457
HitData & operator=(const HitData &other)
赋值操作符。
Definition: fs_compliancecommon.h:692
Definition: fs_compliancecommon.h:649
int GetHitDataCount() const
获取命中数据的数量。
查看或打印条件:Japan Color 2001 Coated。
Definition: fs_compliancecommon.h:64
Definition: fs_compliancecommon.h:216
通过透明遮罩高亮显示问题。
Definition: fs_compliancecommon.h:351
PreflightSettingData(const wchar_t *preflight_key, OperateType operate_type, const wchar_t *src_pdf_path, const wchar_t *saved_pdf_path, int first_page_index, int last_page_index)
带参数的构造函数。
Definition: fs_compliancecommon.h:271
ViewOrPrintCondition
查看或打印条件的枚举。
Definition: fs_compliancecommon.h:56
HitData()
构造函数。
Definition: fs_compliancecommon.h:667
Definition: fs_compliancecommon.h:326
PreflightReportSettingData & operator=(const PreflightReportSettingData &data)
赋值操作符。
Definition: fs_compliancecommon.h:396
HitData(const HitData &other)
带另一个命中数据对象的构造函数。
Definition: fs_compliancecommon.h:677
FixupState state
修复状态。请参考从FixupData::e_FixupStateSuccess开始的值, 这应该是这些值之一。
Definition: fs_compliancecommon.h:637
WStringArray reasons
修复原因。这可能是空数组。原因的数量不会超过used_times。
Definition: fs_compliancecommon.h:643
virtual void UpdateCurrentStateData(int current_rate, const WString &current_state_string)=0
用于向用户更新当前进度状态数据的回调函数,以便用户可以更新其进度条。
int GetFixupDataCount() const
获取修复数据的数量。
预检库类型:印前、颜色和透明度。
Definition: fs_compliancecommon.h:229
bool operator==(const ResultInformation &other) const
相等操作符。
bool IsEmpty() const
检查当前对象是否为空。
WString comment
命中规则注释,用于解释规则的更多详细信息。
Definition: fs_compliancecommon.h:744
FixupData(const FixupData &other)
带另一个修复数据对象的构造函数。
Definition: fs_compliancecommon.h:576
bool operator==(const FixupData &other) const
相等操作符。
Definition: fs_compliancecommon.h:606
static void EnableHandleTransparency(bool enable_handle_transparency)
设置标志以决定是否启用透明度处理。
FixupState
修复数据状态的枚举。
Definition: fs_compliancecommon.h:556
Definition: fs_compliancecommon.h:192
WString name
修复规则名称。
Definition: fs_compliancecommon.h:639
ErrorCode
错误代码的枚举。
Definition: fs_basictypes.h:237
int last_page_index
要分析或修复的最后一页的索引。如果这是-1,那意味着 源PDF文件的所有页面都将被分析,并且 参数first_page_index将被忽略。默认值:-1。
Definition: fs_compliancecommon.h:322
bool operator==(const Preflight &other) const
相等操作符。
bool operator==(const HitData &other) const
相等操作符。
Definition: fs_compliancecommon.h:709
操作类型:单项修复。
Definition: fs_compliancecommon.h:243
查看或打印条件:PSO Coated v3 (ECI)。
Definition: fs_compliancecommon.h:66
static void SetTempFolderPath(const wchar_t *temp_folder_path)
为合规性引擎设置临时文件夹。
查看或打印条件:ISO Coated v2 (ECI)。
Definition: fs_compliancecommon.h:62
操作类型:单项检查。
Definition: fs_compliancecommon.h:241
Definition: fs_compliancecommon.h:49
修复失败。
Definition: fs_compliancecommon.h:560
查看或打印条件:自动。
Definition: fs_compliancecommon.h:58
bool operator !=(const ResultInformation &other) const
不相等操作符。
报告文件格式类型:HTML。
Definition: fs_compliancecommon.h:341
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:196
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:214
通用定义和类的头文件。
WString comment
修复规则注释,用于解释规则的更多详细信息。
Definition: fs_compliancecommon.h:641
bool operator !=(const FixupData &other) const
不相等操作符。
Definition: fs_compliancecommon.h:627
bool operator !=(const Preflight &other) const
不相等操作符。
信息严重性。
Definition: fs_compliancecommon.h:658
警告严重性。
Definition: fs_compliancecommon.h:660
PreflightSettingData & operator=(const PreflightSettingData &data)
赋值操作符。
Definition: fs_compliancecommon.h:288
uint32 used_count
表示转换过程中当前数据的修复操作调用次数。
Definition: fs_compliancecommon.h:632
Definition: fs_basictypes.h:449
void Analyze(const PreflightSettingData &preflight_setting_data, ProgressCallback *progress_callback=0)
分析PDF文件。
Definition: fs_basictypes.h:230
OperateType
预检操作类型的枚举。
Definition: fs_compliancecommon.h:237
static void Release()
释放合规性引擎。
CheckSeverity
命中数据检查严重性的枚举。
Definition: fs_compliancecommon.h:656
WString name
命中规则名称。
Definition: fs_compliancecommon.h:742
WString src_pdf_path
要分析和修复的源PDF文件的完整路径。
Definition: fs_compliancecommon.h:309
Preflight & operator=(const Preflight &other)
赋值操作符。
Foxit命名空间。
Definition: fs_taggedpdf.h:27
void AnalyzeAndFixup(const PreflightSettingData &preflight_setting_data, ProgressCallback *progress_callback=0)
分析并修复PDF文件。
StringArray GetGroupNamesArray(const PreflightSettingData::LibraryType &library_type, const PreflightSettingData::OperateType &operate_type)
获取与库类型和操作类型对应的所有组名数组。
ProblemsHighlightMethod problems_highlight_method
高亮显示问题的方法。仅当to_highlight_problems为true且report_file_format_type 为PreflightReportSettingData::e_ReportF...
Definition: fs_compliancecommon.h:422
字节字符串类
Definition: fx_string.h:317
static void ReleaseThreadContext()
释放线程的合规性上下文。
size_t GetSize() const
获取当前数组中元素的大小。
bool IsEmpty() const
检查当前对象是否为空。
报告文件格式类型:TXT 和 TEXT。
Definition: fs_compliancecommon.h:339
预检库类型:标准。
Definition: fs_compliancecommon.h:227
报告文件格式类型:PDF。
Definition: fs_compliancecommon.h:335
static ErrorCode Initialize(const wchar_t *compliance_resource_folder_path, const char *compliance_engine_unlockcode)
初始化合规性引擎。
操作类型:配置文件。
Definition: fs_compliancecommon.h:239
static void SetLanguage(const char *language)
为合规性引擎设置语言。
ResultInformation & operator=(const ResultInformation &other)
赋值操作符。
#define NULL
空指针值。
Definition: fx_system.h:792
PreflightReportSettingData(ReportFileFormatType report_file_format_type, bool to_generate_overview, bool to_highlight_problems, ProblemsHighlightMethod problem_highlight_method, const wchar_t *report_file_path)
带参数的构造函数。
Definition: fs_compliancecommon.h:380
OperateType operate_type
预检操作类型。 请参考从PreflightSettingData::e_OperateTypeProfiles开始的值, 这应该是这些值之一。
Definition: fs_compliancecommon.h:306
ReportFileFormatType report_file_format_type
报告文件格式类型。 请参考从PreflightReportSettingData::e_ReportFileFormatTypePdf开始的值, 这应该是这些值之一。
Definition: fs_compliancecommon.h:409
修复不需要。
Definition: fs_compliancecommon.h:562
PreflightSettingData()
构造函数。
Definition: fs_compliancecommon.h:248
通过图层高亮显示问题。
Definition: fs_compliancecommon.h:353
WString report_file_path
报告文件的完整路径。这不应该是空字符串。
Definition: fs_compliancecommon.h:425
Definition: fs_compliancecommon.h:549
ProblemsHighlightMethod
预检问题高亮方法的枚举。
Definition: fs_compliancecommon.h:349
static ErrorCode InitializeThreadContext()
为新线程初始化合规性上下文。
Definition: fs_compliancecommon.h:431
查看或打印条件:Coated GRACoL 2006。
Definition: fs_compliancecommon.h:60
WString saved_pdf_path
保存由预检分析和修复过程生成的PDF文件的完整路径。
Definition: fs_compliancecommon.h:312
bool to_highlight_problems
是否高亮显示问题。true表示高亮显示问题,false表示不高亮。
Definition: fs_compliancecommon.h:415
WString preflight_key
预检密钥。通过Preflight::GetItemKeysArray检索可用密钥。
Definition: fs_compliancecommon.h:299