OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_ | |
8 #define CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_ | |
9 | |
10 #include <memory> | |
11 | |
12 #include "core/fxcrt/include/fx_basic.h" | |
13 | |
14 class CCodec_FaxModule; | |
15 class CCodec_FlateModule; | |
16 class CCodec_IccModule; | |
17 class CCodec_Jbig2Module; | |
18 class CCodec_JpegModule; | |
19 class CCodec_JpxModule; | |
20 class CCodec_ModuleMgr; | |
21 class CPDF_PageModule; | |
22 | |
23 class CFSDK_UnsupportInfo_Adapter { | |
24 public: | |
25 explicit CFSDK_UnsupportInfo_Adapter(void* unsp_info) | |
26 : m_unsp_info(unsp_info) {} | |
27 | |
28 void* GetUnspInfo() const { return m_unsp_info; } | |
29 | |
30 private: | |
31 void* const m_unsp_info; | |
32 }; | |
33 | |
34 class CPDF_ModuleMgr { | |
35 public: | |
36 static CPDF_ModuleMgr* Get(); | |
37 static void Create(); | |
38 static void Destroy(); | |
39 static const int kFileBufSize = 512; | |
40 | |
41 void SetCodecModule(CCodec_ModuleMgr* pModule) { m_pCodecModule = pModule; } | |
42 CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } | |
43 | |
44 void InitPageModule(); | |
45 CPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); } | |
46 | |
47 void SetUnsupportInfoAdapter( | |
48 std::unique_ptr<CFSDK_UnsupportInfo_Adapter> pAdapter) { | |
49 m_pUnsupportInfoAdapter = std::move(pAdapter); | |
50 } | |
51 CFSDK_UnsupportInfo_Adapter* GetUnsupportInfoAdapter() const { | |
52 return m_pUnsupportInfoAdapter.get(); | |
53 } | |
54 | |
55 void LoadEmbeddedGB1CMaps(); | |
56 void LoadEmbeddedCNS1CMaps(); | |
57 void LoadEmbeddedJapan1CMaps(); | |
58 void LoadEmbeddedKorea1CMaps(); | |
59 | |
60 CCodec_FaxModule* GetFaxModule(); | |
61 CCodec_JpegModule* GetJpegModule(); | |
62 CCodec_JpxModule* GetJpxModule(); | |
63 CCodec_Jbig2Module* GetJbig2Module(); | |
64 CCodec_IccModule* GetIccModule(); | |
65 CCodec_FlateModule* GetFlateModule(); | |
66 | |
67 private: | |
68 CPDF_ModuleMgr(); | |
69 ~CPDF_ModuleMgr(); | |
70 | |
71 CCodec_ModuleMgr* m_pCodecModule; | |
72 std::unique_ptr<CPDF_PageModule> m_pPageModule; | |
73 std::unique_ptr<CFSDK_UnsupportInfo_Adapter> m_pUnsupportInfoAdapter; | |
74 }; | |
75 | |
76 #endif // CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_ | |
OLD | NEW |