Chromium Code Reviews| 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 // Takes ownership of |pAdapter|. |
|
Lei Zhang
2016/05/24 21:34:58
There's only 1 caller - change the param to a uniq
Tom Sepez
2016/05/24 21:56:55
Done.
| |
| 37 void SetUnsupportInfoAdapter(CFX_Deletable* pAdapter) { | |
| 38 m_pUnsupportInfoAdapter.reset(pAdapter); | |
| 39 } | |
| 40 CFX_Deletable* GetUnsupportInfoAdapter() const { | |
| 41 return m_pUnsupportInfoAdapter.get(); | |
| 42 } | |
| 37 | 43 |
| 38 void LoadEmbeddedGB1CMaps(); | 44 void LoadEmbeddedGB1CMaps(); |
| 39 void LoadEmbeddedCNS1CMaps(); | 45 void LoadEmbeddedCNS1CMaps(); |
| 40 void LoadEmbeddedJapan1CMaps(); | 46 void LoadEmbeddedJapan1CMaps(); |
| 41 void LoadEmbeddedKorea1CMaps(); | 47 void LoadEmbeddedKorea1CMaps(); |
| 42 | 48 |
| 43 CCodec_FaxModule* GetFaxModule(); | 49 CCodec_FaxModule* GetFaxModule(); |
| 44 CCodec_JpegModule* GetJpegModule(); | 50 CCodec_JpegModule* GetJpegModule(); |
| 45 CCodec_JpxModule* GetJpxModule(); | 51 CCodec_JpxModule* GetJpxModule(); |
| 46 CCodec_Jbig2Module* GetJbig2Module(); | 52 CCodec_Jbig2Module* GetJbig2Module(); |
| 47 CCodec_IccModule* GetIccModule(); | 53 CCodec_IccModule* GetIccModule(); |
| 48 CCodec_FlateModule* GetFlateModule(); | 54 CCodec_FlateModule* GetFlateModule(); |
| 49 | 55 |
| 50 void SetPrivateData(void* module_id, | |
| 51 void* pData, | |
| 52 PD_CALLBACK_FREEDATA callback); | |
| 53 | |
| 54 void* GetPrivateData(void* module_id); | |
| 55 | |
| 56 private: | 56 private: |
| 57 CPDF_ModuleMgr(); | 57 CPDF_ModuleMgr(); |
| 58 ~CPDF_ModuleMgr(); | 58 ~CPDF_ModuleMgr(); |
| 59 | 59 |
| 60 CCodec_ModuleMgr* m_pCodecModule; | 60 CCodec_ModuleMgr* m_pCodecModule; |
| 61 std::unique_ptr<CPDF_PageModule> m_pPageModule; | 61 std::unique_ptr<CPDF_PageModule> m_pPageModule; |
| 62 CFX_PrivateData m_privateData; | 62 std::unique_ptr<CFX_Deletable> m_pUnsupportInfoAdapter; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 #endif // CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_ | 65 #endif // CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_ |
| OLD | NEW |