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 XFA_FXFA_XFA_FFDOC_H_ | 7 #ifndef XFA_FXFA_XFA_FFDOC_H_ |
8 #define XFA_FXFA_XFA_FFDOC_H_ | 8 #define XFA_FXFA_XFA_FFDOC_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 11 matching lines...) Expand all Loading... |
22 struct FX_IMAGEDIB_AND_DPI { | 22 struct FX_IMAGEDIB_AND_DPI { |
23 CFX_DIBSource* pDibSource; | 23 CFX_DIBSource* pDibSource; |
24 int32_t iImageXDpi; | 24 int32_t iImageXDpi; |
25 int32_t iImageYDpi; | 25 int32_t iImageYDpi; |
26 }; | 26 }; |
27 | 27 |
28 class CXFA_FFDoc { | 28 class CXFA_FFDoc { |
29 public: | 29 public: |
30 CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment); | 30 CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment); |
31 ~CXFA_FFDoc(); | 31 ~CXFA_FFDoc(); |
| 32 |
32 IXFA_DocEnvironment* GetDocEnvironment() const { return m_pDocEnvironment; } | 33 IXFA_DocEnvironment* GetDocEnvironment() const { return m_pDocEnvironment; } |
33 uint32_t GetDocType(); | 34 uint32_t GetDocType(); |
| 35 void SetDocType(uint32_t dwType); |
| 36 |
34 int32_t StartLoad(); | 37 int32_t StartLoad(); |
35 int32_t DoLoad(IFX_Pause* pPause = nullptr); | 38 int32_t DoLoad(IFX_Pause* pPause = nullptr); |
36 void StopLoad(); | 39 void StopLoad(); |
| 40 |
37 CXFA_FFDocView* CreateDocView(uint32_t dwView = 0); | 41 CXFA_FFDocView* CreateDocView(uint32_t dwView = 0); |
| 42 |
38 FX_BOOL OpenDoc(IFX_SeekableReadStream* pStream, FX_BOOL bTakeOverFile); | 43 FX_BOOL OpenDoc(IFX_SeekableReadStream* pStream, FX_BOOL bTakeOverFile); |
39 FX_BOOL OpenDoc(CPDF_Document* pPDFDoc); | 44 FX_BOOL OpenDoc(CPDF_Document* pPDFDoc); |
40 FX_BOOL CloseDoc(); | 45 FX_BOOL CloseDoc(); |
41 void SetDocType(uint32_t dwType); | 46 |
42 CXFA_Document* GetXFADoc() { return m_pDocumentParser->GetDocument(); } | 47 CXFA_Document* GetXFADoc() { return m_pDocumentParser->GetDocument(); } |
43 CXFA_FFApp* GetApp() { return m_pApp; } | 48 CXFA_FFApp* GetApp() { return m_pApp; } |
44 CXFA_FFDocView* GetDocView(CXFA_LayoutProcessor* pLayout); | 49 CXFA_FFDocView* GetDocView(CXFA_LayoutProcessor* pLayout); |
45 CXFA_FFDocView* GetDocView(); | 50 CXFA_FFDocView* GetDocView(); |
46 CPDF_Document* GetPDFDoc(); | 51 CPDF_Document* GetPDFDoc(); |
47 CFX_DIBitmap* GetPDFNamedImage(const CFX_WideStringC& wsName, | 52 CFX_DIBitmap* GetPDFNamedImage(const CFX_WideStringC& wsName, |
48 int32_t& iImageXDpi, | 53 int32_t& iImageXDpi, |
49 int32_t& iImageYDpi); | 54 int32_t& iImageYDpi); |
50 | 55 |
51 bool SavePackage(XFA_HashCode code, | 56 bool SavePackage(XFA_HashCode code, |
52 IFX_SeekableWriteStream* pFile, | 57 IFX_SeekableWriteStream* pFile, |
53 CXFA_ChecksumContext* pCSContext); | 58 CXFA_ChecksumContext* pCSContext); |
54 FX_BOOL ImportData(IFX_SeekableReadStream* pStream, FX_BOOL bXDP = TRUE); | 59 FX_BOOL ImportData(IFX_SeekableReadStream* pStream, FX_BOOL bXDP = TRUE); |
55 | 60 |
56 protected: | 61 protected: |
57 IXFA_DocEnvironment* const m_pDocEnvironment; | 62 IXFA_DocEnvironment* const m_pDocEnvironment; |
58 std::unique_ptr<CXFA_DocumentParser> m_pDocumentParser; | 63 std::unique_ptr<CXFA_DocumentParser> m_pDocumentParser; |
59 IFX_SeekableReadStream* m_pStream; | 64 IFX_SeekableReadStream* m_pStream; |
60 CXFA_FFApp* m_pApp; | 65 CXFA_FFApp* m_pApp; |
61 std::unique_ptr<CXFA_FFNotify> m_pNotify; | 66 std::unique_ptr<CXFA_FFNotify> m_pNotify; |
62 CPDF_Document* m_pPDFDoc; | 67 CPDF_Document* m_pPDFDoc; |
63 std::map<uint32_t, FX_IMAGEDIB_AND_DPI> m_HashToDibDpiMap; | 68 std::map<uint32_t, FX_IMAGEDIB_AND_DPI> m_HashToDibDpiMap; |
64 std::map<uint32_t, std::unique_ptr<CXFA_FFDocView>> m_TypeToDocViewMap; | 69 std::map<uint32_t, std::unique_ptr<CXFA_FFDocView>> m_TypeToDocViewMap; |
65 uint32_t m_dwDocType; | 70 uint32_t m_dwDocType; |
66 FX_BOOL m_bOwnStream; | 71 FX_BOOL m_bOwnStream; |
67 }; | 72 }; |
68 | 73 |
69 #endif // XFA_FXFA_XFA_FFDOC_H_ | 74 #endif // XFA_FXFA_XFA_FFDOC_H_ |
OLD | NEW |