Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
dsinclair | 4d29e78 | 2016-10-04 14:02:47 -0700 | [diff] [blame] | 7 | #include "fpdfsdk/fpdfxfa/cpdfxfa_app.h" |
weili | 625ad66 | 2016-06-15 11:21:33 -0700 | [diff] [blame] | 8 | |
thestig | d4c34f2 | 2016-09-28 17:04:51 -0700 | [diff] [blame] | 9 | #include <memory> |
| 10 | |
dsinclair | 735606d | 2016-10-05 15:47:02 -0700 | [diff] [blame] | 11 | #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
dsinclair | 4d29e78 | 2016-10-04 14:02:47 -0700 | [diff] [blame] | 12 | #include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h" |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 13 | #include "fpdfsdk/fsdk_define.h" |
tsepez | 36eb4bd | 2016-10-03 15:24:27 -0700 | [diff] [blame] | 14 | #include "third_party/base/ptr_util.h" |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 15 | #include "xfa/fxbarcode/BC_Library.h" |
dsinclair | 5b49309 | 2016-09-29 20:20:24 -0700 | [diff] [blame] | 16 | #include "xfa/fxfa/xfa_ffapp.h" |
| 17 | #include "xfa/fxfa/xfa_fontmgr.h" |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 18 | |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 19 | namespace { |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 20 | |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 21 | CPDFXFA_App* g_pApp = nullptr; |
| 22 | |
| 23 | } // namespace |
| 24 | |
| 25 | CPDFXFA_App* CPDFXFA_App::GetInstance() { |
| 26 | if (!g_pApp) { |
| 27 | g_pApp = new CPDFXFA_App(); |
| 28 | } |
| 29 | return g_pApp; |
| 30 | } |
| 31 | |
| 32 | void CPDFXFA_App::ReleaseInstance() { |
| 33 | delete g_pApp; |
| 34 | g_pApp = nullptr; |
| 35 | } |
| 36 | |
| 37 | CPDFXFA_App::CPDFXFA_App() |
| 38 | : m_bJavaScriptInitialized(FALSE), m_pIsolate(nullptr) { |
| 39 | m_pFormFillEnvList.RemoveAll(); |
dsinclair | b685e64 | 2016-10-13 10:57:01 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | CPDFXFA_App::~CPDFXFA_App() { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 43 | FXJSE_Runtime_Release(m_pIsolate); |
| 44 | m_pIsolate = nullptr; |
| 45 | |
| 46 | FXJSE_Finalize(); |
| 47 | BC_Library_Destory(); |
| 48 | } |
| 49 | |
| 50 | FX_BOOL CPDFXFA_App::Initialize(v8::Isolate* pIsolate) { |
| 51 | BC_Library_Init(); |
| 52 | FXJSE_Initialize(); |
| 53 | |
| 54 | m_pIsolate = pIsolate ? pIsolate : FXJSE_Runtime_Create_Own(); |
| 55 | if (!m_pIsolate) |
| 56 | return FALSE; |
| 57 | |
| 58 | m_pXFAApp = pdfium::MakeUnique<CXFA_FFApp>(this); |
| 59 | m_pXFAApp->SetDefaultFontMgr( |
| 60 | std::unique_ptr<CXFA_DefFontMgr>(new CXFA_DefFontMgr)); |
| 61 | |
| 62 | return TRUE; |
| 63 | } |
| 64 | |
| 65 | FX_BOOL CPDFXFA_App::AddFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv) { |
| 66 | if (!pFormFillEnv) |
| 67 | return FALSE; |
| 68 | |
| 69 | m_pFormFillEnvList.Add(pFormFillEnv); |
| 70 | return TRUE; |
| 71 | } |
| 72 | |
| 73 | FX_BOOL CPDFXFA_App::RemoveFormFillEnv( |
| 74 | CPDFSDK_FormFillEnvironment* pFormFillEnv) { |
| 75 | if (!pFormFillEnv) |
| 76 | return FALSE; |
| 77 | |
| 78 | int nFind = m_pFormFillEnvList.Find(pFormFillEnv); |
| 79 | if (nFind != -1) { |
| 80 | m_pFormFillEnvList.RemoveAt(nFind); |
| 81 | return TRUE; |
| 82 | } |
| 83 | |
| 84 | return FALSE; |
dsinclair | b685e64 | 2016-10-13 10:57:01 -0700 | [diff] [blame] | 85 | } |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 86 | |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 87 | void CPDFXFA_App::GetAppName(CFX_WideString& wsName) { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 88 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 89 | if (pFormFillEnv) |
| 90 | wsName = pFormFillEnv->FFI_GetAppName(); |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 91 | } |
| 92 | |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 93 | void CPDFXFA_App::GetLanguage(CFX_WideString& wsLanguage) { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 94 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 95 | if (pFormFillEnv) |
| 96 | wsLanguage = pFormFillEnv->GetLanguage(); |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | void CPDFXFA_App::GetPlatform(CFX_WideString& wsPlatform) { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 100 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 101 | if (pFormFillEnv) { |
| 102 | wsPlatform = pFormFillEnv->GetPlatform(); |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 103 | } |
| 104 | } |
| 105 | |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 106 | void CPDFXFA_App::Beep(uint32_t dwType) { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 107 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 108 | if (pFormFillEnv) |
| 109 | pFormFillEnv->JS_appBeep(dwType); |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 110 | } |
| 111 | |
tsepez | 3f80c86 | 2016-05-16 12:03:24 -0700 | [diff] [blame] | 112 | int32_t CPDFXFA_App::MsgBox(const CFX_WideString& wsMessage, |
| 113 | const CFX_WideString& wsTitle, |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 114 | uint32_t dwIconType, |
| 115 | uint32_t dwButtonType) { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 116 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 117 | if (!pFormFillEnv) |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 118 | return -1; |
| 119 | |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 120 | uint32_t iconType = 0; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 121 | int iButtonType = 0; |
| 122 | switch (dwIconType) { |
| 123 | case XFA_MBICON_Error: |
| 124 | iconType |= 0; |
| 125 | break; |
| 126 | case XFA_MBICON_Warning: |
| 127 | iconType |= 1; |
| 128 | break; |
| 129 | case XFA_MBICON_Question: |
| 130 | iconType |= 2; |
| 131 | break; |
| 132 | case XFA_MBICON_Status: |
| 133 | iconType |= 3; |
| 134 | break; |
| 135 | } |
| 136 | switch (dwButtonType) { |
| 137 | case XFA_MB_OK: |
| 138 | iButtonType |= 0; |
| 139 | break; |
| 140 | case XFA_MB_OKCancel: |
| 141 | iButtonType |= 1; |
| 142 | break; |
| 143 | case XFA_MB_YesNo: |
| 144 | iButtonType |= 2; |
| 145 | break; |
| 146 | case XFA_MB_YesNoCancel: |
| 147 | iButtonType |= 3; |
| 148 | break; |
| 149 | } |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 150 | int32_t iRet = pFormFillEnv->JS_appAlert(wsMessage.c_str(), wsTitle.c_str(), |
| 151 | iButtonType, iconType); |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 152 | switch (iRet) { |
| 153 | case 1: |
| 154 | return XFA_IDOK; |
| 155 | case 2: |
| 156 | return XFA_IDCancel; |
| 157 | case 3: |
| 158 | return XFA_IDNo; |
| 159 | case 4: |
| 160 | return XFA_IDYes; |
| 161 | } |
| 162 | return XFA_IDYes; |
| 163 | } |
| 164 | |
tsepez | 3f80c86 | 2016-05-16 12:03:24 -0700 | [diff] [blame] | 165 | CFX_WideString CPDFXFA_App::Response(const CFX_WideString& wsQuestion, |
| 166 | const CFX_WideString& wsTitle, |
| 167 | const CFX_WideString& wsDefaultAnswer, |
| 168 | FX_BOOL bMark) { |
| 169 | CFX_WideString wsAnswer; |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 170 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 171 | if (pFormFillEnv) { |
| 172 | int nLength = 2048; |
| 173 | char* pBuff = new char[nLength]; |
| 174 | nLength = pFormFillEnv->JS_appResponse(wsQuestion.c_str(), wsTitle.c_str(), |
dsinclair | 8779fa8 | 2016-10-12 12:05:44 -0700 | [diff] [blame] | 175 | wsDefaultAnswer.c_str(), nullptr, |
| 176 | bMark, pBuff, nLength); |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 177 | if (nLength > 0) { |
| 178 | nLength = nLength > 2046 ? 2046 : nLength; |
| 179 | pBuff[nLength] = 0; |
| 180 | pBuff[nLength + 1] = 0; |
| 181 | wsAnswer = CFX_WideString::FromUTF16LE( |
| 182 | reinterpret_cast<const unsigned short*>(pBuff), |
| 183 | nLength / sizeof(unsigned short)); |
| 184 | } |
| 185 | delete[] pBuff; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 186 | } |
tsepez | 3f80c86 | 2016-05-16 12:03:24 -0700 | [diff] [blame] | 187 | return wsAnswer; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 188 | } |
| 189 | |
tsepez | 3f80c86 | 2016-05-16 12:03:24 -0700 | [diff] [blame] | 190 | IFX_FileRead* CPDFXFA_App::DownloadURL(const CFX_WideString& wsURL) { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 191 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 192 | return pFormFillEnv ? pFormFillEnv->DownloadFromURL(wsURL.c_str()) : nullptr; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 193 | } |
| 194 | |
tsepez | 3f80c86 | 2016-05-16 12:03:24 -0700 | [diff] [blame] | 195 | FX_BOOL CPDFXFA_App::PostRequestURL(const CFX_WideString& wsURL, |
| 196 | const CFX_WideString& wsData, |
| 197 | const CFX_WideString& wsContentType, |
| 198 | const CFX_WideString& wsEncode, |
| 199 | const CFX_WideString& wsHeader, |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 200 | CFX_WideString& wsResponse) { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 201 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 202 | if (!pFormFillEnv) |
tsepez | 3f80c86 | 2016-05-16 12:03:24 -0700 | [diff] [blame] | 203 | return FALSE; |
| 204 | |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 205 | wsResponse = pFormFillEnv->PostRequestURL(wsURL.c_str(), wsData.c_str(), |
| 206 | wsContentType.c_str(), |
| 207 | wsEncode.c_str(), wsHeader.c_str()); |
tsepez | 3f80c86 | 2016-05-16 12:03:24 -0700 | [diff] [blame] | 208 | return TRUE; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 209 | } |
| 210 | |
tsepez | 3f80c86 | 2016-05-16 12:03:24 -0700 | [diff] [blame] | 211 | FX_BOOL CPDFXFA_App::PutRequestURL(const CFX_WideString& wsURL, |
| 212 | const CFX_WideString& wsData, |
| 213 | const CFX_WideString& wsEncode) { |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 214 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 215 | return pFormFillEnv && |
| 216 | pFormFillEnv->PutRequestURL(wsURL.c_str(), wsData.c_str(), |
| 217 | wsEncode.c_str()); |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | void CPDFXFA_App::LoadString(int32_t iStringID, CFX_WideString& wsString) { |
| 221 | switch (iStringID) { |
| 222 | case XFA_IDS_ValidateFailed: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 223 | wsString = L"%s validation failed"; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 224 | return; |
| 225 | case XFA_IDS_CalcOverride: |
| 226 | wsString = L"Calculate Override"; |
| 227 | return; |
| 228 | case XFA_IDS_ModifyField: |
| 229 | wsString = L"Are you sure you want to modify this field?"; |
| 230 | return; |
| 231 | case XFA_IDS_NotModifyField: |
| 232 | wsString = L"You are not allowed to modify this field."; |
| 233 | return; |
| 234 | case XFA_IDS_AppName: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 235 | wsString = L"pdfium"; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 236 | return; |
| 237 | case XFA_IDS_Unable_TO_SET: |
| 238 | wsString = L"Unable to set "; |
| 239 | return; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 240 | case XFA_IDS_INVAlID_PROP_SET: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 241 | wsString = L"Invalid property set operation."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 242 | return; |
| 243 | case XFA_IDS_NOT_DEFAUL_VALUE: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 244 | wsString = L" doesn't have a default property."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 245 | return; |
| 246 | case XFA_IDS_UNABLE_SET_LANGUAGE: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 247 | wsString = L"Unable to set language value."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 248 | return; |
| 249 | case XFA_IDS_UNABLE_SET_NUMPAGES: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 250 | wsString = L"Unable to set numPages value."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 251 | return; |
| 252 | case XFA_IDS_UNABLE_SET_PLATFORM: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 253 | wsString = L"Unable to set platform value."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 254 | return; |
| 255 | case XFA_IDS_UNABLE_SET_VARIATION: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 256 | wsString = L"Unable to set variation value."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 257 | return; |
| 258 | case XFA_IDS_UNABLE_SET_VERSION: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 259 | wsString = L"Unable to set version value."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 260 | return; |
| 261 | case XFA_IDS_UNABLE_SET_READY: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 262 | wsString = L"Unable to set ready value."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 263 | return; |
| 264 | case XFA_IDS_COMPILER_ERROR: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 265 | wsString = L"Compiler error."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 266 | return; |
| 267 | case XFA_IDS_DIVIDE_ZERO: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 268 | wsString = L"Divide by zero."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 269 | return; |
| 270 | case XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT: |
| 271 | wsString = |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 272 | L"An attempt was made to reference property '%s' of a non-object in " |
| 273 | L"SOM expression %s."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 274 | return; |
| 275 | case XFA_IDS_INDEX_OUT_OF_BOUNDS: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 276 | wsString = L"Index value is out of bounds."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 277 | return; |
| 278 | case XFA_IDS_INCORRECT_NUMBER_OF_METHOD: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 279 | wsString = L"Incorrect number of parameters calling method '%s'."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 280 | return; |
| 281 | case XFA_IDS_ARGUMENT_MISMATCH: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 282 | wsString = L"Argument mismatch in property or function argument."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 283 | return; |
| 284 | case XFA_IDS_NOT_HAVE_PROPERTY: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 285 | wsString = L"'%s' doesn't have property '%s'."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 286 | return; |
| 287 | case XFA_IDS_VIOLATE_BOUNDARY: |
| 288 | wsString = |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 289 | L"The element [%s] has violated its allowable number of occurrences."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 290 | return; |
| 291 | case XFA_IDS_SERVER_DENY: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 292 | wsString = L"Server does not permit."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 293 | return; |
| 294 | case XFA_IDS_ValidateLimit: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 295 | wsString = |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 296 | L"Message limit exceeded. Remaining %d validation errors not " |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 297 | L"reported."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 298 | return; |
| 299 | case XFA_IDS_ValidateNullWarning: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 300 | wsString = |
| 301 | L"%s cannot be blank. To ignore validations for %s, click Ignore."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 302 | return; |
| 303 | case XFA_IDS_ValidateNullError: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 304 | wsString = L"%s cannot be blank."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 305 | return; |
| 306 | case XFA_IDS_ValidateWarning: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 307 | wsString = |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 308 | L"The value you entered for %s is invalid. To ignore validations for " |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 309 | L"%s, click Ignore."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 310 | return; |
| 311 | case XFA_IDS_ValidateError: |
dsinclair | 0e0a86a | 2016-06-01 18:56:51 -0700 | [diff] [blame] | 312 | wsString = L"The value you entered for %s is invalid."; |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 313 | return; |
| 314 | } |
| 315 | } |
| 316 | |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 317 | IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { |
thestig | 1cd352e | 2016-06-07 17:53:06 -0700 | [diff] [blame] | 318 | CXFA_FWLAdapterTimerMgr* pAdapter = nullptr; |
dsinclair | a282c73 | 2016-10-13 12:14:34 -0700 | [diff] [blame^] | 319 | CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); |
| 320 | if (pFormFillEnv) |
| 321 | pAdapter = new CXFA_FWLAdapterTimerMgr(pFormFillEnv); |
Lei Zhang | 9429368 | 2016-01-27 18:27:56 -0800 | [diff] [blame] | 322 | return pAdapter; |
| 323 | } |