| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef FPDFSDK_INCLUDE_FSDK_MGR_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_MGR_H_ |
| 8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 class CFFL_IFormFiller; | 30 class CFFL_IFormFiller; |
| 31 class CPDFSDK_ActionHandler; | 31 class CPDFSDK_ActionHandler; |
| 32 class CPDFSDK_Annot; | 32 class CPDFSDK_Annot; |
| 33 class CPDFSDK_Document; | 33 class CPDFSDK_Document; |
| 34 class CPDFSDK_InterForm; | 34 class CPDFSDK_InterForm; |
| 35 class CPDFSDK_PageView; | 35 class CPDFSDK_PageView; |
| 36 class CPDFSDK_Widget; | 36 class CPDFSDK_Widget; |
| 37 class IFX_SystemHandler; | 37 class IFX_SystemHandler; |
| 38 | 38 |
| 39 // NOTE: |bsUTF16LE| must outlive the use of the result. Care must be taken |
| 40 // since modifying the result would impact |bsUTF16LE|. |
| 41 FPDF_WIDESTRING AsFPDFWideString(CFX_ByteString* bsUTF16LE); |
| 42 |
| 39 class CPDFDoc_Environment final { | 43 class CPDFDoc_Environment final { |
| 40 public: | 44 public: |
| 41 CPDFDoc_Environment(UnderlyingDocumentType* pDoc, FPDF_FORMFILLINFO* pFFinfo); | 45 CPDFDoc_Environment(UnderlyingDocumentType* pDoc, FPDF_FORMFILLINFO* pFFinfo); |
| 42 ~CPDFDoc_Environment(); | 46 ~CPDFDoc_Environment(); |
| 43 | 47 |
| 44 #ifdef PDF_ENABLE_XFA | 48 #ifdef PDF_ENABLE_XFA |
| 45 void Release() { | 49 void Release() { |
| 46 if (m_pInfo && m_pInfo->Release) | 50 if (m_pInfo && m_pInfo->Release) |
| 47 m_pInfo->Release(m_pInfo); | 51 m_pInfo->Release(m_pInfo); |
| 48 delete this; | 52 delete this; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag) const { | 115 FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag) const { |
| 112 return (nFlag & FWL_EVENTFLAG_ControlKey) != 0; | 116 return (nFlag & FWL_EVENTFLAG_ControlKey) != 0; |
| 113 } | 117 } |
| 114 | 118 |
| 115 FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag) const { | 119 FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag) const { |
| 116 return (nFlag & FWL_EVENTFLAG_AltKey) != 0; | 120 return (nFlag & FWL_EVENTFLAG_AltKey) != 0; |
| 117 } | 121 } |
| 118 | 122 |
| 119 FX_BOOL FFI_IsINSERTKeyDown(FX_DWORD nFlag) const { return FALSE; } | 123 FX_BOOL FFI_IsINSERTKeyDown(FX_DWORD nFlag) const { return FALSE; } |
| 120 | 124 |
| 121 int JS_appAlert(const FX_WCHAR* Msg, | |
| 122 const FX_WCHAR* Title, | |
| 123 FX_UINT Type, | |
| 124 FX_UINT Icon); | |
| 125 int JS_appResponse(const FX_WCHAR* Question, | |
| 126 const FX_WCHAR* Title, | |
| 127 const FX_WCHAR* Default, | |
| 128 const FX_WCHAR* cLabel, | |
| 129 FPDF_BOOL bPassword, | |
| 130 void* response, | |
| 131 int length); | |
| 132 | |
| 133 void JS_appBeep(int nType) { | |
| 134 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_beep) | |
| 135 m_pInfo->m_pJsPlatform->app_beep(m_pInfo->m_pJsPlatform, nType); | |
| 136 } | |
| 137 | |
| 138 CFX_WideString JS_fieldBrowse(); | |
| 139 CFX_WideString JS_docGetFilePath(); | |
| 140 | |
| 141 void JS_docSubmitForm(void* formData, int length, const FX_WCHAR* URL); | |
| 142 void JS_docmailForm(void* mailData, | |
| 143 int length, | |
| 144 FPDF_BOOL bUI, | |
| 145 const FX_WCHAR* To, | |
| 146 const FX_WCHAR* Subject, | |
| 147 const FX_WCHAR* CC, | |
| 148 const FX_WCHAR* BCC, | |
| 149 const FX_WCHAR* Msg); | |
| 150 | |
| 151 void JS_docprint(FPDF_BOOL bUI, | |
| 152 int nStart, | |
| 153 int nEnd, | |
| 154 FPDF_BOOL bSilent, | |
| 155 FPDF_BOOL bShrinkToFit, | |
| 156 FPDF_BOOL bPrintAsImage, | |
| 157 FPDF_BOOL bReverse, | |
| 158 FPDF_BOOL bAnnotations) { | |
| 159 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_print) | |
| 160 m_pInfo->m_pJsPlatform->Doc_print(m_pInfo->m_pJsPlatform, bUI, nStart, | |
| 161 nEnd, bSilent, bShrinkToFit, | |
| 162 bPrintAsImage, bReverse, bAnnotations); | |
| 163 } | |
| 164 | |
| 165 void JS_docgotoPage(int nPageNum) { | |
| 166 if (m_pInfo && m_pInfo->m_pJsPlatform && | |
| 167 m_pInfo->m_pJsPlatform->Doc_gotoPage) | |
| 168 m_pInfo->m_pJsPlatform->Doc_gotoPage(m_pInfo->m_pJsPlatform, nPageNum); | |
| 169 } | |
| 170 | |
| 171 FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document, int nPageIndex) { | 125 FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document, int nPageIndex) { |
| 172 if (m_pInfo && m_pInfo->FFI_GetPage) | 126 if (m_pInfo && m_pInfo->FFI_GetPage) |
| 173 return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex); | 127 return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex); |
| 174 return NULL; | 128 return NULL; |
| 175 } | 129 } |
| 176 | 130 |
| 177 FPDF_PAGE FFI_GetCurrentPage(FPDF_DOCUMENT document) { | 131 FPDF_PAGE FFI_GetCurrentPage(FPDF_DOCUMENT document) { |
| 178 if (m_pInfo && m_pInfo->FFI_GetCurrentPage) | 132 if (m_pInfo && m_pInfo->FFI_GetCurrentPage) |
| 179 return m_pInfo->FFI_GetCurrentPage(m_pInfo, document); | 133 return m_pInfo->FFI_GetCurrentPage(m_pInfo, document); |
| 180 return NULL; | 134 return NULL; |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 CFX_WideString wsRet = CFX_WideString::FromUTF16LE( | 399 CFX_WideString wsRet = CFX_WideString::FromUTF16LE( |
| 446 (unsigned short*)bsRet.GetBuffer(bsRet.GetLength()), | 400 (unsigned short*)bsRet.GetBuffer(bsRet.GetLength()), |
| 447 bsRet.GetLength() / sizeof(unsigned short)); | 401 bsRet.GetLength() / sizeof(unsigned short)); |
| 448 delete[] pbuff; | 402 delete[] pbuff; |
| 449 return wsRet; | 403 return wsRet; |
| 450 } | 404 } |
| 451 return L""; | 405 return L""; |
| 452 } | 406 } |
| 453 #endif // PDF_ENABLE_XFA | 407 #endif // PDF_ENABLE_XFA |
| 454 | 408 |
| 409 int JS_appAlert(const FX_WCHAR* Msg, |
| 410 const FX_WCHAR* Title, |
| 411 FX_UINT Type, |
| 412 FX_UINT Icon); |
| 413 int JS_appResponse(const FX_WCHAR* Question, |
| 414 const FX_WCHAR* Title, |
| 415 const FX_WCHAR* Default, |
| 416 const FX_WCHAR* cLabel, |
| 417 FPDF_BOOL bPassword, |
| 418 void* response, |
| 419 int length); |
| 420 void JS_appBeep(int nType); |
| 421 CFX_WideString JS_fieldBrowse(); |
| 422 CFX_WideString JS_docGetFilePath(); |
| 423 void JS_docSubmitForm(void* formData, int length, const FX_WCHAR* URL); |
| 424 void JS_docmailForm(void* mailData, |
| 425 int length, |
| 426 FPDF_BOOL bUI, |
| 427 const FX_WCHAR* To, |
| 428 const FX_WCHAR* Subject, |
| 429 const FX_WCHAR* CC, |
| 430 const FX_WCHAR* BCC, |
| 431 const FX_WCHAR* Msg); |
| 432 void JS_docprint(FPDF_BOOL bUI, |
| 433 int nStart, |
| 434 int nEnd, |
| 435 FPDF_BOOL bSilent, |
| 436 FPDF_BOOL bShrinkToFit, |
| 437 FPDF_BOOL bPrintAsImage, |
| 438 FPDF_BOOL bReverse, |
| 439 FPDF_BOOL bAnnotations); |
| 440 void JS_docgotoPage(int nPageNum); |
| 441 |
| 455 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; } | 442 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; } |
| 456 void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; } | 443 void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; } |
| 457 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; } | 444 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; } |
| 458 UnderlyingDocumentType* GetUnderlyingDocument() const { | 445 UnderlyingDocumentType* GetUnderlyingDocument() const { |
| 459 return m_pUnderlyingDoc; | 446 return m_pUnderlyingDoc; |
| 460 } | 447 } |
| 461 CFX_ByteString GetAppName() const { return ""; } | 448 CFX_ByteString GetAppName() const { return ""; } |
| 462 IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } | 449 IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } |
| 463 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } | 450 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } |
| 464 | 451 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 FX_BOOL m_bTakeOverPage; | 649 FX_BOOL m_bTakeOverPage; |
| 663 #endif // PDF_ENABLE_XFA | 650 #endif // PDF_ENABLE_XFA |
| 664 FX_BOOL m_bEnterWidget; | 651 FX_BOOL m_bEnterWidget; |
| 665 FX_BOOL m_bExitWidget; | 652 FX_BOOL m_bExitWidget; |
| 666 FX_BOOL m_bOnWidget; | 653 FX_BOOL m_bOnWidget; |
| 667 FX_BOOL m_bValid; | 654 FX_BOOL m_bValid; |
| 668 FX_BOOL m_bLocked; | 655 FX_BOOL m_bLocked; |
| 669 }; | 656 }; |
| 670 | 657 |
| 671 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ | 658 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ |
| OLD | NEW |