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 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" |
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" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 const CFX_WideString& wsEncode) { | 248 const CFX_WideString& wsEncode) { |
249 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 249 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
250 return pEnv && | 250 return pEnv && |
251 pEnv->FFI_PutRequestURL(wsURL.c_str(), wsData.c_str(), | 251 pEnv->FFI_PutRequestURL(wsURL.c_str(), wsData.c_str(), |
252 wsEncode.c_str()); | 252 wsEncode.c_str()); |
253 } | 253 } |
254 | 254 |
255 void CPDFXFA_App::LoadString(int32_t iStringID, CFX_WideString& wsString) { | 255 void CPDFXFA_App::LoadString(int32_t iStringID, CFX_WideString& wsString) { |
256 switch (iStringID) { | 256 switch (iStringID) { |
257 case XFA_IDS_ValidateFailed: | 257 case XFA_IDS_ValidateFailed: |
258 wsString = L"%s validate failed"; | 258 wsString = L"%s validation failed"; |
259 return; | 259 return; |
260 case XFA_IDS_CalcOverride: | 260 case XFA_IDS_CalcOverride: |
261 wsString = L"Calculate Override"; | 261 wsString = L"Calculate Override"; |
262 return; | 262 return; |
263 case XFA_IDS_ModifyField: | 263 case XFA_IDS_ModifyField: |
264 wsString = L"Are you sure you want to modify this field?"; | 264 wsString = L"Are you sure you want to modify this field?"; |
265 return; | 265 return; |
266 case XFA_IDS_NotModifyField: | 266 case XFA_IDS_NotModifyField: |
267 wsString = L"You are not allowed to modify this field."; | 267 wsString = L"You are not allowed to modify this field."; |
268 return; | 268 return; |
269 case XFA_IDS_AppName: | 269 case XFA_IDS_AppName: |
270 wsString = L"Foxit"; | 270 wsString = L"pdfium"; |
271 return; | |
272 case XFA_IDS_ImageFilter: | |
273 wsString = | |
274 L"Image " | |
275 L"Files(*.bmp;*.jpg;*.png;*.gif;*.tif)|*.bmp;*.jpg;*.png;*.gif;*.tif|" | |
276 L"All Files(*.*)|*.*||"; | |
277 return; | |
278 case XFA_IDS_UNKNOW_CATCHED: | |
279 wsString = L"unknown error is catched!"; | |
280 return; | 271 return; |
281 case XFA_IDS_Unable_TO_SET: | 272 case XFA_IDS_Unable_TO_SET: |
282 wsString = L"Unable to set "; | 273 wsString = L"Unable to set "; |
283 return; | 274 return; |
284 case XFA_IDS_VALUE_EXCALMATORY: | |
285 wsString = L" value!"; | |
286 return; | |
287 case XFA_IDS_INVALID_ENUM_VALUE: | |
288 wsString = L"Invalid enumerated value: "; | |
289 return; | |
290 case XFA_IDS_UNSUPPORT_METHOD: | |
291 wsString = L"unsupport %s method."; | |
292 return; | |
293 case XFA_IDS_UNSUPPORT_PROP: | |
294 wsString = L"unsupport %s property."; | |
295 return; | |
296 case XFA_IDS_INVAlID_PROP_SET: | 275 case XFA_IDS_INVAlID_PROP_SET: |
297 wsString = L"Invalid property set operation;"; | 276 wsString = L"Invalid property set operation."; |
298 return; | 277 return; |
299 case XFA_IDS_NOT_DEFAUL_VALUE: | 278 case XFA_IDS_NOT_DEFAUL_VALUE: |
300 wsString = L" doesn't have a default property"; | 279 wsString = L" doesn't have a default property."; |
301 return; | 280 return; |
302 case XFA_IDS_UNABLE_SET_LANGUAGE: | 281 case XFA_IDS_UNABLE_SET_LANGUAGE: |
303 wsString = L"Unable to set language value!"; | 282 wsString = L"Unable to set language value."; |
304 return; | 283 return; |
305 case XFA_IDS_UNABLE_SET_NUMPAGES: | 284 case XFA_IDS_UNABLE_SET_NUMPAGES: |
306 wsString = L"Unable to set numPages value!"; | 285 wsString = L"Unable to set numPages value."; |
307 return; | 286 return; |
308 case XFA_IDS_UNABLE_SET_PLATFORM: | 287 case XFA_IDS_UNABLE_SET_PLATFORM: |
309 wsString = L"Unable to set platform value!"; | 288 wsString = L"Unable to set platform value."; |
310 return; | |
311 case XFA_IDS_UNABLE_SET_VALIDATIONENABLE: | |
312 wsString = L"Unable to set validationsEnabled value!"; | |
313 return; | 289 return; |
314 case XFA_IDS_UNABLE_SET_VARIATION: | 290 case XFA_IDS_UNABLE_SET_VARIATION: |
315 wsString = L"Unable to set variation value!"; | 291 wsString = L"Unable to set variation value."; |
316 return; | 292 return; |
317 case XFA_IDS_UNABLE_SET_VERSION: | 293 case XFA_IDS_UNABLE_SET_VERSION: |
318 wsString = L"Unable to set version value!"; | 294 wsString = L"Unable to set version value."; |
319 return; | 295 return; |
320 case XFA_IDS_UNABLE_SET_READY: | 296 case XFA_IDS_UNABLE_SET_READY: |
321 wsString = L"Unable to set ready value!"; | 297 wsString = L"Unable to set ready value."; |
322 return; | |
323 case XFA_IDS_NUMBER_OF_OCCUR: | |
324 wsString = | |
325 L"The element [%s] has violated its allowable number of occurrences"; | |
326 return; | |
327 case XFA_IDS_UNABLE_SET_CLASS_NAME: | |
328 wsString = L"Unable to set className value!"; | |
329 return; | |
330 case XFA_IDS_UNABLE_SET_LENGTH_VALUE: | |
331 wsString = L"Unable to set length value!"; | |
332 return; | |
333 case XFA_IDS_UNSUPPORT_CHAR: | |
334 wsString = L"unsupported char '%c'"; | |
335 return; | |
336 case XFA_IDS_BAD_SUFFIX: | |
337 wsString = L"bad suffix on number"; | |
338 return; | |
339 case XFA_IDS_EXPECTED_IDENT: | |
340 wsString = L"expected identifier instead of '%s'"; | |
341 return; | |
342 case XFA_IDS_EXPECTED_STRING: | |
343 wsString = L"expected '%s' instead of '%s'"; | |
344 return; | |
345 case XFA_IDS_INVALIDATE_CHAR: | |
346 wsString = L"invalidate char '%c'"; | |
347 return; | |
348 case XFA_IDS_REDEFINITION: | |
349 wsString = L"'%s' redefinition "; | |
350 return; | |
351 case XFA_IDS_INVALIDATE_TOKEN: | |
352 wsString = L"invalidate token '%s'"; | |
353 return; | |
354 case XFA_IDS_INVALIDATE_EXPRESSION: | |
355 wsString = L"invalidate expression '%s'"; | |
356 return; | |
357 case XFA_IDS_UNDEFINE_IDENTIFIER: | |
358 wsString = L"undefined identifier '%s'"; | |
359 return; | |
360 case XFA_IDS_INVALIDATE_LEFTVALUE: | |
361 wsString = L"invalidate left-value '%s'"; | |
362 return; | 298 return; |
363 case XFA_IDS_COMPILER_ERROR: | 299 case XFA_IDS_COMPILER_ERROR: |
364 wsString = L"compiler error"; | 300 wsString = L"Compiler error."; |
365 return; | |
366 case XFA_IDS_CANNOT_MODIFY_VALUE: | |
367 wsString = L"can't modify the '%s' value"; | |
368 return; | |
369 case XFA_IDS_ERROR_PARAMETERS: | |
370 wsString = L"function '%s' has not %d parameters"; | |
371 return; | |
372 case XFA_IDS_EXPECT_ENDIF: | |
373 wsString = L"expected 'endif' instead of '%s'"; | |
374 return; | |
375 case XFA_IDS_UNEXPECTED_EXPRESSION: | |
376 wsString = L"unexpected expression '%s'"; | |
377 return; | |
378 case XFA_IDS_CONDITION_IS_NULL: | |
379 wsString = L"condition is null"; | |
380 return; | |
381 case XFA_IDS_ILLEGALBREAK: | |
382 wsString = L"illegal break"; | |
383 return; | |
384 case XFA_IDS_ILLEGALCONTINUE: | |
385 wsString = L"illegal continue"; | |
386 return; | |
387 case XFA_IDS_EXPECTED_OPERATOR: | |
388 wsString = L"expected operator '%s' instead of '%s'"; | |
389 return; | 301 return; |
390 case XFA_IDS_DIVIDE_ZERO: | 302 case XFA_IDS_DIVIDE_ZERO: |
391 wsString = L"divide by zero"; | 303 wsString = L"Divide by zero."; |
392 return; | |
393 case XFA_IDS_CANNOT_COVERT_OBJECT: | |
394 wsString = L"%s.%s can not covert to object"; | |
395 return; | |
396 case XFA_IDS_NOT_FOUND_CONTAINER: | |
397 wsString = L"can not found container '%s'"; | |
398 return; | |
399 case XFA_IDS_NOT_FOUND_PROPERTY: | |
400 wsString = L"can not found property '%s'"; | |
401 return; | |
402 case XFA_IDS_NOT_FOUND_METHOD: | |
403 wsString = L"can not found method '%s'"; | |
404 return; | |
405 case XFA_IDS_NOT_FOUND_CONST: | |
406 wsString = L"can not found const '%s'"; | |
407 return; | |
408 case XFA_IDS_NOT_ASSIGN_OBJECT: | |
409 wsString = L"can not direct assign value to object"; | |
410 return; | |
411 case XFA_IDS_IVALIDATE_INSTRUCTION: | |
412 wsString = L"invalidate instruction"; | |
413 return; | |
414 case XFA_IDS_EXPECT_NUMBER: | |
415 wsString = L"expected number instead of '%s'"; | |
416 return; | |
417 case XFA_IDS_VALIDATE_OUT_ARRAY: | |
418 wsString = L"validate access index '%s' out of array"; | |
419 return; | |
420 case XFA_IDS_CANNOT_ASSIGN_IDENT: | |
421 wsString = L"can not assign to %s"; | |
422 return; | |
423 case XFA_IDS_NOT_FOUNT_FUNCTION: | |
424 wsString = L"can not found '%s' function"; | |
425 return; | |
426 case XFA_IDS_NOT_ARRAY: | |
427 wsString = L"'%s' doesn't an array"; | |
428 return; | |
429 case XFA_IDS_OUT_ARRAY: | |
430 wsString = L"out of range of '%s' array"; | |
431 return; | |
432 case XFA_IDS_NOT_SUPPORT_CALC: | |
433 wsString = L"'%s' operator can not support array calculate"; | |
434 return; | |
435 case XFA_IDS_ARGUMENT_NOT_ARRAY: | |
436 wsString = L"'%s' function's %d argument can not be array"; | |
437 return; | |
438 case XFA_IDS_ARGUMENT_EXPECT_CONTAINER: | |
439 wsString = L"'%s' argument expected a container"; | |
440 return; | 304 return; |
441 case XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT: | 305 case XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT: |
442 wsString = | 306 wsString = |
443 L"an attempt was made to reference property '%s' of a non-object in " | 307 L"An attempt was made to reference property '%s' of a non-object in " |
444 L"SOM expression %s"; | 308 L"SOM expression %s."; |
445 return; | |
446 case XFA_IDS_FUNCTION_IS_BUILDIN: | |
447 wsString = L"function '%s' is buildin"; | |
448 return; | |
449 case XFA_IDS_ERROR_MSG: | |
450 wsString = L"%s : %s"; | |
451 return; | 309 return; |
452 case XFA_IDS_INDEX_OUT_OF_BOUNDS: | 310 case XFA_IDS_INDEX_OUT_OF_BOUNDS: |
453 wsString = L"Index value is out of bounds"; | 311 wsString = L"Index value is out of bounds."; |
454 return; | 312 return; |
455 case XFA_IDS_INCORRECT_NUMBER_OF_METHOD: | 313 case XFA_IDS_INCORRECT_NUMBER_OF_METHOD: |
456 wsString = L"Incorrect number of parameters calling method '%s'"; | 314 wsString = L"Incorrect number of parameters calling method '%s'."; |
457 return; | 315 return; |
458 case XFA_IDS_ARGUMENT_MISMATCH: | 316 case XFA_IDS_ARGUMENT_MISMATCH: |
459 wsString = L"Argument mismatch in property or function argument"; | 317 wsString = L"Argument mismatch in property or function argument."; |
460 return; | |
461 case XFA_IDS_INVALID_ENUMERATE: | |
462 wsString = L"Invalid enumerated value: %s"; | |
463 return; | |
464 case XFA_IDS_INVALID_APPEND: | |
465 wsString = | |
466 L"Invalid append operation: %s cannot have a child element of %s"; | |
467 return; | |
468 case XFA_IDS_SOM_EXPECTED_LIST: | |
469 wsString = | |
470 L"SOM expression returned list when single result was expected"; | |
471 return; | 318 return; |
472 case XFA_IDS_NOT_HAVE_PROPERTY: | 319 case XFA_IDS_NOT_HAVE_PROPERTY: |
473 wsString = L"'%s' doesn't have property '%s'"; | 320 wsString = L"'%s' doesn't have property '%s'."; |
474 return; | |
475 case XFA_IDS_INVALID_NODE_TYPE: | |
476 wsString = L"Invalid node type : '%s'"; | |
477 return; | 321 return; |
478 case XFA_IDS_VIOLATE_BOUNDARY: | 322 case XFA_IDS_VIOLATE_BOUNDARY: |
479 wsString = | 323 wsString = |
480 L"The element [%s] has violated its allowable number of occurrences"; | 324 L"The element [%s] has violated its allowable number of occurrences."; |
481 return; | 325 return; |
482 case XFA_IDS_SERVER_DENY: | 326 case XFA_IDS_SERVER_DENY: |
483 wsString = L"Server does not permit"; | 327 wsString = L"Server does not permit."; |
484 return; | 328 return; |
485 case XFA_IDS_ValidateLimit: | 329 case XFA_IDS_ValidateLimit: |
486 wsString = FX_WSTRC( | 330 wsString = |
487 L"Message limit exceeded. Remaining %d validation errors not " | 331 L"Message limit exceeded. Remaining %d validation errors not " |
488 L"reported."); | 332 L"reported."; |
489 return; | 333 return; |
490 case XFA_IDS_ValidateNullWarning: | 334 case XFA_IDS_ValidateNullWarning: |
491 wsString = FX_WSTRC( | 335 wsString = |
492 L"%s cannot be left blank. To ignore validations for %s, click " | 336 L"%s cannot be blank. To ignore validations for %s, click Ignore."; |
493 L"Ignore."); | |
494 return; | 337 return; |
495 case XFA_IDS_ValidateNullError: | 338 case XFA_IDS_ValidateNullError: |
496 wsString = FX_WSTRC(L"%s cannot be left blank."); | 339 wsString = L"%s cannot be blank."; |
497 return; | 340 return; |
498 case XFA_IDS_ValidateWarning: | 341 case XFA_IDS_ValidateWarning: |
499 wsString = FX_WSTRC( | 342 wsString = |
500 L"The value you entered for %s is invalid. To ignore validations for " | 343 L"The value you entered for %s is invalid. To ignore validations for " |
501 L"%s, click Ignore."); | 344 L"%s, click Ignore."; |
502 return; | 345 return; |
503 case XFA_IDS_ValidateError: | 346 case XFA_IDS_ValidateError: |
504 wsString = FX_WSTRC(L"The value you entered for %s is invalid."); | 347 wsString = L"The value you entered for %s is invalid."; |
505 return; | 348 return; |
506 } | 349 } |
507 } | 350 } |
508 | 351 |
509 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { | 352 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { |
510 CXFA_FWLAdapterTimerMgr* pAdapter = NULL; | 353 CXFA_FWLAdapterTimerMgr* pAdapter = NULL; |
511 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); | 354 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); |
512 if (pEnv) | 355 if (pEnv) |
513 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); | 356 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); |
514 return pAdapter; | 357 return pAdapter; |
515 } | 358 } |
OLD | NEW |