| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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 XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ | |
| 8 #define XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ | |
| 9 | |
| 10 #include "xfa/src/fgas/localization/fgas_locale.h" | |
| 11 | |
| 12 class CFX_LCNumeric; | |
| 13 | |
| 14 class CFX_Locale : public IFX_Locale { | |
| 15 public: | |
| 16 CFX_Locale(CXML_Element* pLocaleData); | |
| 17 virtual void Release() { delete this; } | |
| 18 | |
| 19 virtual CFX_WideString GetName(); | |
| 20 virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, | |
| 21 CFX_WideString& wsNumSymbol) const; | |
| 22 | |
| 23 virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const; | |
| 24 virtual void GetMonthName(int32_t nMonth, | |
| 25 CFX_WideString& wsMonthName, | |
| 26 FX_BOOL bAbbr = TRUE) const; | |
| 27 virtual void GetDayName(int32_t nWeek, | |
| 28 CFX_WideString& wsDayName, | |
| 29 FX_BOOL bAbbr = TRUE) const; | |
| 30 virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, | |
| 31 FX_BOOL bAM = TRUE) const; | |
| 32 virtual void GetTimeZone(FX_TIMEZONE& tz) const; | |
| 33 virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const; | |
| 34 | |
| 35 virtual void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, | |
| 36 CFX_WideString& wsPattern) const; | |
| 37 virtual void GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, | |
| 38 CFX_WideString& wsPattern) const; | |
| 39 virtual void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, | |
| 40 CFX_WideString& wsPattern) const; | |
| 41 | |
| 42 protected: | |
| 43 virtual ~CFX_Locale(); | |
| 44 CXML_Element* m_pElement; | |
| 45 }; | |
| 46 | |
| 47 class CFX_FormatString : public IFX_FormatString { | |
| 48 public: | |
| 49 CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, FX_BOOL bUseLCID); | |
| 50 virtual void Release() { delete this; } | |
| 51 | |
| 52 virtual void SplitFormatString(const CFX_WideString& wsFormatString, | |
| 53 CFX_WideStringArray& wsPatterns); | |
| 54 virtual FX_LOCALECATEGORY GetCategory(const CFX_WideString& wsPattern); | |
| 55 virtual FX_WORD GetLCID(const CFX_WideString& wsPattern); | |
| 56 virtual CFX_WideString GetLocaleName(const CFX_WideString& wsPattern); | |
| 57 virtual FX_BOOL ParseText(const CFX_WideString& wsSrcText, | |
| 58 const CFX_WideString& wsPattern, | |
| 59 CFX_WideString& wsValue); | |
| 60 virtual FX_BOOL ParseNum(const CFX_WideString& wsSrcNum, | |
| 61 const CFX_WideString& wsPattern, | |
| 62 FX_FLOAT& fValue); | |
| 63 virtual FX_BOOL ParseNum(const CFX_WideString& wsSrcNum, | |
| 64 const CFX_WideString& wsPattern, | |
| 65 CFX_WideString& wsValue); | |
| 66 virtual FX_BOOL ParseDateTime(const CFX_WideString& wsSrcDateTime, | |
| 67 const CFX_WideString& wsPattern, | |
| 68 FX_DATETIMETYPE eDateTimeType, | |
| 69 CFX_Unitime& dtValue); | |
| 70 virtual FX_BOOL ParseZero(const CFX_WideString& wsSrcText, | |
| 71 const CFX_WideString& wsPattern); | |
| 72 virtual FX_BOOL ParseNull(const CFX_WideString& wsSrcText, | |
| 73 const CFX_WideString& wsPattern); | |
| 74 virtual FX_BOOL FormatText(const CFX_WideString& wsSrcText, | |
| 75 const CFX_WideString& wsPattern, | |
| 76 CFX_WideString& wsOutput); | |
| 77 virtual FX_BOOL FormatNum(const CFX_WideString& wsSrcNum, | |
| 78 const CFX_WideString& wsPattern, | |
| 79 CFX_WideString& wsOutput); | |
| 80 virtual FX_BOOL FormatNum(FX_FLOAT fNum, | |
| 81 const CFX_WideString& wsPattern, | |
| 82 CFX_WideString& wsOutput); | |
| 83 virtual FX_BOOL FormatDateTime(const CFX_WideString& wsSrcDateTime, | |
| 84 const CFX_WideString& wsPattern, | |
| 85 CFX_WideString& wsOutput); | |
| 86 virtual FX_BOOL FormatDateTime(const CFX_WideString& wsSrcDateTime, | |
| 87 const CFX_WideString& wsPattern, | |
| 88 CFX_WideString& wsOutput, | |
| 89 FX_DATETIMETYPE eDateTimeType); | |
| 90 virtual FX_BOOL FormatDateTime(const CFX_Unitime& dt, | |
| 91 const CFX_WideString& wsPattern, | |
| 92 CFX_WideString& wsOutput); | |
| 93 virtual FX_BOOL FormatZero(const CFX_WideString& wsPattern, | |
| 94 CFX_WideString& wsOutput); | |
| 95 virtual FX_BOOL FormatNull(const CFX_WideString& wsPattern, | |
| 96 CFX_WideString& wsOutput); | |
| 97 | |
| 98 protected: | |
| 99 virtual ~CFX_FormatString(); | |
| 100 IFX_Locale* GetTextFormat(const CFX_WideString& wsPattern, | |
| 101 const CFX_WideStringC& wsCategory, | |
| 102 CFX_WideString& wsPurgePattern); | |
| 103 IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, | |
| 104 int32_t& iDotIndex, | |
| 105 FX_DWORD& dwStyle, | |
| 106 CFX_WideString& wsPurgePattern); | |
| 107 FX_BOOL FormatStrNum(const CFX_WideStringC& wsInputNum, | |
| 108 const CFX_WideString& wsPattern, | |
| 109 CFX_WideString& wsOutput); | |
| 110 FX_BOOL FormatLCNumeric(CFX_LCNumeric& lcNum, | |
| 111 const CFX_WideString& wsPattern, | |
| 112 CFX_WideString& wsOutput); | |
| 113 FX_DATETIMETYPE GetDateTimeFormat(const CFX_WideString& wsPattern, | |
| 114 IFX_Locale*& pLocale, | |
| 115 CFX_WideString& wsDatePattern, | |
| 116 CFX_WideString& wsTimePattern); | |
| 117 IFX_Locale* GetPatternLocale(const CFX_WideStringC& wsLocale); | |
| 118 IFX_LocaleMgr* m_pLocaleMgr; | |
| 119 FX_BOOL m_bUseLCID; | |
| 120 }; | |
| 121 | |
| 122 #endif // XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ | |
| OLD | NEW |