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 #ifndef XFA_FXFA_PARSER_XFA_LOCALE_H_ | 7 #ifndef XFA_FXFA_PARSER_XFA_LOCALE_H_ |
8 #define XFA_FXFA_PARSER_XFA_LOCALE_H_ | 8 #define XFA_FXFA_PARSER_XFA_LOCALE_H_ |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "xfa/fgas/localization/fgas_locale.h" | 12 #include "xfa/fgas/localization/fgas_locale.h" |
11 #include "xfa/fxfa/parser/xfa_object.h" | 13 #include "xfa/fxfa/parser/xfa_object.h" |
12 | 14 |
13 class CXFA_XMLLocale : public IFX_Locale { | 15 class CXFA_XMLLocale : public IFX_Locale { |
14 public: | 16 public: |
15 CXFA_XMLLocale(CXML_Element* pLocaleData); | 17 explicit CXFA_XMLLocale(std::unique_ptr<CXML_Element> pLocaleData); |
16 | 18 |
17 // IFX_Locale | 19 // IFX_Locale |
18 void Release() override; | 20 void Release() override; |
19 CFX_WideString GetName() override; | 21 CFX_WideString GetName() override; |
20 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, | 22 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, |
21 CFX_WideString& wsNumSymbol) const override; | 23 CFX_WideString& wsNumSymbol) const override; |
22 | 24 |
23 void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override; | 25 void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override; |
24 void GetMonthName(int32_t nMonth, | 26 void GetMonthName(int32_t nMonth, |
25 CFX_WideString& wsMonthName, | 27 CFX_WideString& wsMonthName, |
(...skipping 18 matching lines...) Expand all Loading... |
44 | 46 |
45 void GetPattern(CXML_Element* pElement, | 47 void GetPattern(CXML_Element* pElement, |
46 const CFX_ByteStringC& bsTag, | 48 const CFX_ByteStringC& bsTag, |
47 const CFX_WideStringC& wsName, | 49 const CFX_WideStringC& wsName, |
48 CFX_WideString& wsPattern) const; | 50 CFX_WideString& wsPattern) const; |
49 CFX_WideString GetCalendarSymbol(const CFX_ByteStringC& symbol, | 51 CFX_WideString GetCalendarSymbol(const CFX_ByteStringC& symbol, |
50 int index, | 52 int index, |
51 FX_BOOL bAbbr) const; | 53 FX_BOOL bAbbr) const; |
52 | 54 |
53 private: | 55 private: |
54 CXML_Element* m_pLocaleData; | 56 std::unique_ptr<CXML_Element> m_pLocaleData; |
55 }; | 57 }; |
56 | 58 |
57 class CXFA_NodeLocale : public IFX_Locale { | 59 class CXFA_NodeLocale : public IFX_Locale { |
58 public: | 60 public: |
59 CXFA_NodeLocale(CXFA_Node* pLocale); | 61 CXFA_NodeLocale(CXFA_Node* pLocale); |
60 | 62 |
61 // IFX_Locale | 63 // IFX_Locale |
62 void Release() override; | 64 void Release() override; |
63 CFX_WideString GetName() override; | 65 CFX_WideString GetName() override; |
64 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, | 66 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, |
(...skipping 22 matching lines...) Expand all Loading... |
87 ~CXFA_NodeLocale() override; | 89 ~CXFA_NodeLocale() override; |
88 | 90 |
89 CXFA_Node* GetNodeByName(CXFA_Node* pParent, | 91 CXFA_Node* GetNodeByName(CXFA_Node* pParent, |
90 const CFX_WideStringC& wsName) const; | 92 const CFX_WideStringC& wsName) const; |
91 CFX_WideString GetSymbol(XFA_Element eElement, | 93 CFX_WideString GetSymbol(XFA_Element eElement, |
92 const CFX_WideStringC& symbol_type) const; | 94 const CFX_WideStringC& symbol_type) const; |
93 CFX_WideString GetCalendarSymbol(XFA_Element eElement, | 95 CFX_WideString GetCalendarSymbol(XFA_Element eElement, |
94 int index, | 96 int index, |
95 FX_BOOL bAbbr) const; | 97 FX_BOOL bAbbr) const; |
96 | 98 |
97 CXFA_Node* m_pLocale; | 99 CXFA_Node* const m_pLocale; |
98 }; | 100 }; |
99 | 101 |
100 #endif // XFA_FXFA_PARSER_XFA_LOCALE_H_ | 102 #endif // XFA_FXFA_PARSER_XFA_LOCALE_H_ |
OLD | NEW |