Initial commit.
[pdfium.git] / fpdfsdk / include / formfiller / FFL_CBA_Fontmap.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4  \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _RAO_FONTMAP_H_\r
8 #define _RAO_FONTMAP_H_\r
9 \r
10 #if _MSC_VER > 1000\r
11 #pragma once\r
12 #endif // _MSC_VER > 1000\r
13 \r
14 class CPDFSDK_Annot;\r
15 \r
16 class CBA_FontMap : public CPWL_FontMap\r
17 {\r
18 public:\r
19         CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandler);\r
20         CBA_FontMap(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict, IFX_SystemHandler* pSystemHandler);\r
21 \r
22         virtual ~CBA_FontMap();\r
23 \r
24         virtual void                            Initial(FX_LPCSTR fontname = NULL);\r
25 \r
26 public:\r
27         void                                            SetDefaultFont(CPDF_Font * pFont, const CFX_ByteString & sFontName);\r
28 \r
29         void                                            Reset();\r
30         void                                            SetAPType(const CFX_ByteString& sAPType);\r
31 \r
32 protected:\r
33         virtual CPDF_Font*                      FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset);\r
34         virtual void                            AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias);\r
35         virtual CPDF_Document*          GetDocument();\r
36 private:\r
37         CPDF_Font*                                      FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias,\r
38                                                                         FX_INT32 nCharset);\r
39         CPDF_Font*                                      GetAnnotDefaultFont(CFX_ByteString &csNameTag);\r
40         void                                            AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAlias);\r
41 \r
42 private:\r
43         CPDF_Document*                          m_pDocument;\r
44         CPDF_Dictionary*                        m_pAnnotDict;\r
45         CPDF_Font*                                      m_pDefaultFont;\r
46         CFX_ByteString                          m_sDefaultFontName;\r
47         \r
48         CFX_ByteString                          m_sAPType;\r
49 };\r
50 \r
51 #endif // _RAO_FONTMAP_H_\r