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_MGR_H | 7 #ifndef _FPDFSDK_MGR_H |
8 #define _FPDFSDK_MGR_H | 8 #define _FPDFSDK_MGR_H |
9 | 9 |
10 #include "fsdk_common.h" | 10 #include "fsdk_common.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 class CJS_RuntimeFactory; | 32 class CJS_RuntimeFactory; |
33 | 33 |
34 #include "javascript/IJavaScript.h" | 34 #include "javascript/IJavaScript.h" |
35 | 35 |
36 class CPDFDoc_Environment FX_FINAL | 36 class CPDFDoc_Environment FX_FINAL |
37 { | 37 { |
38 public: | 38 public: |
39 CPDFDoc_Environment(CPDFXFA_Document * pDoc); | 39 CPDFDoc_Environment(CPDFXFA_Document * pDoc); |
40 ~CPDFDoc_Environment(); | 40 ~CPDFDoc_Environment(); |
41 | 41 |
42 » int RegAppHandle(FPDF_FORMFILLINFO* pFFinfo);//{ m_pInfo = pFFinfo; ret
urn TRUE;} | 42 » int RegAppHandle(FPDF_FORMFILLINFO* pFFinfo); |
43 | 43 |
44 virtual void Release() | 44 virtual void Release() |
45 { | 45 { |
46 if (m_pInfo && m_pInfo->Release) | 46 if (m_pInfo && m_pInfo->Release) |
47 m_pInfo->Release(m_pInfo); | 47 m_pInfo->Release(m_pInfo); |
48 delete this; | 48 delete this; |
49 } | 49 } |
50 void FFI_Invalidate(FPDF_PAGE page, double left, double top, double righ
t, double bottom) | 50 void FFI_Invalidate(FPDF_PAGE page, double left, double top, double righ
t, double bottom) |
51 { | 51 { |
52 if (m_pInfo && m_pInfo->FFI_Invalidate) | 52 if (m_pInfo && m_pInfo->FFI_Invalidate) |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 return L""; | 673 return L""; |
674 } | 674 } |
675 CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen)
; | 675 CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen)
; |
676 CFX_WideString wsRet = CFX_WideString::FromUTF16LE((unsi
gned short*)bsRet.GetBuffer(bsRet.GetLength()), bsRet.GetLength()/sizeof(unsigne
d short)); | 676 CFX_WideString wsRet = CFX_WideString::FromUTF16LE((unsi
gned short*)bsRet.GetBuffer(bsRet.GetLength()), bsRet.GetLength()/sizeof(unsigne
d short)); |
677 delete[] pbuff; | 677 delete[] pbuff; |
678 return wsRet; | 678 return wsRet; |
679 } | 679 } |
680 return L""; | 680 return L""; |
681 } | 681 } |
682 | 682 |
683 public: | |
684 FX_BOOL IsJSInitiated(); | 683 FX_BOOL IsJSInitiated(); |
685 | 684 |
686 public: | |
687 void SetCurrentDoc(CPDFSDK_Document* pFXDoc)
{m_pSDKDoc = pFXDoc;} | 685 void SetCurrentDoc(CPDFSDK_Document* pFXDoc)
{m_pSDKDoc = pFXDoc;} |
688 CPDFSDK_Document* GetCurrentDoc(); | 686 CPDFSDK_Document* GetCurrentDoc(); |
689 CPDFXFA_Document* GetPDFXFADocument() {return m_pDoc;} | 687 CPDFXFA_Document* GetPDFXFADocument() {return m_pDoc;} |
690 // CPDFSDK_Document* GetDocument(int nIndex); | |
691 // int CountDocuments() {return m_docMa
p.GetCount();} | |
692 | |
693 CPDFSDK_Document* OpenDocument(CFX_WideString &fileName){r
eturn NULL;} | |
694 CPDFSDK_Document* OpenMemPDFDoc(CPDF_Document* pNewDoc, CF
X_WideString &fileName){return NULL;} | |
695 | |
696 | 688 |
697 CFX_ByteString GetAppName() {return "";} | 689 CFX_ByteString GetAppName() {return "";} |
698 | 690 |
699 CFFL_IFormFiller* GetIFormFiller(); | 691 CFFL_IFormFiller* GetIFormFiller(); |
700 IFX_SystemHandler* GetSysHandler() {return m_pSysHandler;} | 692 IFX_SystemHandler* GetSysHandler() {return m_pSysHandler;} |
701 | 693 |
702 public: | |
703 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); | 694 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); |
704 IFXJS_Runtime* GetJSRuntime(); | 695 IFXJS_Runtime* GetJSRuntime(); |
705 CPDFSDK_ActionHandler* GetActionHander(); | 696 CPDFSDK_ActionHandler* GetActionHander(); |
| 697 FPDF_FORMFILLINFO* GetFormFillInfo() {return m_pInfo;} |
| 698 |
706 private: | 699 private: |
707 CPDFSDK_AnnotHandlerMgr* m_pAnnotHandlerMgr; | 700 CPDFSDK_AnnotHandlerMgr* m_pAnnotHandlerMgr; |
708 CPDFSDK_ActionHandler* m_pActionHandler; | 701 CPDFSDK_ActionHandler* m_pActionHandler; |
709 IFXJS_Runtime* m_pJSRuntime; | 702 IFXJS_Runtime* m_pJSRuntime; |
710 public: | |
711 FPDF_FORMFILLINFO* GetFormFillInfo() {return m_pInfo;} | |
712 private: | |
713 FPDF_FORMFILLINFO* m_pInfo; | 703 FPDF_FORMFILLINFO* m_pInfo; |
714 // CFX_MapPtrTemplate<CPDF_Document*, CPDFSDK_Document*> m_docMap; | |
715 CPDFSDK_Document* m_pSDKDoc; | 704 CPDFSDK_Document* m_pSDKDoc; |
716 CPDFXFA_Document* m_pDoc; | 705 CPDFXFA_Document* m_pDoc; |
717 | 706 |
718 CFFL_IFormFiller* m_pIFormFiller; | 707 CFFL_IFormFiller* m_pIFormFiller; |
719 IFX_SystemHandler* m_pSysHandler; | 708 IFX_SystemHandler* m_pSysHandler; |
720 | 709 |
721 public: | 710 public: |
722 //CJS_RuntimeFactory* m_pJSRuntimeFactory; | 711 //CJS_RuntimeFactory* m_pJSRuntimeFactory; |
723 }; | 712 }; |
724 | 713 |
725 | 714 |
726 | 715 |
727 // class CFX_App | |
728 // { | |
729 // public: | |
730 // CFX_App():m_pCurDoc(NULL) {} | |
731 // void SetAt(CPDF_Document* pPDFDoc, CPDFSDK_Document* pFXDoc); | |
732 // CPDFSDK_Document* GetAt(CPDF_Document* pPDFDoc); | |
733 // public: | |
734 // void SetCurrentDocument(CPDFSDK_Document* pFXDoc) {m_pCurDoc = pFXDoc;} | |
735 // CPDFSDK_Document* GetCurrentDocument() {return m_pCurDoc;} | |
736 // private: | |
737 // CFX_MapPtrTemplate<CPDF_Document*, CPDFSDK_Document*> m_docArray; | |
738 // CPDFSDK_Document* m_pCurDoc; | |
739 // }; | |
740 class CPDFSDK_InterForm; | 716 class CPDFSDK_InterForm; |
741 class CPDFSDK_Document | 717 class CPDFSDK_Document |
742 { | 718 { |
743 public: | 719 public: |
744 CPDFSDK_Document(CPDFXFA_Document* pDoc, CPDFDoc_Environment* pEnv); | 720 CPDFSDK_Document(CPDFXFA_Document* pDoc, CPDFDoc_Environment* pEnv); |
745 ~CPDFSDK_Document(); | 721 ~CPDFSDK_Document(); |
746 public: | 722 |
747 CPDFSDK_InterForm* GetInterForm() ; | 723 CPDFSDK_InterForm* GetInterForm() ; |
748 CPDFXFA_Document* GetDocument() {return m_pDoc;} | 724 CPDFXFA_Document* GetDocument() {return m_pDoc;} |
749 | 725 |
750 public: | |
751 void InitPageView(); | 726 void InitPageView(); |
752 int GetPageViewCount(){retur
n m_pageMap.GetCount();} | 727 int GetPageViewCount(){retur
n m_pageMap.GetCount();} |
753 void AddPageView(CPDFXFA_Page* pPDFXF
APage, CPDFSDK_PageView* pPageView); | 728 void AddPageView(CPDFXFA_Page* pPDFXF
APage, CPDFSDK_PageView* pPageView); |
754 CPDFSDK_PageView* GetPageView(CPDFXFA_Page* pPDFXFAPage, F
X_BOOL ReNew = TRUE); | 729 CPDFSDK_PageView* GetPageView(CPDFXFA_Page* pPDFXFAPage, F
X_BOOL ReNew = TRUE); |
755 CPDFSDK_PageView* GetPageView(int nIndex); | 730 CPDFSDK_PageView* GetPageView(int nIndex); |
756 CPDFSDK_PageView* GetCurrentView(); | 731 CPDFSDK_PageView* GetCurrentView(); |
757 void ReMovePageView(CPDFXFA_Page* pPD
FPage); | 732 void ReMovePageView(CPDFXFA_Page* pPD
FPage); |
758 void UpdateAllViews(CPDFSDK_PageView*
pSender, CPDFSDK_Annot* pAnnot); | 733 void UpdateAllViews(CPDFSDK_PageView*
pSender, CPDFSDK_Annot* pAnnot); |
759 | 734 |
760 » CPDFSDK_Annot*» » » GetFocusAnnot();//{return NULL;} | 735 » CPDFSDK_Annot*» » » GetFocusAnnot(); |
761 | 736 |
762 IFXJS_Runtime * GetJsRuntime(); | 737 IFXJS_Runtime * GetJsRuntime(); |
763 | 738 |
764 » FX_BOOL»» » » » SetFocusAnnot(CPDFSDK_Annot* pAn
not, FX_UINT nFlag = 0);//{return FALSE;} | 739 » FX_BOOL»» » » » SetFocusAnnot(CPDFSDK_Annot* pAn
not, FX_UINT nFlag = 0); |
765 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0
); | 740 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0
); |
766 | 741 |
767 FX_BOOL ExtractPages(const CFX_WordArray
&arrExtraPages, CPDF_Document* pDstDoc); | 742 FX_BOOL ExtractPages(const CFX_WordArray
&arrExtraPages, CPDF_Document* pDstDoc); |
768 FX_BOOL InsertPages(int nInsertAt, const
CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); | 743 FX_BOOL InsertPages(int nInsertAt, const
CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); |
769 FX_BOOL DeletePages(int nStart, int nCou
nt); | 744 FX_BOOL DeletePages(int nStart, int nCou
nt); |
770 FX_BOOL ReplacePages(int nPage, const CP
DF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); | 745 FX_BOOL ReplacePages(int nPage, const CP
DF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); |
771 | 746 |
772 void OnCloseDocument(); | 747 void OnCloseDocument(); |
773 | 748 |
774 int GetPageCount() {return m
_pDoc->GetPageCount();} | 749 int GetPageCount() {return m
_pDoc->GetPageCount();} |
775 FX_BOOL GetPermissions(int nFlag); | 750 FX_BOOL GetPermissions(int nFlag); |
776 FX_BOOL GetChangeMark() {return m_bChang
eMask;} | 751 FX_BOOL GetChangeMark() {return m_bChang
eMask;} |
777 void SetChangeMark() {m_bChangeMask =
TRUE;} | 752 void SetChangeMark() {m_bChangeMask =
TRUE;} |
778 void ClearChangeMark() {m_bChangeMask
= FALSE;} | 753 void ClearChangeMark() {m_bChangeMask
= FALSE;} |
779 // FX_BOOL GetChangeMark(){return FALSE;}//
IsAnnotModified()||IsFormModified() || IsWidgetModified()|| m_nChangeMark>0 ;} | |
780 // void ClearChangeMark(){} | |
781 CFX_WideString GetPath() ; | 754 CFX_WideString GetPath() ; |
782 CPDFXFA_Page* GetPage(int nIndex); | 755 CPDFXFA_Page* GetPage(int nIndex); |
783 CPDFDoc_Environment * GetEnv() {return m_pEnv; } | 756 CPDFDoc_Environment * GetEnv() {return m_pEnv; } |
784 void ProcJavascriptFun(); | 757 void ProcJavascriptFun(); |
785 FX_BOOL ProcOpenAction(); | 758 FX_BOOL ProcOpenAction(); |
786 CPDF_OCContext* GetOCContext(); | 759 CPDF_OCContext* GetOCContext(); |
787 private: | 760 private: |
788 //CFX_ArrayTemplate<CPDFSDK_PageView*> m_pageArray; | |
789 CFX_MapPtrTemplate<CPDFXFA_Page*, CPDFSDK_PageView*> m_pageMap; | 761 CFX_MapPtrTemplate<CPDFXFA_Page*, CPDFSDK_PageView*> m_pageMap; |
790 CPDFXFA_Document* m_pDoc; | 762 CPDFXFA_Document* m_pDoc; |
791 | |
792 CPDFSDK_InterForm* m_pInterForm; | 763 CPDFSDK_InterForm* m_pInterForm; |
793 CPDFSDK_Annot* m_pFocusAnnot; | 764 CPDFSDK_Annot* m_pFocusAnnot; |
794 CPDFDoc_Environment * m_pEnv; | 765 CPDFDoc_Environment * m_pEnv; |
795 CPDF_OCContext * m_pOccontent; | 766 CPDF_OCContext * m_pOccontent; |
796 FX_BOOL m_bChangeMask; | 767 FX_BOOL m_bChangeMask; |
797 }; | 768 }; |
798 | 769 |
799 class CPDFSDK_PageView FX_FINAL | 770 class CPDFSDK_PageView FX_FINAL |
800 { | 771 { |
801 public: | 772 public: |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 } | 910 } |
940 } | 911 } |
941 | 912 |
942 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); | 913 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); |
943 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); | 914 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); |
944 } | 915 } |
945 }; | 916 }; |
946 | 917 |
947 | 918 |
948 #endif //_FPDFSDK_MGR_H | 919 #endif //_FPDFSDK_MGR_H |
OLD | NEW |