| 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/fpdfapi/ipdf_pagemodule.h" | 12 #include "core/fpdfapi/ipdf_pagemodule.h" |
| 13 #include "core/fxcrt/include/fx_basic.h" | 13 #include "core/fxcrt/include/fx_basic.h" |
| 14 | 14 |
| 15 class CCodec_ModuleMgr; | 15 class CCodec_ModuleMgr; |
| 16 class ICodec_FaxModule; | 16 class CCodec_FaxModule; |
| 17 class ICodec_FlateModule; | 17 class CCodec_FlateModule; |
| 18 class ICodec_IccModule; | 18 class CCodec_IccModule; |
| 19 class ICodec_Jbig2Module; | 19 class CCodec_Jbig2Module; |
| 20 class ICodec_JpegModule; | 20 class CCodec_JpegModule; |
| 21 class ICodec_JpxModule; | 21 class CCodec_JpxModule; |
| 22 | 22 |
| 23 class IPDF_PageModule; | 23 class IPDF_PageModule; |
| 24 class IPDF_RenderModule; | 24 class IPDF_RenderModule; |
| 25 | 25 |
| 26 class CPDF_ModuleMgr { | 26 class CPDF_ModuleMgr { |
| 27 public: | 27 public: |
| 28 static CPDF_ModuleMgr* Get(); | 28 static CPDF_ModuleMgr* Get(); |
| 29 static void Create(); | 29 static void Create(); |
| 30 static void Destroy(); | 30 static void Destroy(); |
| 31 static const int kFileBufSize = 512; | 31 static const int kFileBufSize = 512; |
| 32 | 32 |
| 33 void SetCodecModule(CCodec_ModuleMgr* pModule) { m_pCodecModule = pModule; } | 33 void SetCodecModule(CCodec_ModuleMgr* pModule) { m_pCodecModule = pModule; } |
| 34 CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } | 34 CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } |
| 35 | 35 |
| 36 void InitPageModule(); | 36 void InitPageModule(); |
| 37 void InitRenderModule(); | 37 void InitRenderModule(); |
| 38 | 38 |
| 39 IPDF_RenderModule* GetRenderModule() const { return m_pRenderModule.get(); } | 39 IPDF_RenderModule* GetRenderModule() const { return m_pRenderModule.get(); } |
| 40 IPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); } | 40 IPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); } |
| 41 | 41 |
| 42 void LoadEmbeddedGB1CMaps(); | 42 void LoadEmbeddedGB1CMaps(); |
| 43 void LoadEmbeddedCNS1CMaps(); | 43 void LoadEmbeddedCNS1CMaps(); |
| 44 void LoadEmbeddedJapan1CMaps(); | 44 void LoadEmbeddedJapan1CMaps(); |
| 45 void LoadEmbeddedKorea1CMaps(); | 45 void LoadEmbeddedKorea1CMaps(); |
| 46 | 46 |
| 47 ICodec_FaxModule* GetFaxModule(); | 47 CCodec_FaxModule* GetFaxModule(); |
| 48 ICodec_JpegModule* GetJpegModule(); | 48 CCodec_JpegModule* GetJpegModule(); |
| 49 ICodec_JpxModule* GetJpxModule(); | 49 CCodec_JpxModule* GetJpxModule(); |
| 50 ICodec_Jbig2Module* GetJbig2Module(); | 50 CCodec_Jbig2Module* GetJbig2Module(); |
| 51 ICodec_IccModule* GetIccModule(); | 51 CCodec_IccModule* GetIccModule(); |
| 52 ICodec_FlateModule* GetFlateModule(); | 52 CCodec_FlateModule* GetFlateModule(); |
| 53 | 53 |
| 54 void SetPrivateData(void* module_id, | 54 void SetPrivateData(void* module_id, |
| 55 void* pData, | 55 void* pData, |
| 56 PD_CALLBACK_FREEDATA callback); | 56 PD_CALLBACK_FREEDATA callback); |
| 57 | 57 |
| 58 void* GetPrivateData(void* module_id); | 58 void* GetPrivateData(void* module_id); |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 CPDF_ModuleMgr(); | 61 CPDF_ModuleMgr(); |
| 62 ~CPDF_ModuleMgr(); | 62 ~CPDF_ModuleMgr(); |
| 63 | 63 |
| 64 CCodec_ModuleMgr* m_pCodecModule; | 64 CCodec_ModuleMgr* m_pCodecModule; |
| 65 std::unique_ptr<IPDF_RenderModule> m_pRenderModule; | 65 std::unique_ptr<IPDF_RenderModule> m_pRenderModule; |
| 66 std::unique_ptr<IPDF_PageModule> m_pPageModule; | 66 std::unique_ptr<IPDF_PageModule> m_pPageModule; |
| 67 CFX_PrivateData m_privateData; | 67 CFX_PrivateData m_privateData; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 #endif // CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_ | 70 #endif // CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_ |
| OLD | NEW |