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_CPDFXFA_DOCUMENT_H_ | 7 #ifndef FPDFSDK_FPDFXFA_CPDFXFA_DOCUMENT_H_ |
8 #define FPDFSDK_FPDFXFA_CPDFXFA_DOCUMENT_H_ | 8 #define FPDFSDK_FPDFXFA_CPDFXFA_DOCUMENT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 22 matching lines...) Expand all Loading... |
33 CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc, | 33 CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc, |
34 CPDFXFA_App* pProvider); | 34 CPDFXFA_App* pProvider); |
35 ~CPDFXFA_Document(); | 35 ~CPDFXFA_Document(); |
36 | 36 |
37 FX_BOOL LoadXFADoc(); | 37 FX_BOOL LoadXFADoc(); |
38 CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); } | 38 CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); } |
39 CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); } | 39 CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); } |
40 CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; } | 40 CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; } |
41 int GetDocType() const { return m_iDocType; } | 41 int GetDocType() const { return m_iDocType; } |
42 | 42 |
43 CPDFSDK_Document* GetSDKDoc() const { return m_pSDKDoc.get(); } | 43 CPDFSDK_Document* GetSDKDoc() const { return m_pSDKDoc; } |
44 void SetSDKDoc(std::unique_ptr<CPDFSDK_Document> pSDKDoc); | 44 void SetSDKDoc(CPDFSDK_Document* pSDKDoc) { m_pSDKDoc = pSDKDoc; } |
45 | 45 |
46 void DeletePage(int page_index); | 46 void DeletePage(int page_index); |
47 int GetPageCount() const; | 47 int GetPageCount() const; |
48 | 48 |
49 CPDFXFA_Page* GetXFAPage(int page_index); | 49 CPDFXFA_Page* GetXFAPage(int page_index); |
50 CPDFXFA_Page* GetXFAPage(CXFA_FFPageView* pPage) const; | 50 CPDFXFA_Page* GetXFAPage(CXFA_FFPageView* pPage) const; |
51 | 51 |
52 void RemovePage(CPDFXFA_Page* page); | 52 void RemovePage(CPDFXFA_Page* page); |
53 | 53 |
54 void ClearChangeMark(); | 54 void ClearChangeMark(); |
(...skipping 16 matching lines...) Expand all Loading... |
71 if (pDoc) { | 71 if (pDoc) { |
72 m_pXFADoc->CloseDoc(); | 72 m_pXFADoc->CloseDoc(); |
73 m_pXFADoc.reset(); | 73 m_pXFADoc.reset(); |
74 m_pXFADocView = nullptr; | 74 m_pXFADocView = nullptr; |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 int m_iDocType; | 78 int m_iDocType; |
79 | 79 |
80 std::unique_ptr<CPDF_Document> m_pPDFDoc; | 80 std::unique_ptr<CPDF_Document> m_pPDFDoc; |
81 // |m_pSDKDoc| must be destroyed before |m_pPDFDoc| since it needs to access | |
82 // it to kill focused annotations. | |
83 std::unique_ptr<CPDFSDK_Document> m_pSDKDoc; | |
84 std::unique_ptr<CXFA_FFDoc> m_pXFADoc; | 81 std::unique_ptr<CXFA_FFDoc> m_pXFADoc; |
| 82 CPDFSDK_Document* m_pSDKDoc; // not owned. |
85 CXFA_FFDocView* m_pXFADocView; // not owned. | 83 CXFA_FFDocView* m_pXFADocView; // not owned. |
86 CPDFXFA_App* const m_pApp; | 84 CPDFXFA_App* const m_pApp; |
87 CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList; | 85 CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList; |
88 LoadStatus m_nLoadStatus; | 86 LoadStatus m_nLoadStatus; |
89 int m_nPageCount; | 87 int m_nPageCount; |
90 | 88 |
91 // Must be destroy before |m_pSDKDoc|. | 89 // Must be destroy before |m_pSDKDoc|. |
92 CPDFXFA_DocEnvironment m_DocEnv; | 90 CPDFXFA_DocEnvironment m_DocEnv; |
93 }; | 91 }; |
94 | 92 |
95 #endif // FPDFSDK_FPDFXFA_CPDFXFA_DOCUMENT_H_ | 93 #endif // FPDFSDK_FPDFXFA_CPDFXFA_DOCUMENT_H_ |
OLD | NEW |