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 "../../../public/fpdf_formfill.h" | 7 #include "../../../public/fpdf_formfill.h" |
8 #include "../../include/fsdk_define.h" | 8 #include "../../include/fsdk_define.h" |
9 #include "../../include/fsdk_mgr.h" | 9 #include "../../include/fsdk_mgr.h" |
10 #include "../../include/fpdfxfa/fpdfxfa_doc.h" | 10 #include "../../include/fpdfxfa/fpdfxfa_doc.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 void CPDFXFA_App::Beep(FX_DWORD dwType) | 172 void CPDFXFA_App::Beep(FX_DWORD dwType) |
173 { | 173 { |
174 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 174 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
175 if (pEnv) | 175 if (pEnv) |
176 { | 176 { |
177 pEnv->JS_appBeep(dwType); | 177 pEnv->JS_appBeep(dwType); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 FX_INT32 CPDFXFA_App::MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle, FX_DWORD dwIcon
Type, FX_DWORD dwButtonType) | 181 int32_t CPDFXFA_App::MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle, FX_DWORD dwIconT
ype, FX_DWORD dwButtonType) |
182 { | 182 { |
183 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 183 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
184 if (!pEnv) | 184 if (!pEnv) |
185 return -1; | 185 return -1; |
186 | 186 |
187 FX_DWORD iconType = 0; | 187 FX_DWORD iconType = 0; |
188 int iButtonType = 0; | 188 int iButtonType = 0; |
189 switch (dwIconType) | 189 switch (dwIconType) |
190 { | 190 { |
191 case XFA_MBICON_Error: | 191 case XFA_MBICON_Error: |
(...skipping 17 matching lines...) Expand all Loading... |
209 case XFA_MB_OKCancel: | 209 case XFA_MB_OKCancel: |
210 iButtonType |= 1; | 210 iButtonType |= 1; |
211 break; | 211 break; |
212 case XFA_MB_YesNo: | 212 case XFA_MB_YesNo: |
213 iButtonType |= 2; | 213 iButtonType |= 2; |
214 break; | 214 break; |
215 case XFA_MB_YesNoCancel: | 215 case XFA_MB_YesNoCancel: |
216 iButtonType |= 3; | 216 iButtonType |= 3; |
217 break; | 217 break; |
218 } | 218 } |
219 FX_INT32 iRet = pEnv->JS_appAlert(wsMessage.GetPtr(), wsTitle.GetPtr(), iBut
tonType, iconType); | 219 int32_t iRet = pEnv->JS_appAlert(wsMessage.GetPtr(), wsTitle.GetPtr(), iButt
onType, iconType); |
220 switch (iRet) | 220 switch (iRet) |
221 { | 221 { |
222 case 1: | 222 case 1: |
223 return XFA_IDOK; | 223 return XFA_IDOK; |
224 case 2: | 224 case 2: |
225 return XFA_IDCancel; | 225 return XFA_IDCancel; |
226 case 3: | 226 case 3: |
227 return XFA_IDNo; | 227 return XFA_IDNo; |
228 case 4: | 228 case 4: |
229 return XFA_IDYes; | 229 return XFA_IDYes; |
(...skipping 13 matching lines...) Expand all Loading... |
243 { | 243 { |
244 nLength = nLength>2046?2046:nLength; | 244 nLength = nLength>2046?2046:nLength; |
245 pBuff[nLength] = 0; | 245 pBuff[nLength] = 0; |
246 pBuff[nLength+1] = 0; | 246 pBuff[nLength+1] = 0; |
247 wsAnswer = CFX_WideString::FromUTF16LE((unsigned short*)pBuff, nLeng
th); | 247 wsAnswer = CFX_WideString::FromUTF16LE((unsigned short*)pBuff, nLeng
th); |
248 } | 248 } |
249 delete[] pBuff; | 249 delete[] pBuff; |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 FX_INT32 CPDFXFA_App::GetCurDocumentInBatch() | 253 int32_t CPDFXFA_App::GetCurDocumentInBatch() |
254 { | 254 { |
255 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 255 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
256 if (pEnv) | 256 if (pEnv) |
257 { | 257 { |
258 return pEnv->FFI_GetCurDocument(); | 258 return pEnv->FFI_GetCurDocument(); |
259 } | 259 } |
260 return 0; | 260 return 0; |
261 } | 261 } |
262 | 262 |
263 FX_INT32 CPDFXFA_App::GetDocumentCountInBatch() | 263 int32_t CPDFXFA_App::GetDocumentCountInBatch() |
264 { | 264 { |
265 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 265 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
266 if (pEnv) | 266 if (pEnv) |
267 { | 267 { |
268 return pEnv->FFI_GetDocumentCount(); | 268 return pEnv->FFI_GetDocumentCount(); |
269 } | 269 } |
270 | 270 |
271 return 0; | 271 return 0; |
272 } | 272 } |
273 | 273 |
(...skipping 22 matching lines...) Expand all Loading... |
296 FX_BOOL CPDFXFA_App::PutRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_WSTR wsEnco
de) | 296 FX_BOOL CPDFXFA_App::PutRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_WSTR wsEnco
de) |
297 { | 297 { |
298 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 298 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
299 if (pEnv) | 299 if (pEnv) |
300 { | 300 { |
301 return pEnv->FFI_PutRequestURL(wsURL.GetPtr(), wsData.GetPtr(), wsEncode
.GetPtr()); | 301 return pEnv->FFI_PutRequestURL(wsURL.GetPtr(), wsData.GetPtr(), wsEncode
.GetPtr()); |
302 } | 302 } |
303 return FALSE; | 303 return FALSE; |
304 } | 304 } |
305 | 305 |
306 void CPDFXFA_App::LoadString(FX_INT32 iStringID, CFX_WideString &wsString) | 306 void CPDFXFA_App::LoadString(int32_t iStringID, CFX_WideString &wsString) |
307 { | 307 { |
308 switch (iStringID) | 308 switch (iStringID) |
309 { | 309 { |
310 case XFA_IDS_ValidateFailed: | 310 case XFA_IDS_ValidateFailed: |
311 wsString = L"%s validate failed"; | 311 wsString = L"%s validate failed"; |
312 return; | 312 return; |
313 case XFA_IDS_CalcOverride: | 313 case XFA_IDS_CalcOverride: |
314 wsString = L"Calculate Override"; | 314 wsString = L"Calculate Override"; |
315 return; | 315 return; |
316 case XFA_IDS_ModifyField: | 316 case XFA_IDS_ModifyField: |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 551 } |
552 | 552 |
553 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() | 553 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() |
554 { | 554 { |
555 CXFA_FWLAdapterTimerMgr* pAdapter = NULL; | 555 CXFA_FWLAdapterTimerMgr* pAdapter = NULL; |
556 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 556 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
557 if (pEnv) | 557 if (pEnv) |
558 pAdapter = FX_NEW CXFA_FWLAdapterTimerMgr(pEnv); | 558 pAdapter = FX_NEW CXFA_FWLAdapterTimerMgr(pEnv); |
559 return pAdapter; | 559 return pAdapter; |
560 } | 560 } |
OLD | NEW |