Foxit PDF Conversion SDK
fs_common.h
Go to the documentation of this file.
1 
15 #ifndef FS_COMMON_H_
16 #define FS_COMMON_H_
17 
18 #include "fs_basictypes.h"
19 
25 namespace foxit {
29 namespace common {
35  typedef enum _UserPermissions {
41  e_PermPrint = 0x0004,
48  e_PermModify = 0x0008,
54  e_PermExtract = 0x0010,
60  e_PermAnnotForm = 0x0020,
66  e_PermFillForm = 0x0100,
79  e_PermAssemble = 0x0400,
85  e_PermPrintHigh = 0x0800
87 
88 
95  public:
105  virtual bool CheckUserPermissions(uint32 user_permissions) = 0;
106 };
107 
124 class Library FS_FINAL : public Object {
125  public:
142  static ErrorCode Initialize(const char* sn, const char* key);
143 
155  static ErrorCode Reinitialize();
156 
166  static void Release();
167 
173  static String GetVersion();
174 
183  static void EnableThreadSafety(bool is_enable_thread_safety);
184 
198  static bool SetConvertCheckCallback(ConvertCheckCallback* convert_check_callback);
199 
200  private:
201  Library(const Library&);
202  Library& operator = (const Library&);
203 };
204 
208 class Progressive : public Base {
209  public:
215  typedef enum _State {
217  e_Error = 0,
222  } State;
223 
229  Progressive(const Progressive& other);
231  ~Progressive();
232 
240  Progressive& operator = (const Progressive& other);
241 
250  State Continue();
251 
258  int GetRateOfProgress();
259 
260  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
261  explicit Progressive(FS_HANDLE handle = NULL);
262 };
263 
271 class Range FS_FINAL : public Base{
272  public:
278  typedef enum _Filter {
280  e_All = 0,
282  e_Even = 1,
284  e_Odd = 2
285  } Filter;
286 
288  Range();
289 
295  explicit Range(int index);
296 
309  explicit Range(int start_index, int end_index, Filter filter = e_All);
310 
316  Range(const Range& other);
317 
319  ~Range();
320 
328  Range& operator = (const Range& other);
329 
337  bool operator == (const Range& other) const;
338 
346  bool operator != (const Range& other) const;
347 
355  bool IsEmpty() const;
356 
362  void AddSingle(int index);
363 
378  void AddSegment(int start_index, int end_index, Filter filter = e_All);
379 
385  int GetSegmentCount() const;
386 
395  int GetSegmentStart(int segment_index) const;
396 
405  int GetSegmentEnd(int segment_index) const;
406 
412  void RemoveAll();
413 
414  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
415  explicit Range(FS_HANDLE handle);
416 };
417 
418 } // namespace common
419 } // namespace foxit
420 
421 #endif // FS_COMMON_H_
422 
Print PDF document with higher qualities. (Bit 12 in permission value)
Definition: fs_common.h:85
Definition: fs_common.h:271
static void Release()
Release all resource allocated by Foxit PDF Conversion SDK Library.
int GetRateOfProgress()
Get the rate of current progress.
virtual bool CheckUserPermissions(uint32 user_permissions)=0
Check user permissions to decide whether to proceed with the PDF to Office conversion.
CFX_Object Object
Object type.
Definition: fs_basictypes.h:145
Definition: fs_common.h:124
Only odd numbers in a range will be used (discards even numbers).
Definition: fs_common.h:284
Range & operator=(const Range &other)
Assign operator.
Filter
Enumeration for range filter.
Definition: fs_common.h:278
int GetSegmentCount() const
Get the count of range segments.
bool operator==(const Range &other) const
Equal operator.
static void EnableThreadSafety(bool is_enable_thread_safety)
Enable thread safety.
State
Enumeration for progress state.
Definition: fs_common.h:215
static ErrorCode Reinitialize()
Re-initialize Foxit PDF Conversion SDK Library.
static ErrorCode Initialize(const char *sn, const char *key)
Initialize Foxit PDF Conversion SDK Library, with valid license information.
Progressive(const Progressive &other)
Constructor, with another progressive object.
Progress state: progress needs to be continued.
Definition: fs_common.h:219
int GetSegmentEnd(int segment_index) const
Get the end index of a specified range segment.
UserPermissions
Enumeration for user access permissions in a PDF document.
Definition: fs_common.h:35
Header file for basic types definitions.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:174
Only even numbers in a range will be used (discards odd numbers).
Definition: fs_common.h:282
static bool SetConvertCheckCallback(ConvertCheckCallback *convert_check_callback)
Set the callback object to check the PDF to Office conversion conditions.
int GetSegmentStart(int segment_index) const
Get the start index of a specified range segment.
bool IsEmpty() const
Check whether current object is empty or not.
Range()
Constructor.
Definition: fs_common.h:208
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:132
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:142
Assemble PDF document. (Bit 11 in permission value)
Definition: fs_common.h:79
Definition: fs_common.h:94
Progressive & operator=(const Progressive &other)
Assign operator.
State Continue()
Continue the progressive process.
~Range()
Destructor.
Definition: fs_basictypes.h:230
void RemoveAll()
Remove all range segments.
static String GetVersion()
Get the version of current Foxit PDF Conversion SDK library.
Modify PDF contents. (Bit 4 in permission value)
Definition: fs_common.h:48
bool operator !=(const Range &other) const
Not equal operator.
Disabilities support. (Bit 10 in permission value)
Definition: fs_common.h:72
Foxit namespace.
Definition: fs_basictypes.h:124
void AddSingle(int index)
Add an index as a new range segment.
Print PDF document with normal mode. (Bit 3 in permission value)
Definition: fs_common.h:41
All the indexes within a range will be used.
Definition: fs_common.h:280
BYTE STRING CLASS.
Definition: fx_string.h:317
Progress state: progress is finished.
Definition: fs_common.h:221
Extract PDF contents. (Bit 5 in permission value)
Definition: fs_common.h:54
Operate text annotations and fill in interactive form fields. (Bit 6 in permission value)
Definition: fs_common.h:60
Progress state: any error occurs.
Definition: fs_common.h:217
Fill PDF form. (Bit 9 in permission value)
Definition: fs_common.h:66
#define NULL
The null-pointer value.
Definition: fx_system.h:780
void AddSegment(int start_index, int end_index, Filter filter=e_All)
Add a new range segment. (Reverse ordering is legal.)