My Project
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:
41 #if (_FX_OS_ != _FX_IOS_ && !defined(_SWIG_IOS_) && !defined(_OC_) && !defined(_SWIG_MACOC_))
42 
49  class ClientInfo : public Object {
50  public:
69  };
70 #endif // (_FX_OS_ != _FX_IOS_ && !defined(_SWIG_IOS_) && !defined(_OC_) && !defined(_SWIG_MACOC_))
71 
87  static String GetDocURI(const char* file_path);
88 
107  static String GetClientIDFromServer(const char* endpoint, ClientInfo* client_info);
108 
126  static String GetUserTokenFromServer(const char* endpoint, const String& user_email, const String& password);
127 
147  ConnectedPDF(const char* clientid, const char* user_token, const char* content_key, const char* file_path);
148 
168  ConnectedPDF(const char* clientid, const char* user_token, const char* content_key, const wchar_t* file_path);
169 
190  ConnectedPDF(const char* clientid, const char* user_token, const char* content_key, foxit::common::file::ReaderCallback* file_read);
191 
209  ConnectedPDF(const foxit::String& clientid, const foxit::String& user_token, const foxit::String& content_key, const foxit::pdf::PDFDoc& document);
210 
216  ConnectedPDF(const ConnectedPDF& connected_pdf);
218  ~ConnectedPDF();
219 
227  ConnectedPDF& operator = (const ConnectedPDF& other);
235  bool operator == (const ConnectedPDF& other) const ;
244  bool operator != (const ConnectedPDF& other) const ;
245 
253  bool IsEmpty() const;
254 
261  bool IsCPDF();
262 
269  bool IsCDRM();
270 
276  bool IsOwner();
277 
288 
296  void SetUserToken(const String& user_token);
297 
304 
311 
326  foxit::ErrorCode ConvertToCPDF(const char* endpoint, const char* file_name);
327 
342  foxit::ErrorCode ConvertToCPDF(const char* endpoint, const wchar_t* file_name);
343 
360  foxit::ErrorCode ConvertToCDRM(const char* endpoint, const char* wrapper_path, const char* file_name);
361 
378  foxit::ErrorCode ConvertToCDRM(const char* endpoint, const wchar_t* wrapper_path, const wchar_t* file_name);
379 
396  foxit::ErrorCode ConvertToCDRM(const char* endpoint, foxit::common::file::ReaderCallback* wrapper_file_read, const char* file_name);
397 
414  foxit::ErrorCode ConvertToCDRM(const char* endpoint, foxit::common::file::ReaderCallback* wrapper_file_read, const wchar_t* file_name);
415 
486  foxit::ErrorCode SetACL(const String& acl);
487 
562  String GetACL();
569  String GetDocURI();
576  String GetVersionID();
613  bool SaveAs(const char* file_path);
625 
626  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
627  explicit ConnectedPDF(FS_HANDLE handle = NULL);
628 };
629 
630 } // namespace addon
631 } // namespace foxit
632 #endif // FS_PDFDOC_H_
633 
String os
The operation system.
Definition: fs_connectedpdf.h:60
String GetEndpoint()
Get the ConnectedPDF document endpoint from the loaded document.
file writing interface.
Definition: fx_stream.h:449
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
foxit::pdf::PDFDoc GetDocument()
Get the associated PDF document object.
String GetContentKey()
Get the content key if the loaded document is a ConnectedPDF DRM document.
bool operator !=(const ConnectedPDF &other) const
Not equal operator.
bool SaveAs(const char *file_path)
Save the current ConnectedPDF document as another PDF file.
foxit::ErrorCode RemoveCDRM()
Remove the ConnectedPDF DRM protection of a ConnectedPDF document.
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
String GetOwnerName()
Get the ConnectedPDF document owner name.
String GetACL()
Get ACL of a ConnectedPDF DRM document.
String GetUserToken()
Get the user token.
foxit::ErrorCode ConvertToCDRM(const char *endpoint, const char *wrapper_path, const char *file_name)
Convert the loaded document to a ConnectedPDF DRM document.
Header file for common definitions and classes.
String device_model
The device model.
Definition: fs_connectedpdf.h:56
String product_version
The version of the product.
Definition: fs_connectedpdf.h:66
String product_language
The language of the product.
Definition: fs_connectedpdf.h:68
file reading interface.
Definition: fx_stream.h:555
String mac_address
The MAC address.
Definition: fs_connectedpdf.h:58
foxit::ErrorCode ConvertToCPDF(const char *endpoint, const char *file_name)
Convert the loaded document to a ConnectedPDF document.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:236
foxit::ErrorCode SetACL(const String &acl)
Set ACL of a ConnectedPDF DRM document.
String RefreshVersionID()
Refresh the ConnectedPDF document version ID from the loaded document.
~ConnectedPDF()
Destructor function.
BYTE STRING CLASS.
Definition: fx_string.h:317
bool IsCPDF()
Check whether the loaded document is a ConnectedPDF document or not.
bool IsEmpty() const
Check whether current object is empty or not.
String GetVersionID()
Get the ConnectedPDF document version ID from the loaded document.
Structure that represents the client information which is used to apply for a client ID from Connecte...
Definition: fs_connectedpdf.h:49
static String GetUserTokenFromServer(const char *endpoint, const String &user_email, const String &password)
Get the user token from ConnectedPDF server.
Foxit namespace.
Definition: fs_connectedpdf.h:26
static String GetClientIDFromServer(const char *endpoint, ClientInfo *client_info)
Apply for a client id from ConnectedPDF server using the input client info.
ConnectedPDF(const char *clientid, const char *user_token, const char *content_key, const char *file_path)
Constructor, with parameters and from an existing PDF file path.
bool IsOwner()
Check whether current user is the owner.
Header file for PDF document related definitions and classes.
String device_id
The device ID that represents a device.
Definition: fs_connectedpdf.h:52
String device_name
The device name.
Definition: fs_connectedpdf.h:54
#define NULL
The null-pointer value.
Definition: fx_system.h:773
Definition: fs_pdfdoc.h:338
bool operator==(const ConnectedPDF &other) const
Equal operator.
ConnectedPDF & operator=(const ConnectedPDF &other)
Assign operator.
String GetOwnerEmail()
Get the ConnectedPDF document owner email.
String GetDocURI()
Get the ConnectedPDF document URI from the loaded document.
bool IsCDRM()
Check whether the loaded document is a ConnectedPDF DRM document or not.
String product_name
The product name of a ConnectedPDF client.
Definition: fs_connectedpdf.h:62
void SetUserToken(const String &user_token)
Set the user token to switch it.
String product_vendor
The vendor of the product.
Definition: fs_connectedpdf.h:64
Definition: fs_basictypes.h:342
Definition: fs_connectedpdf.h:39

Foxit Software Corporation Logo
@2019 Foxit Software Incorporated. All rights reserved.