OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef XFA_FXFA_INCLUDE_XFA_FFDOC_H_ | |
8 #define XFA_FXFA_INCLUDE_XFA_FFDOC_H_ | |
9 | |
10 #include <map> | |
11 #include <memory> | |
12 | |
13 #include "xfa/fxfa/include/fxfa.h" | |
14 #include "xfa/fxfa/parser/cxfa_document.h" | |
15 #include "xfa/fxfa/parser/cxfa_document_parser.h" | |
16 | |
17 class CXFA_ChecksumContext; | |
18 class CXFA_FFApp; | |
19 class CXFA_FFNotify; | |
20 class CXFA_FFDocView; | |
21 | |
22 struct FX_IMAGEDIB_AND_DPI { | |
23 CFX_DIBSource* pDibSource; | |
24 int32_t iImageXDpi; | |
25 int32_t iImageYDpi; | |
26 }; | |
27 | |
28 class CXFA_FFDoc { | |
29 public: | |
30 CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment); | |
31 ~CXFA_FFDoc(); | |
32 IXFA_DocEnvironment* GetDocEnvironment() const { return m_pDocEnvironment; } | |
33 uint32_t GetDocType(); | |
34 int32_t StartLoad(); | |
35 int32_t DoLoad(IFX_Pause* pPause = nullptr); | |
36 void StopLoad(); | |
37 CXFA_FFDocView* CreateDocView(uint32_t dwView = 0); | |
38 FX_BOOL OpenDoc(IFX_FileRead* pStream, FX_BOOL bTakeOverFile); | |
39 FX_BOOL OpenDoc(CPDF_Document* pPDFDoc); | |
40 FX_BOOL CloseDoc(); | |
41 void SetDocType(uint32_t dwType); | |
42 CXFA_Document* GetXFADoc() { return m_pDocumentParser->GetDocument(); } | |
43 CXFA_FFApp* GetApp() { return m_pApp; } | |
44 CXFA_FFDocView* GetDocView(CXFA_LayoutProcessor* pLayout); | |
45 CXFA_FFDocView* GetDocView(); | |
46 CPDF_Document* GetPDFDoc(); | |
47 CFX_DIBitmap* GetPDFNamedImage(const CFX_WideStringC& wsName, | |
48 int32_t& iImageXDpi, | |
49 int32_t& iImageYDpi); | |
50 | |
51 bool SavePackage(XFA_HashCode code, | |
52 IFX_FileWrite* pFile, | |
53 CXFA_ChecksumContext* pCSContext); | |
54 FX_BOOL ImportData(IFX_FileRead* pStream, FX_BOOL bXDP = TRUE); | |
55 | |
56 protected: | |
57 IXFA_DocEnvironment* const m_pDocEnvironment; | |
58 std::unique_ptr<CXFA_DocumentParser> m_pDocumentParser; | |
59 IFX_FileRead* m_pStream; | |
60 CXFA_FFApp* m_pApp; | |
61 std::unique_ptr<CXFA_FFNotify> m_pNotify; | |
62 CPDF_Document* m_pPDFDoc; | |
63 std::map<uint32_t, FX_IMAGEDIB_AND_DPI> m_HashToDibDpiMap; | |
64 std::map<uint32_t, std::unique_ptr<CXFA_FFDocView>> m_TypeToDocViewMap; | |
65 uint32_t m_dwDocType; | |
66 FX_BOOL m_bOwnStream; | |
67 }; | |
68 | |
69 #endif // XFA_FXFA_INCLUDE_XFA_FFDOC_H_ | |
OLD | NEW |