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,
72 e_PermExtractAccess = 0x0200,
79 e_PermAssemble = 0x0400,
85 e_PermPrintHigh = 0x0800
86 } UserPermissions;
87
88
94 class ConvertCheckCallback {
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,
219 e_ToBeContinued = 1,
221 e_Finished = 2
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
foxit::common::e_PermPrintHigh
Print PDF document with higher qualities. (Bit 12 in permission value)
Definition: fs_common.h:85
foxit::common::Range
Definition: fs_common.h:271
foxit::common::Library::Release
static void Release()
Release all resource allocated by Foxit PDF Conversion SDK Library.
foxit::common::Progressive::GetRateOfProgress
int GetRateOfProgress()
Get the rate of current progress.
foxit::common::ConvertCheckCallback::CheckUserPermissions
virtual bool CheckUserPermissions(uint32 user_permissions)=0
Check user permissions to decide whether to proceed with the PDF to Office conversion.
foxit::Object
CFX_Object Object
Object type.
Definition: fs_basictypes.h:145
foxit::common::Library
Definition: fs_common.h:124
foxit::common::Range::e_Odd
Only odd numbers in a range will be used (discards even numbers).
Definition: fs_common.h:284
foxit::common::Range::operator=
Range & operator=(const Range &other)
Assign operator.
foxit::common::Range::Filter
Filter
Enumeration for range filter.
Definition: fs_common.h:278
foxit::common::Range::GetSegmentCount
int GetSegmentCount() const
Get the count of range segments.
foxit::common::Range::operator==
bool operator==(const Range &other) const
Equal operator.
foxit::common::Library::EnableThreadSafety
static void EnableThreadSafety(bool is_enable_thread_safety)
Enable thread safety.
foxit::common::Progressive::State
State
Enumeration for progress state.
Definition: fs_common.h:215
foxit::common::Library::Reinitialize
static ErrorCode Reinitialize()
Re-initialize Foxit PDF Conversion SDK Library.
foxit::common::Library::Initialize
static ErrorCode Initialize(const char *sn, const char *key)
Initialize Foxit PDF Conversion SDK Library, with valid license information.
foxit::common::Progressive::Progressive
Progressive(const Progressive &other)
Constructor, with another progressive object.
foxit::common::Progressive::e_ToBeContinued
Progress state: progress needs to be continued.
Definition: fs_common.h:219
foxit::common::Range::GetSegmentEnd
int GetSegmentEnd(int segment_index) const
Get the end index of a specified range segment.
foxit::common::Progressive::~Progressive
~Progressive()
Destructor.
foxit::common::UserPermissions
UserPermissions
Enumeration for user access permissions in a PDF document.
Definition: fs_common.h:35
fs_basictypes.h
Header file for basic types definitions.
foxit::ErrorCode
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:174
foxit::common::Range::e_Even
Only even numbers in a range will be used (discards odd numbers).
Definition: fs_common.h:282
foxit::common::Library::SetConvertCheckCallback
static bool SetConvertCheckCallback(ConvertCheckCallback *convert_check_callback)
Set the callback object to check the PDF to Office conversion conditions.
foxit::common::Range::GetSegmentStart
int GetSegmentStart(int segment_index) const
Get the start index of a specified range segment.
foxit::common::Range::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::common::Range::Range
Range()
Constructor.
foxit::common::Progressive
Definition: fs_common.h:208
foxit::uint32
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:132
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:142
foxit::common::e_PermAssemble
Assemble PDF document. (Bit 11 in permission value)
Definition: fs_common.h:79
foxit::common::ConvertCheckCallback
Definition: fs_common.h:94
foxit::common::Progressive::operator=
Progressive & operator=(const Progressive &other)
Assign operator.
foxit::common::Progressive::Continue
State Continue()
Continue the progressive process.
foxit::common::Range::~Range
~Range()
Destructor.
foxit::Base
Definition: fs_basictypes.h:232
foxit::common::Range::RemoveAll
void RemoveAll()
Remove all range segments.
foxit::common::Library::GetVersion
static String GetVersion()
Get the version of current Foxit PDF Conversion SDK library.
foxit::common::e_PermModify
Modify PDF contents. (Bit 4 in permission value)
Definition: fs_common.h:48
foxit::common::Range::operator !=
bool operator !=(const Range &other) const
Not equal operator.
foxit::common::e_PermExtractAccess
Disabilities support. (Bit 10 in permission value)
Definition: fs_common.h:72
foxit
Foxit namespace.
Definition: fs_basictypes.h:124
foxit::common::Range::AddSingle
void AddSingle(int index)
Add an index as a new range segment.
foxit::common::e_PermPrint
Print PDF document with normal mode. (Bit 3 in permission value)
Definition: fs_common.h:41
foxit::common::Range::e_All
All the indexes within a range will be used.
Definition: fs_common.h:280
CFX_ByteString
BYTE STRING CLASS.
Definition: fx_string.h:317
foxit::common::Progressive::e_Finished
Progress state: progress is finished.
Definition: fs_common.h:221
foxit::common::e_PermExtract
Extract PDF contents. (Bit 5 in permission value)
Definition: fs_common.h:54
foxit::common::e_PermAnnotForm
Operate text annotations and fill in interactive form fields. (Bit 6 in permission value)
Definition: fs_common.h:60
foxit::common::Progressive::e_Error
Progress state: any error occurs.
Definition: fs_common.h:217
foxit::common::e_PermFillForm
Fill PDF form. (Bit 9 in permission value)
Definition: fs_common.h:66
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:785
foxit::common::Range::AddSegment
void AddSegment(int start_index, int end_index, Filter filter=e_All)
Add a new range segment. (Reverse ordering is legal.)