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 #include "../../include/fxcodec/fx_codec.h" | 7 #include "../../include/fxcodec/fx_codec.h" |
8 #include "../../include/fpdfapi/fpdf_module.h" | 8 #include "../../include/fpdfapi/fpdf_module.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 CPDF_ModuleMgr::CPDF_ModuleMgr() | 38 CPDF_ModuleMgr::CPDF_ModuleMgr() |
39 : m_pCodecModule(nullptr) | 39 : m_pCodecModule(nullptr) |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 CPDF_ModuleMgr::~CPDF_ModuleMgr() | 43 CPDF_ModuleMgr::~CPDF_ModuleMgr() |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 void CPDF_ModuleMgr::SetDownloadCallback(FX_BOOL (*callback)(const FX_CHAR* modu
le_name)) | 47 void CPDF_ModuleMgr::SetDownloadCallback(bool (*callback)(const FX_CHAR* module_
name)) |
48 { | 48 { |
49 m_pDownloadCallback = callback; | 49 m_pDownloadCallback = callback; |
50 } | 50 } |
51 FX_BOOL CPDF_ModuleMgr::DownloadModule(const FX_CHAR* module_name) | 51 bool CPDF_ModuleMgr::DownloadModule(const FX_CHAR* module_name) |
52 { | 52 { |
53 if (m_pDownloadCallback == NULL) { | 53 if (m_pDownloadCallback == NULL) { |
54 return FALSE; | 54 return false; |
55 } | 55 } |
56 return m_pDownloadCallback(module_name); | 56 return m_pDownloadCallback(module_name); |
57 } | 57 } |
58 void CPDF_ModuleMgr::NotifyModuleAvailable(const FX_CHAR* module_name) | 58 void CPDF_ModuleMgr::NotifyModuleAvailable(const FX_CHAR* module_name) |
59 { | 59 { |
60 if (FXSYS_strcmp(module_name, kAddinNameCJK) == 0) { | 60 if (FXSYS_strcmp(module_name, kAddinNameCJK) == 0) { |
61 m_pPageModule->NotifyCJKAvailable(); | 61 m_pPageModule->NotifyCJKAvailable(); |
62 } | 62 } |
63 } | 63 } |
64 void CPDF_ModuleMgr::RegisterSecurityHandler(const FX_CHAR* filter, CPDF_Securit
yHandler * (*CreateHandler)(void* param), void* param) | 64 void CPDF_ModuleMgr::RegisterSecurityHandler(const FX_CHAR* filter, CPDF_Securit
yHandler * (*CreateHandler)(void* param), void* param) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : NULL; | 110 return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : NULL; |
111 } | 111 } |
112 ICodec_IccModule* CPDF_ModuleMgr::GetIccModule() | 112 ICodec_IccModule* CPDF_ModuleMgr::GetIccModule() |
113 { | 113 { |
114 return m_pCodecModule ? m_pCodecModule->GetIccModule() : NULL; | 114 return m_pCodecModule ? m_pCodecModule->GetIccModule() : NULL; |
115 } | 115 } |
116 ICodec_FlateModule* CPDF_ModuleMgr::GetFlateModule() | 116 ICodec_FlateModule* CPDF_ModuleMgr::GetFlateModule() |
117 { | 117 { |
118 return m_pCodecModule ? m_pCodecModule->GetFlateModule() : NULL; | 118 return m_pCodecModule ? m_pCodecModule->GetFlateModule() : NULL; |
119 } | 119 } |
OLD | NEW |