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 {
46 class Library FS_FINAL : public Object {
47  public:
64  static ErrorCode Initialize(const char* sn, const char* key);
65 
77  static ErrorCode Reinitialize();
78 
88  static void Release();
89 
95  static String GetVersion();
96 
105  static void EnableThreadSafety(bool is_enable_thread_safety);
106 
107  private:
108  Library(const Library&);
109  Library& operator = (const Library&);
110 };
111 
115 class Progressive : public Base {
116  public:
122  typedef enum _State {
124  e_Error = 0,
129  } State;
130 
136  Progressive(const Progressive& other);
138  ~Progressive();
139 
147  Progressive& operator = (const Progressive& other);
148 
157  State Continue();
158 
165  int GetRateOfProgress();
166 
167  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
168  explicit Progressive(FS_HANDLE handle = NULL);
169 };
170 
178 class Range FS_FINAL : public Base{
179  public:
185  typedef enum _Filter {
187  e_All = 0,
189  e_Even = 1,
191  e_Odd = 2
192  } Filter;
193 
195  Range();
196 
202  explicit Range(int index);
203 
216  explicit Range(int start_index, int end_index, Filter filter = e_All);
217 
223  Range(const Range& other);
224 
226  ~Range();
227 
235  Range& operator = (const Range& other);
236 
244  bool operator == (const Range& other) const;
245 
253  bool operator != (const Range& other) const;
254 
262  bool IsEmpty() const;
263 
269  void AddSingle(int index);
270 
285  void AddSegment(int start_index, int end_index, Filter filter = e_All);
286 
292  int GetSegmentCount() const;
293 
302  int GetSegmentStart(int segment_index) const;
303 
312  int GetSegmentEnd(int segment_index) const;
313 
319  void RemoveAll();
320 
321  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
322  explicit Range(FS_HANDLE handle);
323 };
324 
325 } // namespace common
326 } // namespace foxit
327 
328 #endif // FS_COMMON_H_
329 
Definition: fs_common.h:178
static void Release()
Release all resource allocated by Foxit PDF Conversion SDK Library.
int GetRateOfProgress()
Get the rate of current progress.
CFX_Object Object
Object type.
Definition: fs_basictypes.h:79
Definition: fs_common.h:46
Only odd numbers in a range will be used (discards even numbers).
Definition: fs_common.h:191
Range & operator=(const Range &other)
Assign operator.
Filter
Enumeration for range filter.
Definition: fs_common.h:185
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:122
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:126
int GetSegmentEnd(int segment_index) const
Get the end index of a specified range segment.
Header file for basic types definitions.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:105
Only even numbers in a range will be used (discards odd numbers).
Definition: fs_common.h:189
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:115
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:76
Progressive & operator=(const Progressive &other)
Assign operator.
State Continue()
Continue the progressive process.
~Range()
Destructor.
Definition: fs_basictypes.h:161
void RemoveAll()
Remove all range segments.
static String GetVersion()
Get the version of current Foxit PDF Conversion SDK library.
bool operator !=(const Range &other) const
Not equal operator.
Foxit namespace.
Definition: fs_basictypes.h:58
void AddSingle(int index)
Add an index as a new range segment.
All the indexes within a range will be used.
Definition: fs_common.h:187
BYTE STRING CLASS.
Definition: fx_string.h:317
Progress state: progress is finished.
Definition: fs_common.h:128
Progress state: any error occurs.
Definition: fs_common.h:124
#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.)