Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: xfa/fgas/font/fgas_font.h

Issue 2227883002: Use smart pointers for class owned pointers in xfa/fxfa (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fsdk_baseform.cpp ('k') | xfa/fgas/font/fgas_stdfontmgr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/font/fgas_font.h
diff --git a/xfa/fgas/font/fgas_font.h b/xfa/fgas/font/fgas_font.h
index 7fcfbd715bcc6bfadaf0bdb0d04d87a30296cf7b..f91c015dae79cd29fd31580daa0c3ece418727eb 100644
--- a/xfa/fgas/font/fgas_font.h
+++ b/xfa/fgas/font/fgas_font.h
@@ -80,11 +80,13 @@ typedef FX_FONTDESCRIPTOR const* (*FX_LPMatchFont)(
FX_LPFONTMATCHPARAMS pParams,
const CFX_FontDescriptors& fonts);
FX_LPMatchFont FX_GetDefFontMatchor();
+
class IFGAS_FontMgr {
public:
- static IFGAS_FontMgr* Create(FX_LPEnumAllFonts pEnumerator);
virtual ~IFGAS_FontMgr() {}
- virtual void Release() = 0;
+
+ static std::unique_ptr<IFGAS_FontMgr> Create(FX_LPEnumAllFonts pEnumerator);
+
virtual CFGAS_GEFont* GetDefFontByCodePage(
uint16_t wCodePage,
uint32_t dwFontStyles,
@@ -121,46 +123,40 @@ class IFGAS_FontMgr {
class IFGAS_FontMgr {
public:
- static IFGAS_FontMgr* Create(CFX_FontSourceEnum_File* pFontEnum);
virtual ~IFGAS_FontMgr() {}
- virtual void Release() = 0;
- virtual CFGAS_GEFont* GetDefFontByCodePage(
- uint16_t wCodePage,
- uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily = nullptr) = 0;
- virtual CFGAS_GEFont* GetDefFontByCharset(
- uint8_t nCharset,
- uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily = nullptr) = 0;
- virtual CFGAS_GEFont* GetDefFontByUnicode(
- FX_WCHAR wUnicode,
- uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily = nullptr) = 0;
- virtual CFGAS_GEFont* GetDefFontByLanguage(
- uint16_t wLanguage,
- uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily = nullptr) = 0;
- virtual CFGAS_GEFont* GetFontByCodePage(
- uint16_t wCodePage,
- uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily = nullptr) = 0;
+
+ static std::unique_ptr<IFGAS_FontMgr> Create(
+ CFX_FontSourceEnum_File* pFontEnum);
+
+ virtual CFGAS_GEFont* GetDefFontByCodePage(uint16_t wCodePage,
+ uint32_t dwFontStyles,
+ const FX_WCHAR* pszFontFamily) = 0;
+ virtual CFGAS_GEFont* GetDefFontByCharset(uint8_t nCharset,
+ uint32_t dwFontStyles,
+ const FX_WCHAR* pszFontFamily) = 0;
+ virtual CFGAS_GEFont* GetDefFontByUnicode(FX_WCHAR wUnicode,
+ uint32_t dwFontStyles,
+ const FX_WCHAR* pszFontFamily) = 0;
+ virtual CFGAS_GEFont* GetDefFontByLanguage(uint16_t wLanguage,
+ uint32_t dwFontStyles,
+ const FX_WCHAR* pszFontFamily) = 0;
+ virtual CFGAS_GEFont* GetFontByCodePage(uint16_t wCodePage,
+ uint32_t dwFontStyles,
+ const FX_WCHAR* pszFontFamily) = 0;
inline CFGAS_GEFont* LoadFont(const FX_WCHAR* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage) {
return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily);
}
- virtual CFGAS_GEFont* GetFontByCharset(
- uint8_t nCharset,
- uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily = nullptr) = 0;
- virtual CFGAS_GEFont* GetFontByUnicode(
- FX_WCHAR wUnicode,
- uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily = nullptr) = 0;
- virtual CFGAS_GEFont* GetFontByLanguage(
- uint16_t wLanguage,
- uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily = nullptr) = 0;
+ virtual CFGAS_GEFont* GetFontByCharset(uint8_t nCharset,
+ uint32_t dwFontStyles,
+ const FX_WCHAR* pszFontFamily) = 0;
+ virtual CFGAS_GEFont* GetFontByUnicode(FX_WCHAR wUnicode,
+ uint32_t dwFontStyles,
+ const FX_WCHAR* pszFontFamily) = 0;
+ virtual CFGAS_GEFont* GetFontByLanguage(uint16_t wLanguage,
+ uint32_t dwFontStyles,
+ const FX_WCHAR* pszFontFamily) = 0;
virtual void ClearFontCache() = 0;
virtual void RemoveFont(CFGAS_GEFont* pFont) = 0;
};
« no previous file with comments | « fpdfsdk/fsdk_baseform.cpp ('k') | xfa/fgas/font/fgas_stdfontmgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698