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 
~ConnectedPDF()
Destructor function.
String device_model
The device model.
Definition: fs_connectedpdf.h:56
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:62
File writing interface.
Definition: fx_stream.h:449
String mac_address
The MAC address.
Definition: fs_connectedpdf.h:58
CFX_Object Object
Object type.
Definition: fs_basictypes.h:216
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
foxit::ErrorCode ConvertToCPDF(const char *endpoint, const char *file_name)
Convert the loaded document to a ConnectedPDF document.
Definition: fs_pdfdoc.h:338
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:54
String product_vendor
The vendor of the product.
Definition: fs_connectedpdf.h:64
bool IsCPDF()
Check whether the loaded document is a ConnectedPDF document or not.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:233
Structure that represents the client information which is used to apply for a client ID from Connecte...
Definition: fs_connectedpdf.h:49
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.
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:52
String GetOwnerEmail()
Get the ConnectedPDF document owner email.
String product_language
The language of the product.
Definition: fs_connectedpdf.h:68
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
Header file for common definitions and classes.
String GetDocURI()
Get the ConnectedPDF document URI from the loaded document.
Definition: fs_basictypes.h:333
String product_version
The version of the product.
Definition: fs_connectedpdf.h:66
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_connectedpdf.h:26
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:767
String os
The operation system.
Definition: fs_connectedpdf.h:60
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.
String GetOwnerName()
Get the ConnectedPDF document owner name.
void SetUserToken(const String &user_token)
Set the user token to switch it.

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