| 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 "xfa/fgas/localization/fgas_locale.h" | 10 #include "xfa/fgas/localization/fgas_locale.h" |
| 11 #include "xfa/fxfa/parser/xfa_object.h" | 11 #include "xfa/fxfa/parser/xfa_object.h" |
| 12 | 12 |
| 13 class CXFA_XMLLocale : public IFX_Locale { | 13 class CXFA_XMLLocale : public IFX_Locale { |
| 14 public: | 14 public: |
| 15 CXFA_XMLLocale(CXML_Element* pLocaleData); | 15 CXFA_XMLLocale(CXML_Element* pLocaleData); |
| 16 virtual void Release(); | |
| 17 virtual CFX_WideString GetName(); | |
| 18 virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, | |
| 19 CFX_WideString& wsNumSymbol) const; | |
| 20 | 16 |
| 21 virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const; | 17 // IFX_Locale |
| 22 virtual void GetMonthName(int32_t nMonth, | 18 void Release() override; |
| 23 CFX_WideString& wsMonthName, | 19 CFX_WideString GetName() override; |
| 24 FX_BOOL bAbbr = TRUE) const; | 20 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, |
| 25 virtual void GetDayName(int32_t nWeek, | 21 CFX_WideString& wsNumSymbol) const override; |
| 26 CFX_WideString& wsDayName, | |
| 27 FX_BOOL bAbbr = TRUE) const; | |
| 28 virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, | |
| 29 FX_BOOL bAM = TRUE) const; | |
| 30 virtual void GetTimeZone(FX_TIMEZONE& tz) const; | |
| 31 virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const; | |
| 32 | 22 |
| 33 virtual void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, | 23 void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override; |
| 34 CFX_WideString& wsPattern) const; | 24 void GetMonthName(int32_t nMonth, |
| 35 virtual void GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, | 25 CFX_WideString& wsMonthName, |
| 36 CFX_WideString& wsPattern) const; | 26 FX_BOOL bAbbr = TRUE) const override; |
| 37 virtual void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, | 27 void GetDayName(int32_t nWeek, |
| 38 CFX_WideString& wsPattern) const; | 28 CFX_WideString& wsDayName, |
| 29 FX_BOOL bAbbr = TRUE) const override; |
| 30 void GetMeridiemName(CFX_WideString& wsMeridiemName, |
| 31 FX_BOOL bAM = TRUE) const override; |
| 32 void GetTimeZone(FX_TIMEZONE& tz) const override; |
| 33 void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const override; |
| 34 |
| 35 void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, |
| 36 CFX_WideString& wsPattern) const override; |
| 37 void GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, |
| 38 CFX_WideString& wsPattern) const override; |
| 39 void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, |
| 40 CFX_WideString& wsPattern) const override; |
| 39 | 41 |
| 40 protected: | 42 protected: |
| 41 ~CXFA_XMLLocale(); | 43 ~CXFA_XMLLocale() override; |
| 44 |
| 42 void GetPattern(CXML_Element* pElement, | 45 void GetPattern(CXML_Element* pElement, |
| 43 const CFX_ByteStringC& bsTag, | 46 const CFX_ByteStringC& bsTag, |
| 44 const CFX_WideStringC& wsName, | 47 const CFX_WideStringC& wsName, |
| 45 CFX_WideString& wsPattern) const; | 48 CFX_WideString& wsPattern) const; |
| 46 CFX_WideString GetCalendarSymbol(const CFX_ByteStringC& symbol, | 49 CFX_WideString GetCalendarSymbol(const CFX_ByteStringC& symbol, |
| 47 int index, | 50 int index, |
| 48 FX_BOOL bAbbr) const; | 51 FX_BOOL bAbbr) const; |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 CXML_Element* m_pLocaleData; | 54 CXML_Element* m_pLocaleData; |
| 52 }; | 55 }; |
| 56 |
| 53 class CXFA_NodeLocale : public IFX_Locale { | 57 class CXFA_NodeLocale : public IFX_Locale { |
| 54 public: | 58 public: |
| 55 CXFA_NodeLocale(CXFA_Node* pLocale); | 59 CXFA_NodeLocale(CXFA_Node* pLocale); |
| 56 virtual void Release(); | |
| 57 virtual CFX_WideString GetName(); | |
| 58 virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, | |
| 59 CFX_WideString& wsNumSymbol) const; | |
| 60 | 60 |
| 61 virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const; | 61 // IFX_Locale |
| 62 virtual void GetMonthName(int32_t nMonth, | 62 void Release() override; |
| 63 CFX_WideString& wsMonthName, | 63 CFX_WideString GetName() override; |
| 64 FX_BOOL bAbbr = TRUE) const; | 64 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, |
| 65 virtual void GetDayName(int32_t nWeek, | 65 CFX_WideString& wsNumSymbol) const override; |
| 66 CFX_WideString& wsDayName, | |
| 67 FX_BOOL bAbbr = TRUE) const; | |
| 68 virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, | |
| 69 FX_BOOL bAM = TRUE) const; | |
| 70 virtual void GetTimeZone(FX_TIMEZONE& tz) const; | |
| 71 virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const; | |
| 72 | 66 |
| 73 virtual void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, | 67 void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override; |
| 74 CFX_WideString& wsPattern) const; | 68 void GetMonthName(int32_t nMonth, |
| 75 virtual void GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, | 69 CFX_WideString& wsMonthName, |
| 76 CFX_WideString& wsPattern) const; | 70 FX_BOOL bAbbr = TRUE) const override; |
| 77 virtual void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, | 71 void GetDayName(int32_t nWeek, |
| 78 CFX_WideString& wsPattern) const; | 72 CFX_WideString& wsDayName, |
| 73 FX_BOOL bAbbr = TRUE) const override; |
| 74 void GetMeridiemName(CFX_WideString& wsMeridiemName, |
| 75 FX_BOOL bAM = TRUE) const override; |
| 76 void GetTimeZone(FX_TIMEZONE& tz) const override; |
| 77 void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const override; |
| 78 |
| 79 void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, |
| 80 CFX_WideString& wsPattern) const override; |
| 81 void GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, |
| 82 CFX_WideString& wsPattern) const override; |
| 83 void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, |
| 84 CFX_WideString& wsPattern) const override; |
| 79 | 85 |
| 80 protected: | 86 protected: |
| 81 ~CXFA_NodeLocale(); | 87 ~CXFA_NodeLocale() override; |
| 88 |
| 82 CXFA_Node* GetNodeByName(CXFA_Node* pParent, | 89 CXFA_Node* GetNodeByName(CXFA_Node* pParent, |
| 83 const CFX_WideStringC& wsName) const; | 90 const CFX_WideStringC& wsName) const; |
| 84 CFX_WideString GetSymbol(XFA_ELEMENT eElement, | 91 CFX_WideString GetSymbol(XFA_ELEMENT eElement, |
| 85 const CFX_WideStringC& symbol_type) const; | 92 const CFX_WideStringC& symbol_type) const; |
| 86 CFX_WideString GetCalendarSymbol(XFA_ELEMENT eElement, | 93 CFX_WideString GetCalendarSymbol(XFA_ELEMENT eElement, |
| 87 int index, | 94 int index, |
| 88 FX_BOOL bAbbr) const; | 95 FX_BOOL bAbbr) const; |
| 89 | 96 |
| 90 CXFA_Node* m_pLocale; | 97 CXFA_Node* m_pLocale; |
| 91 }; | 98 }; |
| 92 | 99 |
| 93 #endif // XFA_FXFA_PARSER_XFA_LOCALE_H_ | 100 #endif // XFA_FXFA_PARSER_XFA_LOCALE_H_ |
| OLD | NEW |