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