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_FFAPP_H_ | 7 #ifndef XFA_FXFA_XFA_FFAPP_H_ |
8 #define XFA_FXFA_XFA_FFAPP_H_ | 8 #define XFA_FXFA_XFA_FFAPP_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "core/fpdfapi/parser/cpdf_stream.h" | 13 #include "core/fpdfapi/parser/cpdf_stream.h" |
14 #include "core/fpdfapi/parser/cpdf_stream_acc.h" | 14 #include "core/fpdfapi/parser/cpdf_stream_acc.h" |
15 #include "xfa/fgas/font/cfgas_fontmgr.h" | 15 #include "xfa/fgas/font/cfgas_fontmgr.h" |
16 #include "xfa/fwl/core/cfwl_app.h" | 16 #include "xfa/fwl/core/cfwl_app.h" |
17 #include "xfa/fxfa/fxfa.h" | 17 #include "xfa/fxfa/fxfa.h" |
18 | 18 |
19 class CXFA_DefFontMgr; | 19 class CXFA_DefFontMgr; |
20 class CXFA_FWLAdapterWidgetMgr; | 20 class CXFA_FWLAdapterWidgetMgr; |
21 class CXFA_FWLTheme; | 21 class CXFA_FWLTheme; |
22 class CXFA_FFDocHandler; | 22 class CXFA_FFDocHandler; |
23 class CXFA_FontMgr; | 23 class CXFA_FontMgr; |
24 class IFWL_AdapterTimerMgr; | 24 class IFWL_AdapterTimerMgr; |
25 class CFWL_WidgetMgrDelegate; | 25 class CFWL_WidgetMgrDelegate; |
26 | 26 |
27 class CXFA_FileRead : public IFX_SeekableReadStream { | 27 // Layering prevents fxcrt from knowing about CPDF_Streams; this could go |
28 public: | 28 // in fpdfsdk, but it is XFA-Only. |
29 explicit CXFA_FileRead(const std::vector<CPDF_Stream*>& streams); | 29 IFX_SeekableReadStream* MakeSeekableReadStream( |
30 ~CXFA_FileRead() override; | 30 const std::vector<CPDF_Stream*>& streams); |
31 | |
32 // IFX_SeekableReadStream | |
33 FX_FILESIZE GetSize() override; | |
34 bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; | |
35 void Release() override; | |
36 | |
37 protected: | |
38 CFX_ObjectArray<CPDF_StreamAcc> m_Data; | |
39 }; | |
40 | 31 |
41 class CXFA_FFApp { | 32 class CXFA_FFApp { |
42 public: | 33 public: |
43 explicit CXFA_FFApp(IXFA_AppProvider* pProvider); | 34 explicit CXFA_FFApp(IXFA_AppProvider* pProvider); |
44 ~CXFA_FFApp(); | 35 ~CXFA_FFApp(); |
45 | 36 |
46 CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment, | 37 CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment, |
47 IFX_SeekableReadStream* pStream, | 38 IFX_SeekableReadStream* pStream, |
48 bool bTakeOverFile); | 39 bool bTakeOverFile); |
49 CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment, | 40 CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 std::unique_ptr<CXFA_FWLAdapterWidgetMgr> m_pAdapterWidgetMgr; | 79 std::unique_ptr<CXFA_FWLAdapterWidgetMgr> m_pAdapterWidgetMgr; |
89 CFWL_WidgetMgrDelegate* m_pWidgetMgrDelegate; // not owned. | 80 CFWL_WidgetMgrDelegate* m_pWidgetMgrDelegate; // not owned. |
90 | 81 |
91 // |m_pFWLApp| has to be released first, then |m_pFWLTheme| since the former | 82 // |m_pFWLApp| has to be released first, then |m_pFWLTheme| since the former |
92 // may refers to theme manager and the latter refers to font manager. | 83 // may refers to theme manager and the latter refers to font manager. |
93 std::unique_ptr<CXFA_FWLTheme> m_pFWLTheme; | 84 std::unique_ptr<CXFA_FWLTheme> m_pFWLTheme; |
94 std::unique_ptr<CFWL_App> m_pFWLApp; | 85 std::unique_ptr<CFWL_App> m_pFWLApp; |
95 }; | 86 }; |
96 | 87 |
97 #endif // XFA_FXFA_XFA_FFAPP_H_ | 88 #endif // XFA_FXFA_XFA_FFAPP_H_ |
OLD | NEW |