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 #ifndef FPDFSDK_INCLUDE_FSDK_MGR_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_MGR_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
11 | 12 |
12 #include "core/include/fpdftext/fpdf_text.h" | 13 #include "core/include/fpdftext/fpdf_text.h" |
13 #include "fsdk_actionhandler.h" | 14 #include "fsdk_actionhandler.h" |
14 #include "fsdk_annothandler.h" | 15 #include "fsdk_annothandler.h" |
15 #include "fsdk_baseannot.h" | 16 #include "fsdk_baseannot.h" |
16 #include "fsdk_baseform.h" | 17 #include "fsdk_baseform.h" |
17 #include "fsdk_common.h" | 18 #include "fsdk_common.h" |
18 #include "fsdk_define.h" | 19 #include "fsdk_define.h" |
19 #include "fx_systemhandler.h" | 20 #include "fx_systemhandler.h" |
20 #include "javascript/IJavaScript.h" | 21 #include "javascript/IJavaScript.h" |
21 #include "public/fpdf_formfill.h" | 22 #include "public/fpdf_formfill.h" |
22 #include "public/fpdf_fwlevent.h" // cross platform keycode and events define. | 23 #include "public/fpdf_fwlevent.h" // cross platform keycode and events define. |
23 #include "third_party/base/nonstd_unique_ptr.h" | |
24 | 24 |
25 #ifdef PDF_ENABLE_XFA | 25 #ifdef PDF_ENABLE_XFA |
26 #include "fpdfxfa/fpdfxfa_doc.h" | 26 #include "fpdfxfa/fpdfxfa_doc.h" |
27 #include "fpdfxfa/fpdfxfa_page.h" | 27 #include "fpdfxfa/fpdfxfa_page.h" |
28 #endif // PDF_ENABLE_XFA | 28 #endif // PDF_ENABLE_XFA |
29 | 29 |
30 class CFFL_IFormFiller; | 30 class CFFL_IFormFiller; |
31 class CPDFSDK_ActionHandler; | 31 class CPDFSDK_ActionHandler; |
32 class CPDFSDK_Annot; | 32 class CPDFSDK_Annot; |
33 class CPDFSDK_Document; | 33 class CPDFSDK_Document; |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 CFX_ByteString GetAppName() const { return ""; } | 462 CFX_ByteString GetAppName() const { return ""; } |
463 IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } | 463 IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } |
464 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } | 464 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } |
465 | 465 |
466 CFFL_IFormFiller* GetIFormFiller(); // Creates if not present. | 466 CFFL_IFormFiller* GetIFormFiller(); // Creates if not present. |
467 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. | 467 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. |
468 IJS_Runtime* GetJSRuntime(); // Creates if not present. | 468 IJS_Runtime* GetJSRuntime(); // Creates if not present. |
469 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. | 469 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. |
470 | 470 |
471 private: | 471 private: |
472 nonstd::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; | 472 std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; |
473 nonstd::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; | 473 std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; |
474 nonstd::unique_ptr<IJS_Runtime> m_pJSRuntime; | 474 std::unique_ptr<IJS_Runtime> m_pJSRuntime; |
475 FPDF_FORMFILLINFO* const m_pInfo; | 475 FPDF_FORMFILLINFO* const m_pInfo; |
476 CPDFSDK_Document* m_pSDKDoc; | 476 CPDFSDK_Document* m_pSDKDoc; |
477 UnderlyingDocumentType* const m_pUnderlyingDoc; | 477 UnderlyingDocumentType* const m_pUnderlyingDoc; |
478 nonstd::unique_ptr<CFFL_IFormFiller> m_pIFormFiller; | 478 std::unique_ptr<CFFL_IFormFiller> m_pIFormFiller; |
479 nonstd::unique_ptr<IFX_SystemHandler> m_pSysHandler; | 479 std::unique_ptr<IFX_SystemHandler> m_pSysHandler; |
480 }; | 480 }; |
481 | 481 |
482 class CPDFSDK_Document { | 482 class CPDFSDK_Document { |
483 public: | 483 public: |
484 CPDFSDK_Document(UnderlyingDocumentType* pDoc, CPDFDoc_Environment* pEnv); | 484 CPDFSDK_Document(UnderlyingDocumentType* pDoc, CPDFDoc_Environment* pEnv); |
485 ~CPDFSDK_Document(); | 485 ~CPDFSDK_Document(); |
486 | 486 |
487 CPDFSDK_InterForm* GetInterForm(); | 487 CPDFSDK_InterForm* GetInterForm(); |
488 | 488 |
489 // Gets the document object for the next layer down; for master this is | 489 // Gets the document object for the next layer down; for master this is |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 CFX_WideString GetPath(); | 546 CFX_WideString GetPath(); |
547 UnderlyingPageType* GetPage(int nIndex); | 547 UnderlyingPageType* GetPage(int nIndex); |
548 CPDFDoc_Environment* GetEnv() { return m_pEnv; } | 548 CPDFDoc_Environment* GetEnv() { return m_pEnv; } |
549 void ProcJavascriptFun(); | 549 void ProcJavascriptFun(); |
550 FX_BOOL ProcOpenAction(); | 550 FX_BOOL ProcOpenAction(); |
551 CPDF_OCContext* GetOCContext(); | 551 CPDF_OCContext* GetOCContext(); |
552 | 552 |
553 private: | 553 private: |
554 std::map<UnderlyingPageType*, CPDFSDK_PageView*> m_pageMap; | 554 std::map<UnderlyingPageType*, CPDFSDK_PageView*> m_pageMap; |
555 UnderlyingDocumentType* m_pDoc; | 555 UnderlyingDocumentType* m_pDoc; |
556 nonstd::unique_ptr<CPDFSDK_InterForm> m_pInterForm; | 556 std::unique_ptr<CPDFSDK_InterForm> m_pInterForm; |
557 CPDFSDK_Annot* m_pFocusAnnot; | 557 CPDFSDK_Annot* m_pFocusAnnot; |
558 CPDFDoc_Environment* m_pEnv; | 558 CPDFDoc_Environment* m_pEnv; |
559 nonstd::unique_ptr<CPDF_OCContext> m_pOccontent; | 559 std::unique_ptr<CPDF_OCContext> m_pOccontent; |
560 FX_BOOL m_bChangeMask; | 560 FX_BOOL m_bChangeMask; |
561 FX_BOOL m_bBeingDestroyed; | 561 FX_BOOL m_bBeingDestroyed; |
562 }; | 562 }; |
563 class CPDFSDK_PageView final { | 563 class CPDFSDK_PageView final { |
564 public: | 564 public: |
565 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); | 565 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); |
566 ~CPDFSDK_PageView(); | 566 ~CPDFSDK_PageView(); |
567 | 567 |
568 #ifdef PDF_ENABLE_XFA | 568 #ifdef PDF_ENABLE_XFA |
569 void PageView_OnDraw(CFX_RenderDevice* pDevice, | 569 void PageView_OnDraw(CFX_RenderDevice* pDevice, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 #ifndef PDF_ENABLE_XFA | 642 #ifndef PDF_ENABLE_XFA |
643 void TakeOverPage() { m_bTakeOverPage = TRUE; } | 643 void TakeOverPage() { m_bTakeOverPage = TRUE; } |
644 #endif // PDF_ENABLE_XFA | 644 #endif // PDF_ENABLE_XFA |
645 | 645 |
646 private: | 646 private: |
647 void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, | 647 void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, |
648 CPDFSDK_Widget* pWidget); | 648 CPDFSDK_Widget* pWidget); |
649 | 649 |
650 CFX_Matrix m_curMatrix; | 650 CFX_Matrix m_curMatrix; |
651 UnderlyingPageType* m_page; | 651 UnderlyingPageType* m_page; |
652 nonstd::unique_ptr<CPDF_AnnotList> m_pAnnotList; | 652 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; |
653 std::vector<CPDFSDK_Annot*> m_fxAnnotArray; | 653 std::vector<CPDFSDK_Annot*> m_fxAnnotArray; |
654 CPDFSDK_Document* m_pSDKDoc; | 654 CPDFSDK_Document* m_pSDKDoc; |
655 #ifdef PDF_ENABLE_XFA | 655 #ifdef PDF_ENABLE_XFA |
656 CPDFSDK_Annot* m_CaptureWidget; | 656 CPDFSDK_Annot* m_CaptureWidget; |
657 #else // PDF_ENABLE_XFA | 657 #else // PDF_ENABLE_XFA |
658 CPDFSDK_Widget* m_CaptureWidget; | 658 CPDFSDK_Widget* m_CaptureWidget; |
659 FX_BOOL m_bTakeOverPage; | 659 FX_BOOL m_bTakeOverPage; |
660 #endif // PDF_ENABLE_XFA | 660 #endif // PDF_ENABLE_XFA |
661 FX_BOOL m_bEnterWidget; | 661 FX_BOOL m_bEnterWidget; |
662 FX_BOOL m_bExitWidget; | 662 FX_BOOL m_bExitWidget; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 } | 732 } |
733 | 733 |
734 if (nStartPos < m) | 734 if (nStartPos < m) |
735 QuickSort(nStartPos, m, bAscend, pCompare); | 735 QuickSort(nStartPos, m, bAscend, pCompare); |
736 if (nStopPos > m) | 736 if (nStopPos > m) |
737 QuickSort(m, nStopPos, bAscend, pCompare); | 737 QuickSort(m, nStopPos, bAscend, pCompare); |
738 } | 738 } |
739 }; | 739 }; |
740 | 740 |
741 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ | 741 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ |
OLD | NEW |