OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_CPDFSDK_ENVIRONMENT_H_ | 7 #ifndef FPDFSDK_INCLUDE_CPDFSDK_ENVIRONMENT_H_ |
8 #define FPDFSDK_INCLUDE_CPDFSDK_ENVIRONMENT_H_ | 8 #define FPDFSDK_INCLUDE_CPDFSDK_ENVIRONMENT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 12 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
14 #include "core/fpdfdoc/include/cpdf_occontext.h" | 14 #include "core/fpdfdoc/include/cpdf_occontext.h" |
15 #include "core/fxcrt/include/cfx_observable.h" | 15 #include "core/fxcrt/include/cfx_observable.h" |
16 #include "fpdfsdk/cfx_systemhandler.h" | 16 #include "fpdfsdk/cfx_systemhandler.h" |
17 #include "fpdfsdk/include/fsdk_define.h" | 17 #include "fpdfsdk/include/fsdk_define.h" |
18 #include "public/fpdf_formfill.h" | 18 #include "public/fpdf_formfill.h" |
19 #include "public/fpdf_fwlevent.h" | 19 #include "public/fpdf_fwlevent.h" |
20 | 20 |
21 class CFFL_IFormFiller; | 21 class CFFL_InteractiveFormFiller; |
22 class CFX_SystemHandler; | 22 class CFX_SystemHandler; |
23 class CPDFSDK_ActionHandler; | 23 class CPDFSDK_ActionHandler; |
24 class CPDFSDK_AnnotHandlerMgr; | 24 class CPDFSDK_AnnotHandlerMgr; |
25 class CPDFSDK_Document; | 25 class CPDFSDK_Document; |
26 class IJS_Runtime; | 26 class IJS_Runtime; |
27 | 27 |
28 class CPDFSDK_Environment final { | 28 class CPDFSDK_Environment final { |
29 public: | 29 public: |
30 CPDFSDK_Environment(UnderlyingDocumentType* pDoc, FPDF_FORMFILLINFO* pFFinfo); | 30 CPDFSDK_Environment(UnderlyingDocumentType* pDoc, FPDF_FORMFILLINFO* pFFinfo); |
31 ~CPDFSDK_Environment(); | 31 ~CPDFSDK_Environment(); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; } | 393 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; } |
394 void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; } | 394 void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; } |
395 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; } | 395 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; } |
396 UnderlyingDocumentType* GetUnderlyingDocument() const { | 396 UnderlyingDocumentType* GetUnderlyingDocument() const { |
397 return m_pUnderlyingDoc; | 397 return m_pUnderlyingDoc; |
398 } | 398 } |
399 CFX_ByteString GetAppName() const { return ""; } | 399 CFX_ByteString GetAppName() const { return ""; } |
400 CFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } | 400 CFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } |
401 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } | 401 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } |
402 | 402 |
403 CFFL_IFormFiller* GetIFormFiller(); // Creates if not present. | 403 // Creates if not present. |
| 404 CFFL_InteractiveFormFiller* GetInteractiveFormFiller(); |
404 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. | 405 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. |
405 IJS_Runtime* GetJSRuntime(); // Creates if not present. | 406 IJS_Runtime* GetJSRuntime(); // Creates if not present. |
406 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. | 407 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. |
407 | 408 |
408 private: | 409 private: |
409 std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; | 410 std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; |
410 std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; | 411 std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; |
411 std::unique_ptr<IJS_Runtime> m_pJSRuntime; | 412 std::unique_ptr<IJS_Runtime> m_pJSRuntime; |
412 FPDF_FORMFILLINFO* const m_pInfo; | 413 FPDF_FORMFILLINFO* const m_pInfo; |
413 CPDFSDK_Document* m_pSDKDoc; | 414 CPDFSDK_Document* m_pSDKDoc; |
414 UnderlyingDocumentType* const m_pUnderlyingDoc; | 415 UnderlyingDocumentType* const m_pUnderlyingDoc; |
415 std::unique_ptr<CFFL_IFormFiller> m_pIFormFiller; | 416 std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller; |
416 std::unique_ptr<CFX_SystemHandler> m_pSysHandler; | 417 std::unique_ptr<CFX_SystemHandler> m_pSysHandler; |
417 }; | 418 }; |
418 | 419 |
419 #endif // FPDFSDK_INCLUDE_CPDFSDK_ENVIRONMENT_H_ | 420 #endif // FPDFSDK_INCLUDE_CPDFSDK_ENVIRONMENT_H_ |
OLD | NEW |