| 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/include/fsdk_actionhandler.h" | 7 #include "fpdfsdk/include/fsdk_actionhandler.h" |
| 8 #include "fpdfsdk/include/fsdk_define.h" | 8 #include "fpdfsdk/include/fsdk_define.h" |
| 9 #include "fpdfsdk/include/fsdk_mgr.h" | 9 #include "fpdfsdk/include/fsdk_mgr.h" |
| 10 #include "fpdfsdk/include/javascript/IJavaScript.h" | 10 #include "fpdfsdk/include/javascript/IJavaScript.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 } | 414 } |
| 415 } | 415 } |
| 416 | 416 |
| 417 FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument) { | 417 FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument) { |
| 418 ASSERT(pDocument); | 418 ASSERT(pDocument); |
| 419 return TRUE; | 419 return TRUE; |
| 420 } | 420 } |
| 421 | 421 |
| 422 void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument, | 422 void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument, |
| 423 const CPDF_Action& action) { | 423 const CPDF_Action& action) { |
| 424 ASSERT(action); | 424 ASSERT(action.GetDict()); |
| 425 | 425 |
| 426 CPDF_Document* pPDFDocument = pDocument->GetPDFDocument(); | 426 CPDF_Document* pPDFDocument = pDocument->GetPDFDocument(); |
| 427 ASSERT(pPDFDocument); | 427 ASSERT(pPDFDocument); |
| 428 | 428 |
| 429 CPDF_Dest MyDest = action.GetDest(pPDFDocument); | 429 CPDF_Dest MyDest = action.GetDest(pPDFDocument); |
| 430 int nPageIndex = MyDest.GetPageIndex(pPDFDocument); | 430 int nPageIndex = MyDest.GetPageIndex(pPDFDocument); |
| 431 int nFitType = MyDest.GetZoomMode(); | 431 int nFitType = MyDest.GetZoomMode(); |
| 432 const CPDF_Array* pMyArray = ToArray(MyDest.GetObject()); | 432 const CPDF_Array* pMyArray = ToArray(MyDest.GetObject()); |
| 433 float* pPosAry = nullptr; | 433 float* pPosAry = nullptr; |
| 434 int sizeOfAry = 0; | 434 int sizeOfAry = 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 447 } | 447 } |
| 448 | 448 |
| 449 void CPDFSDK_ActionHandler::DoAction_GoToR(CPDFSDK_Document* pDocument, | 449 void CPDFSDK_ActionHandler::DoAction_GoToR(CPDFSDK_Document* pDocument, |
| 450 const CPDF_Action& action) {} | 450 const CPDF_Action& action) {} |
| 451 | 451 |
| 452 void CPDFSDK_ActionHandler::DoAction_Launch(CPDFSDK_Document* pDocument, | 452 void CPDFSDK_ActionHandler::DoAction_Launch(CPDFSDK_Document* pDocument, |
| 453 const CPDF_Action& action) {} | 453 const CPDF_Action& action) {} |
| 454 | 454 |
| 455 void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument, | 455 void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument, |
| 456 const CPDF_Action& action) { | 456 const CPDF_Action& action) { |
| 457 ASSERT(action); | 457 ASSERT(action.GetDict()); |
| 458 | 458 |
| 459 CPDFDoc_Environment* pApp = pDocument->GetEnv(); | 459 CPDFDoc_Environment* pApp = pDocument->GetEnv(); |
| 460 CFX_ByteString sURI = action.GetURI(pDocument->GetPDFDocument()); | 460 CFX_ByteString sURI = action.GetURI(pDocument->GetPDFDocument()); |
| 461 pApp->FFI_DoURIAction(sURI.c_str()); | 461 pApp->FFI_DoURIAction(sURI.c_str()); |
| 462 } | 462 } |
| 463 | 463 |
| 464 void CPDFSDK_ActionHandler::DoAction_Named(CPDFSDK_Document* pDocument, | 464 void CPDFSDK_ActionHandler::DoAction_Named(CPDFSDK_Document* pDocument, |
| 465 const CPDF_Action& action) { | 465 const CPDF_Action& action) { |
| 466 ASSERT(action); | 466 ASSERT(action.GetDict()); |
| 467 | 467 |
| 468 CFX_ByteString csName = action.GetNamedAction(); | 468 CFX_ByteString csName = action.GetNamedAction(); |
| 469 pDocument->GetEnv()->FFI_ExecuteNamedAction(csName); | 469 pDocument->GetEnv()->FFI_ExecuteNamedAction(csName); |
| 470 } | 470 } |
| 471 | 471 |
| 472 void CPDFSDK_ActionHandler::DoAction_SetOCGState(CPDFSDK_Document* pDocument, | 472 void CPDFSDK_ActionHandler::DoAction_SetOCGState(CPDFSDK_Document* pDocument, |
| 473 const CPDF_Action& action) {} | 473 const CPDF_Action& action) {} |
| 474 | 474 |
| 475 void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument, | 475 void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument, |
| 476 CPDF_FormField* pFormField, | 476 CPDF_FormField* pFormField, |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 const CPDF_Action& action, | 627 const CPDF_Action& action, |
| 628 CPDFSDK_Document* pDocument) { | 628 CPDFSDK_Document* pDocument) { |
| 629 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); | 629 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); |
| 630 if (pInterForm->DoAction_ImportData(action)) { | 630 if (pInterForm->DoAction_ImportData(action)) { |
| 631 pDocument->SetChangeMark(); | 631 pDocument->SetChangeMark(); |
| 632 return TRUE; | 632 return TRUE; |
| 633 } | 633 } |
| 634 | 634 |
| 635 return FALSE; | 635 return FALSE; |
| 636 } | 636 } |
| OLD | NEW |