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_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_ | 7 #ifndef FPDFSDK_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_ |
8 #define FPDFSDK_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_ | 8 #define FPDFSDK_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_ |
9 | 9 |
10 #include "xfa/fxfa/include/xfa_ffdoc.h" | 10 #include "xfa/fxfa/include/xfa_ffdoc.h" |
11 | 11 |
12 #include <memory> | 12 #include <memory> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "public/fpdfview.h" | 15 #include "public/fpdfview.h" |
16 #include "xfa/fxfa/include/fxfa.h" | 16 #include "xfa/fxfa/include/fxfa.h" |
17 #include "xfa/fxfa/include/xfa_ffdochandler.h" | 17 #include "xfa/fxfa/include/xfa_ffdochandler.h" |
18 | 18 |
19 class CPDFXFA_App; | 19 class CPDFXFA_App; |
20 class CPDFXFA_Document; | 20 class CPDFXFA_Document; |
21 class CPDFXFA_Page; | 21 class CPDFXFA_Page; |
22 class CPDFSDK_Document; | 22 class CPDFSDK_Document; |
23 class CPDFDoc_Environment; | 23 class CPDFSDK_Environment; |
24 class IJS_Runtime; | 24 class IJS_Runtime; |
25 class IJS_Context; | 25 class IJS_Context; |
26 class CXFA_FFDocHandler; | 26 class CXFA_FFDocHandler; |
27 | 27 |
28 class CPDFXFA_Document : public IXFA_DocProvider { | 28 class CPDFXFA_Document : public IXFA_DocProvider { |
29 public: | 29 public: |
30 CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc, | 30 CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc, |
31 CPDFXFA_App* pProvider); | 31 CPDFXFA_App* pProvider); |
32 ~CPDFXFA_Document() override; | 32 ~CPDFXFA_Document() override; |
33 | 33 |
34 FX_BOOL LoadXFADoc(); | 34 FX_BOOL LoadXFADoc(); |
35 CPDFXFA_App* GetApp() { return m_pApp; } | 35 CPDFXFA_App* GetApp() { return m_pApp; } |
36 CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); } | 36 CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); } |
37 CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); } | 37 CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); } |
38 CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; } | 38 CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; } |
39 | 39 |
40 int GetPageCount(); | 40 int GetPageCount(); |
41 CPDFXFA_Page* GetPage(int page_index); | 41 CPDFXFA_Page* GetPage(int page_index); |
42 CPDFXFA_Page* GetPage(CXFA_FFPageView* pPage); | 42 CPDFXFA_Page* GetPage(CXFA_FFPageView* pPage); |
43 | 43 |
44 void DeletePage(int page_index); | 44 void DeletePage(int page_index); |
45 void RemovePage(CPDFXFA_Page* page); | 45 void RemovePage(CPDFXFA_Page* page); |
46 int GetDocType() { return m_iDocType; } | 46 int GetDocType() { return m_iDocType; } |
47 | 47 |
48 CPDFSDK_Document* GetSDKDocument(CPDFDoc_Environment* pFormFillEnv); | 48 CPDFSDK_Document* GetSDKDocument(CPDFSDK_Environment* pFormFillEnv); |
49 | 49 |
50 void FXRect2PDFRect(const CFX_RectF& fxRectF, CFX_FloatRect& pdfRect); | 50 void FXRect2PDFRect(const CFX_RectF& fxRectF, CFX_FloatRect& pdfRect); |
51 | 51 |
52 // IXFA_DocProvider | 52 // IXFA_DocProvider |
53 void SetChangeMark(CXFA_FFDoc* hDoc) override; | 53 void SetChangeMark(CXFA_FFDoc* hDoc) override; |
54 // used in dynamic xfa, dwFlags refer to XFA_INVALIDATE_XXX macros. | 54 // used in dynamic xfa, dwFlags refer to XFA_INVALIDATE_XXX macros. |
55 void InvalidateRect(CXFA_FFPageView* pPageView, | 55 void InvalidateRect(CXFA_FFPageView* pPageView, |
56 const CFX_RectF& rt, | 56 const CFX_RectF& rt, |
57 uint32_t dwFlags = 0) override; | 57 uint32_t dwFlags = 0) override; |
58 // show or hide caret | 58 // show or hide caret |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 std::unique_ptr<CXFA_FFDoc> m_pXFADoc; | 209 std::unique_ptr<CXFA_FFDoc> m_pXFADoc; |
210 CXFA_FFDocView* m_pXFADocView; // not owned. | 210 CXFA_FFDocView* m_pXFADocView; // not owned. |
211 CPDFXFA_App* const m_pApp; | 211 CPDFXFA_App* const m_pApp; |
212 IJS_Context* m_pJSContext; | 212 IJS_Context* m_pJSContext; |
213 CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList; | 213 CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList; |
214 LoadStatus m_nLoadStatus; | 214 LoadStatus m_nLoadStatus; |
215 int m_nPageCount; | 215 int m_nPageCount; |
216 }; | 216 }; |
217 | 217 |
218 #endif // FPDFSDK_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_ | 218 #endif // FPDFSDK_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_ |
OLD | NEW |