1 // Copyright 2016 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FXGE_CFX_GEMODULE_H_ 8 #define CORE_FXGE_CFX_GEMODULE_H_ 9 10 #include <memory> 11 12 class CFX_FontCache; 13 class CFX_FontMgr; 14 15 class CFX_GEModule { 16 public: 17 class PlatformIface { 18 public: 19 static std::unique_ptr<PlatformIface> Create(); ~PlatformIface()20 virtual ~PlatformIface() {} 21 22 virtual void Init() = 0; 23 }; 24 25 static void Create(const char** pUserFontPaths); 26 static void Destroy(); 27 static CFX_GEModule* Get(); 28 GetFontCache()29 CFX_FontCache* GetFontCache() const { return m_pFontCache.get(); } GetFontMgr()30 CFX_FontMgr* GetFontMgr() const { return m_pFontMgr.get(); } GetPlatform()31 PlatformIface* GetPlatform() const { return m_pPlatform.get(); } GetUserFontPaths()32 const char** GetUserFontPaths() const { return m_pUserFontPaths; } 33 34 private: 35 explicit CFX_GEModule(const char** pUserFontPaths); 36 ~CFX_GEModule(); 37 38 std::unique_ptr<PlatformIface> const m_pPlatform; 39 std::unique_ptr<CFX_FontMgr> const m_pFontMgr; 40 std::unique_ptr<CFX_FontCache> const m_pFontCache; 41 const char** const m_pUserFontPaths; 42 }; 43 44 #endif // CORE_FXGE_CFX_GEMODULE_H_ 45