| 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_FPDFXFA_CPDFXFA_APP_H_ | 7 #ifndef FPDFSDK_FPDFXFA_CPDFXFA_APP_H_ |
| 8 #define FPDFSDK_FPDFXFA_CPDFXFA_APP_H_ | 8 #define FPDFSDK_FPDFXFA_CPDFXFA_APP_H_ |
| 9 | 9 |
| 10 #include "third_party/base/ptr_util.h" |
| 10 #include "xfa/fxfa/fxfa.h" | 11 #include "xfa/fxfa/fxfa.h" |
| 11 | 12 |
| 12 class CPDFSDK_FormFillEnvironment; | 13 class CPDFSDK_FormFillEnvironment; |
| 13 class IFXJS_Runtime; | 14 class CJS_Runtime; |
| 14 | 15 |
| 15 class CPDFXFA_App : public IXFA_AppProvider { | 16 class CPDFXFA_App : public IXFA_AppProvider { |
| 16 public: | 17 public: |
| 17 static CPDFXFA_App* GetInstance(); | |
| 18 static void ReleaseInstance(); | |
| 19 | |
| 20 CPDFXFA_App(); | 18 CPDFXFA_App(); |
| 21 ~CPDFXFA_App() override; | 19 ~CPDFXFA_App() override; |
| 22 | 20 |
| 23 FX_BOOL Initialize(v8::Isolate* pIsolate); | |
| 24 CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); } | 21 CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); } |
| 25 | 22 |
| 26 FX_BOOL AddFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); | 23 void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
| 27 FX_BOOL RemoveFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); | |
| 28 | 24 |
| 29 FX_BOOL IsJavaScriptInitialized() const { return m_bJavaScriptInitialized; } | 25 v8::Isolate* GetJSERuntime() const; |
| 30 void SetJavaScriptInitialized(FX_BOOL bInitialized) { | |
| 31 m_bJavaScriptInitialized = bInitialized; | |
| 32 } | |
| 33 | |
| 34 v8::Isolate* GetJSERuntime() const { return m_pIsolate; } | |
| 35 | 26 |
| 36 // IFXA_AppProvider: | 27 // IFXA_AppProvider: |
| 37 void GetLanguage(CFX_WideString& wsLanguage) override; | 28 void GetLanguage(CFX_WideString& wsLanguage) override; |
| 38 void GetPlatform(CFX_WideString& wsPlatform) override; | 29 void GetPlatform(CFX_WideString& wsPlatform) override; |
| 39 void GetAppName(CFX_WideString& wsName) override; | 30 void GetAppName(CFX_WideString& wsName) override; |
| 40 | 31 |
| 41 void Beep(uint32_t dwType) override; | 32 void Beep(uint32_t dwType) override; |
| 42 int32_t MsgBox(const CFX_WideString& wsMessage, | 33 int32_t MsgBox(const CFX_WideString& wsMessage, |
| 43 const CFX_WideString& wsTitle, | 34 const CFX_WideString& wsTitle, |
| 44 uint32_t dwIconType, | 35 uint32_t dwIconType, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 55 const CFX_WideString& wsEncode, | 46 const CFX_WideString& wsEncode, |
| 56 const CFX_WideString& wsHeader, | 47 const CFX_WideString& wsHeader, |
| 57 CFX_WideString& wsResponse) override; | 48 CFX_WideString& wsResponse) override; |
| 58 FX_BOOL PutRequestURL(const CFX_WideString& wsURL, | 49 FX_BOOL PutRequestURL(const CFX_WideString& wsURL, |
| 59 const CFX_WideString& wsData, | 50 const CFX_WideString& wsData, |
| 60 const CFX_WideString& wsEncode) override; | 51 const CFX_WideString& wsEncode) override; |
| 61 | 52 |
| 62 void LoadString(int32_t iStringID, CFX_WideString& wsString) override; | 53 void LoadString(int32_t iStringID, CFX_WideString& wsString) override; |
| 63 IFWL_AdapterTimerMgr* GetTimerMgr() override; | 54 IFWL_AdapterTimerMgr* GetTimerMgr() override; |
| 64 | 55 |
| 65 CFX_ArrayTemplate<CPDFSDK_FormFillEnvironment*> m_pFormFillEnvList; | 56 private: |
| 66 | 57 CPDFSDK_FormFillEnvironment* m_pFormFillEnv; // Not owned. |
| 67 protected: | |
| 68 FX_BOOL m_bJavaScriptInitialized; | |
| 69 std::unique_ptr<CXFA_FFApp> m_pXFAApp; | 58 std::unique_ptr<CXFA_FFApp> m_pXFAApp; |
| 70 v8::Isolate* m_pIsolate; | |
| 71 }; | 59 }; |
| 72 | 60 |
| 73 #endif // FPDFSDK_FPDFXFA_CPDFXFA_APP_H_ | 61 #endif // FPDFSDK_FPDFXFA_CPDFXFA_APP_H_ |
| OLD | NEW |