summaryrefslogtreecommitdiff
path: root/core/fpdfapi/include/cpdf_modulemgr.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-15 14:57:22 -0400
committerDan Sinclair <dsinclair@chromium.org>2016-03-15 14:57:22 -0400
commitaa403d3f68a966e24a6d8e8c109970930f096afb (patch)
treefeee638c1d8cee4b191bf09c2637009bb9cd6f30 /core/fpdfapi/include/cpdf_modulemgr.h
parente40764862208b8cb76f507c489b01e3795fd93bd (diff)
downloadpdfium-aa403d3f68a966e24a6d8e8c109970930f096afb.tar.xz
core/include/fdpfapi cleanup Part I.
This Cl moves a bunch of the files from core/include/fpdfapi to their correct location outside the core/include tree. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1805603002 .
Diffstat (limited to 'core/fpdfapi/include/cpdf_modulemgr.h')
-rw-r--r--core/fpdfapi/include/cpdf_modulemgr.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/core/fpdfapi/include/cpdf_modulemgr.h b/core/fpdfapi/include/cpdf_modulemgr.h
new file mode 100644
index 0000000000..5449b082c6
--- /dev/null
+++ b/core/fpdfapi/include/cpdf_modulemgr.h
@@ -0,0 +1,70 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_
+#define CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_
+
+#include <memory>
+
+#include "core/fpdfapi/ipdf_pagemodule.h"
+#include "core/include/fxcrt/fx_basic.h"
+
+class CCodec_ModuleMgr;
+class ICodec_FaxModule;
+class ICodec_FlateModule;
+class ICodec_IccModule;
+class ICodec_Jbig2Module;
+class ICodec_JpegModule;
+class ICodec_JpxModule;
+
+class IPDF_PageModule;
+class IPDF_RenderModule;
+
+class CPDF_ModuleMgr {
+ public:
+ static CPDF_ModuleMgr* Get();
+ static void Create();
+ static void Destroy();
+ static const int kFileBufSize = 512;
+
+ void SetCodecModule(CCodec_ModuleMgr* pModule) { m_pCodecModule = pModule; }
+ CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; }
+
+ void InitPageModule();
+ void InitRenderModule();
+
+ IPDF_RenderModule* GetRenderModule() const { return m_pRenderModule.get(); }
+ IPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); }
+
+ void LoadEmbeddedGB1CMaps();
+ void LoadEmbeddedCNS1CMaps();
+ void LoadEmbeddedJapan1CMaps();
+ void LoadEmbeddedKorea1CMaps();
+
+ ICodec_FaxModule* GetFaxModule();
+ ICodec_JpegModule* GetJpegModule();
+ ICodec_JpxModule* GetJpxModule();
+ ICodec_Jbig2Module* GetJbig2Module();
+ ICodec_IccModule* GetIccModule();
+ ICodec_FlateModule* GetFlateModule();
+
+ void SetPrivateData(void* module_id,
+ void* pData,
+ PD_CALLBACK_FREEDATA callback);
+
+ void* GetPrivateData(void* module_id);
+
+ private:
+ CPDF_ModuleMgr();
+ ~CPDF_ModuleMgr();
+
+ CCodec_ModuleMgr* m_pCodecModule;
+ std::unique_ptr<IPDF_RenderModule> m_pRenderModule;
+ std::unique_ptr<IPDF_PageModule> m_pPageModule;
+ CFX_PrivateData m_privateData;
+};
+
+#endif // CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_