| 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 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" | 7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" |
| 8 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" | 8 |
| 9 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h" | 9 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h" |
| 10 #include "fpdfsdk/include/fsdk_define.h" | 10 #include "fpdfsdk/include/fsdk_define.h" |
| 11 #include "fpdfsdk/include/fsdk_mgr.h" | 11 #include "fpdfsdk/include/fsdk_mgr.h" |
| 12 #include "public/fpdf_formfill.h" | |
| 13 #include "xfa/fxbarcode/include/BC_Library.h" | 12 #include "xfa/fxbarcode/include/BC_Library.h" |
| 14 #include "xfa/fxfa/include/xfa_ffapp.h" | 13 #include "xfa/fxfa/include/xfa_ffapp.h" |
| 15 #include "xfa/fxfa/include/xfa_fontmgr.h" | 14 #include "xfa/fxfa/include/xfa_fontmgr.h" |
| 16 | 15 |
| 17 CPDFXFA_App* CPDFXFA_App::g_pApp = nullptr; | 16 CPDFXFA_App* CPDFXFA_App::g_pApp = nullptr; |
| 18 | 17 |
| 19 CPDFXFA_App* CPDFXFA_App::GetInstance() { | 18 CPDFXFA_App* CPDFXFA_App::GetInstance() { |
| 20 if (!g_pApp) { | 19 if (!g_pApp) { |
| 21 g_pApp = new CPDFXFA_App(); | 20 g_pApp = new CPDFXFA_App(); |
| 22 } | 21 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 wsAppType = m_csAppType; | 86 wsAppType = m_csAppType; |
| 88 } | 87 } |
| 89 | 88 |
| 90 void CPDFXFA_App::GetAppName(CFX_WideString& wsName) { | 89 void CPDFXFA_App::GetAppName(CFX_WideString& wsName) { |
| 91 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 90 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
| 92 if (pEnv) { | 91 if (pEnv) { |
| 93 wsName = pEnv->FFI_GetAppName(); | 92 wsName = pEnv->FFI_GetAppName(); |
| 94 } | 93 } |
| 95 } | 94 } |
| 96 | 95 |
| 96 void CPDFXFA_App::GetFoxitAppName(CFX_WideString& wsFoxitName) { |
| 97 wsFoxitName = L"Foxit"; |
| 98 } |
| 99 |
| 97 void CPDFXFA_App::SetAppType(const CFX_WideStringC& wsAppType) { | 100 void CPDFXFA_App::SetAppType(const CFX_WideStringC& wsAppType) { |
| 98 m_csAppType = wsAppType; | 101 m_csAppType = wsAppType; |
| 99 } | 102 } |
| 100 | 103 |
| 104 void CPDFXFA_App::SetFoxitAppType(const CFX_WideStringC& wsFoxitAppType) {} |
| 105 |
| 106 void CPDFXFA_App::GetFoxitAppType(CFX_WideString& wsFoxitAppType) { |
| 107 wsFoxitAppType.clear(); |
| 108 } |
| 109 |
| 101 void CPDFXFA_App::GetLanguage(CFX_WideString& wsLanguage) { | 110 void CPDFXFA_App::GetLanguage(CFX_WideString& wsLanguage) { |
| 102 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 111 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
| 103 if (pEnv) { | 112 if (pEnv) { |
| 104 wsLanguage = pEnv->FFI_GetLanguage(); | 113 wsLanguage = pEnv->FFI_GetLanguage(); |
| 105 } | 114 } |
| 106 } | 115 } |
| 107 | 116 |
| 108 void CPDFXFA_App::GetPlatform(CFX_WideString& wsPlatform) { | 117 void CPDFXFA_App::GetPlatform(CFX_WideString& wsPlatform) { |
| 109 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 118 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
| 110 if (pEnv) { | 119 if (pEnv) { |
| 111 wsPlatform = pEnv->FFI_GetPlatform(); | 120 wsPlatform = pEnv->FFI_GetPlatform(); |
| 112 } | 121 } |
| 113 } | 122 } |
| 114 | 123 |
| 115 void CPDFXFA_App::GetVariation(CFX_WideString& wsVariation) { | 124 void CPDFXFA_App::GetVariation(CFX_WideString& wsVariation) { |
| 116 wsVariation = JS_STR_VIEWERVARIATION; | 125 wsVariation = JS_STR_VIEWERVARIATION; |
| 117 } | 126 } |
| 118 | 127 |
| 119 void CPDFXFA_App::GetVersion(CFX_WideString& wsVersion) { | 128 void CPDFXFA_App::GetVersion(CFX_WideString& wsVersion) { |
| 120 wsVersion = JS_STR_VIEWERVERSION_XFA; | 129 wsVersion = JS_STR_VIEWERVERSION_XFA; |
| 121 } | 130 } |
| 122 | 131 |
| 132 void CPDFXFA_App::GetFoxitVersion(CFX_WideString& wsFoxitVersion) { |
| 133 wsFoxitVersion = L"7.0"; |
| 134 } |
| 135 |
| 123 void CPDFXFA_App::Beep(uint32_t dwType) { | 136 void CPDFXFA_App::Beep(uint32_t dwType) { |
| 124 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 137 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
| 125 if (pEnv) { | 138 if (pEnv) { |
| 126 pEnv->JS_appBeep(dwType); | 139 pEnv->JS_appBeep(dwType); |
| 127 } | 140 } |
| 128 } | 141 } |
| 129 | 142 |
| 130 int32_t CPDFXFA_App::MsgBox(const CFX_WideString& wsMessage, | 143 int32_t CPDFXFA_App::MsgBox(const CFX_WideString& wsMessage, |
| 131 const CFX_WideString& wsTitle, | 144 const CFX_WideString& wsTitle, |
| 132 uint32_t dwIconType, | 145 uint32_t dwIconType, |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 } | 362 } |
| 350 } | 363 } |
| 351 | 364 |
| 352 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { | 365 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { |
| 353 CXFA_FWLAdapterTimerMgr* pAdapter = nullptr; | 366 CXFA_FWLAdapterTimerMgr* pAdapter = nullptr; |
| 354 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 367 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
| 355 if (pEnv) | 368 if (pEnv) |
| 356 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); | 369 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); |
| 357 return pAdapter; | 370 return pAdapter; |
| 358 } | 371 } |
| OLD | NEW |