Foxit PDF SDK
fs_connectedpdf.h
Go to the documentation of this file.
1 
15 #ifndef FS_CONNECTEDPDF_H_
16 #define FS_CONNECTEDPDF_H_
17 
18 #include "common/fs_common.h"
19 #include "pdf/fs_pdfdoc.h"
20 
26 namespace foxit {
30 namespace addon {
39 class ConnectedPDF FS_FINAL : public Base {
40  public:
46  typedef enum _EncryptType {
51  } EncryptType;
52 
53 
54 #if (_FX_OS_ != _FX_IOS_ && !defined(_SWIG_IOS_) && !defined(_OC_) && !defined(_SWIG_MACOC_))
55 
62  class ClientInfo : public Object {
63  public:
82  };
83 #endif // (_FX_OS_ != _FX_IOS_ && !defined(_SWIG_IOS_) && !defined(_OC_) && !defined(_SWIG_MACOC_))
84 
100  static String GetDocURI(const char* file_path);
101 
120  static String GetClientIDFromServer(const char* endpoint, ClientInfo* client_info);
121 
139  static String GetUserTokenFromServer(const char* endpoint, const String& user_email, const String& password);
140 
162  ConnectedPDF(const char* clientid, const char* user_token, const char* content_key, addon::ConnectedPDF::EncryptType type, const char* file_path);
163 
185  ConnectedPDF(const char* clientid, const char* user_token, const char* content_key,addon::ConnectedPDF::EncryptType type, const wchar_t* file_path);
186 
209  ConnectedPDF(const char* clientid, const char* user_token, const char* content_key,addon::ConnectedPDF::EncryptType type, foxit::common::file::ReaderCallback* file_read);
210 
230  ConnectedPDF(const foxit::String& clientid, const foxit::String& user_token, const foxit::String& content_key, addon::ConnectedPDF::EncryptType type,const foxit::pdf::PDFDoc& document);
231 
237  ConnectedPDF(const ConnectedPDF& connected_pdf);
239  ~ConnectedPDF();
240 
248  ConnectedPDF& operator = (const ConnectedPDF& other);
256  bool operator == (const ConnectedPDF& other) const ;
265  bool operator != (const ConnectedPDF& other) const ;
266 
274  bool IsEmpty() const;
275 
282  bool IsCPDF();
283 
290  bool IsCDRM();
291 
297  bool IsOwner();
298 
309 
317  void SetUserToken(const String& user_token);
318 
325 
332 
347  foxit::ErrorCode ConvertToCPDF(const char* endpoint, const char* file_name);
348 
363  foxit::ErrorCode ConvertToCPDF(const char* endpoint, const wchar_t* file_name);
364 
381  foxit::ErrorCode ConvertToCDRM(const char* endpoint, const char* wrapper_path, const char* file_name);
382 
399  foxit::ErrorCode ConvertToCDRM(const char* endpoint, const wchar_t* wrapper_path, const wchar_t* file_name);
400 
417  foxit::ErrorCode ConvertToCDRM(const char* endpoint, foxit::common::file::ReaderCallback* wrapper_file_read, const char* file_name);
418 
435  foxit::ErrorCode ConvertToCDRM(const char* endpoint, foxit::common::file::ReaderCallback* wrapper_file_read, const wchar_t* file_name);
436 
449 
508  foxit::ErrorCode SetACL(const String& acl);
509 
584  String GetACL();
591  String GetDocURI();
598  String GetVersionID();
635  bool SaveAs(const char* file_path);
647 
648  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
649  explicit ConnectedPDF(FS_HANDLE handle = NULL);
650 };
651 
652 } // namespace addon
653 } // namespace foxit
654 #endif // FS_PDFDOC_H_
655 
~ConnectedPDF()
Destructor function.
SM4 electronic codebook mode.
Definition: fs_connectedpdf.h:50
String device_model
The device model.
Definition: fs_connectedpdf.h:69
String GetEndpoint()
Get the ConnectedPDF document endpoint from the loaded document.
String product_name
The product name of a ConnectedPDF client.
Definition: fs_connectedpdf.h:75
file writing interface.
Definition: fx_stream.h:449
String mac_address
The MAC address.
Definition: fs_connectedpdf.h:71
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
bool IsEmpty() const
Check whether current object is empty or not.
bool SaveAs(const char *file_path)
Save the current ConnectedPDF document as another PDF file.
String GetVersionID()
Get the ConnectedPDF document version ID from the loaded document.
Header file for PDF document related definitions and classes.
ConnectedPDF & operator=(const ConnectedPDF &other)
Assign operator.
bool operator!=(const ConnectedPDF &other) const
Not equal operator.
String RefreshVersionID()
Refresh the ConnectedPDF document version ID from the loaded document.
file reading interface.
Definition: fx_stream.h:555
ConnectedPDF(const char *clientid, const char *user_token, const char *content_key, addon::ConnectedPDF::EncryptType type, const char *file_path)
Constructor, with parameters and from an existing PDF file path.
foxit::ErrorCode ConvertToCPDF(const char *endpoint, const char *file_name)
Convert the loaded document to a ConnectedPDF document.
Definition: fs_pdfdoc.h:347
foxit::ErrorCode ConvertToCDRM(const char *endpoint, const char *wrapper_path, const char *file_name)
Convert the loaded document to a ConnectedPDF DRM document.
String GetUserToken()
Get the user token.
String GetContentKey()
Get the content key if the loaded document is a ConnectedPDF DRM document.
String device_name
The device name.
Definition: fs_connectedpdf.h:67
String product_vendor
The vendor of the product.
Definition: fs_connectedpdf.h:77
bool IsCPDF()
Check whether the loaded document is a ConnectedPDF document or not.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:236
EncryptType
Enumeration for encryption mode.
Definition: fs_connectedpdf.h:46
Structure that represents the client information which is used to apply for a client ID from Connecte...
Definition: fs_connectedpdf.h:62
foxit::ErrorCode SetACL(const String &acl)
Set ACL of a ConnectedPDF DRM document.
static String GetUserTokenFromServer(const char *endpoint, const String &user_email, const String &password)
Get the user token from ConnectedPDF server.
String device_id
The device ID that represents a device.
Definition: fs_connectedpdf.h:65
String GetOwnerEmail()
Get the ConnectedPDF document owner email.
String product_language
The language of the product.
Definition: fs_connectedpdf.h:81
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
Header file for common definitions and classes.
String GetDocURI()
Get the ConnectedPDF document URI from the loaded document.
Definition: fs_basictypes.h:375
String product_version
The version of the product.
Definition: fs_connectedpdf.h:79
bool IsCDRM()
Check whether the loaded document is a ConnectedPDF DRM document or not.
static String GetClientIDFromServer(const char *endpoint, ClientInfo *client_info)
Apply for a client id from ConnectedPDF server using the input client info.
Foxit namespace.
Definition: fs_compare.h:27
String GetACL()
Get ACL of a ConnectedPDF DRM document.
BYTE STRING CLASS.
Definition: fx_string.h:317
Definition: fs_connectedpdf.h:39
#define NULL
The null-pointer value.
Definition: fx_system.h:771
String os
The operation system.
Definition: fs_connectedpdf.h:73
bool IsOwner()
Check whether current user is the owner.
foxit::pdf::PDFDoc GetDocument()
Get the associated PDF document object.
bool operator==(const ConnectedPDF &other) const
Equal operator.
foxit::ErrorCode RemoveCDRM()
Remove the ConnectedPDF DRM protection of a ConnectedPDF document.
AES encryption algorithm.
Definition: fs_connectedpdf.h:48
String GetOwnerName()
Get the ConnectedPDF document owner name.
void SetUserToken(const String &user_token)
Set the user token to switch it.