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

Side by Side Diff: xfa/fgas/localization/fgas_locale.h

Issue 2241863002: Clean up XFA locale and locale manager (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: small fix 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 unified diff | Download patch
« no previous file with comments | « no previous file | xfa/fxfa/parser/xfa_locale.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_FGAS_LOCALIZATION_FGAS_LOCALE_H_ 7 #ifndef XFA_FGAS_LOCALIZATION_FGAS_LOCALE_H_
8 #define XFA_FGAS_LOCALIZATION_FGAS_LOCALE_H_ 8 #define XFA_FGAS_LOCALIZATION_FGAS_LOCALE_H_
9 9
10 #include "core/fxcrt/include/fx_xml.h" 10 #include "core/fxcrt/include/fx_xml.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 enum FX_DATETIMETYPE { 47 enum FX_DATETIMETYPE {
48 FX_DATETIMETYPE_Unknown, 48 FX_DATETIMETYPE_Unknown,
49 FX_DATETIMETYPE_Date, 49 FX_DATETIMETYPE_Date,
50 FX_DATETIMETYPE_Time, 50 FX_DATETIMETYPE_Time,
51 FX_DATETIMETYPE_DateTime, 51 FX_DATETIMETYPE_DateTime,
52 FX_DATETIMETYPE_TimeDate, 52 FX_DATETIMETYPE_TimeDate,
53 }; 53 };
54 54
55 class IFX_Locale { 55 class IFX_Locale {
56 public: 56 public:
57 virtual ~IFX_Locale() {}
57 58
58 virtual ~IFX_Locale() {} 59 virtual CFX_WideString GetName() const = 0;
59 virtual void Release() = 0;
60
61 virtual CFX_WideString GetName() = 0;
62
63 virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, 60 virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType,
64 CFX_WideString& wsNumSymbol) const = 0; 61 CFX_WideString& wsNumSymbol) const = 0;
65 virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const = 0; 62 virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const = 0;
66 virtual void GetMonthName(int32_t nMonth, 63 virtual void GetMonthName(int32_t nMonth,
67 CFX_WideString& wsMonthName, 64 CFX_WideString& wsMonthName,
68 FX_BOOL bAbbr = TRUE) const = 0; 65 FX_BOOL bAbbr = TRUE) const = 0;
69 virtual void GetDayName(int32_t nWeek, 66 virtual void GetDayName(int32_t nWeek,
70 CFX_WideString& wsDayName, 67 CFX_WideString& wsDayName,
71 FX_BOOL bAbbr = TRUE) const = 0; 68 FX_BOOL bAbbr = TRUE) const = 0;
72 virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, 69 virtual void GetMeridiemName(CFX_WideString& wsMeridiemName,
73 FX_BOOL bAM = TRUE) const = 0; 70 FX_BOOL bAM = TRUE) const = 0;
74 virtual void GetTimeZone(FX_TIMEZONE& tz) const = 0; 71 virtual void GetTimeZone(FX_TIMEZONE& tz) const = 0;
75 virtual void GetEraName(CFX_WideString& wsEraName, 72 virtual void GetEraName(CFX_WideString& wsEraName,
76 FX_BOOL bAD = TRUE) const = 0; 73 FX_BOOL bAD = TRUE) const = 0;
77 virtual void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, 74 virtual void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType,
78 CFX_WideString& wsPattern) const = 0; 75 CFX_WideString& wsPattern) const = 0;
79 virtual void GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType, 76 virtual void GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType,
80 CFX_WideString& wsPattern) const = 0; 77 CFX_WideString& wsPattern) const = 0;
81 virtual void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, 78 virtual void GetNumPattern(FX_LOCALENUMSUBCATEGORY eType,
82 CFX_WideString& wsPattern) const = 0; 79 CFX_WideString& wsPattern) const = 0;
83 }; 80 };
84 81
85 class IFX_LocaleMgr { 82 class IFX_LocaleMgr {
86 public: 83 public:
87 virtual ~IFX_LocaleMgr() {} 84 virtual ~IFX_LocaleMgr() {}
88 virtual void Release() = 0; 85
89 virtual uint16_t GetDefLocaleID() = 0; 86 virtual uint16_t GetDefLocaleID() const = 0;
90 virtual IFX_Locale* GetDefLocale() = 0; 87 virtual IFX_Locale* GetDefLocale() = 0;
91 virtual IFX_Locale* GetLocale(uint16_t lcid) = 0;
92 virtual IFX_Locale* GetLocaleByName(const CFX_WideString& wsLocaleName) = 0; 88 virtual IFX_Locale* GetLocaleByName(const CFX_WideString& wsLocaleName) = 0;
89
90 protected:
91 virtual std::unique_ptr<IFX_Locale> GetLocale(uint16_t lcid) = 0;
93 }; 92 };
94 93
95 FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, 94 FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate,
96 CFX_Unitime& datetime); 95 CFX_Unitime& datetime);
97 FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime, 96 FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
98 CFX_Unitime& datetime, 97 CFX_Unitime& datetime,
99 IFX_Locale* pLocale); 98 IFX_Locale* pLocale);
100 class CFX_Decimal { 99 class CFX_Decimal {
101 public: 100 public:
102 CFX_Decimal(); 101 CFX_Decimal();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 CFX_Decimal Multiply(const CFX_Decimal& val) const; 141 CFX_Decimal Multiply(const CFX_Decimal& val) const;
143 CFX_Decimal Divide(const CFX_Decimal& val) const; 142 CFX_Decimal Divide(const CFX_Decimal& val) const;
144 CFX_Decimal Modulus(const CFX_Decimal& val) const; 143 CFX_Decimal Modulus(const CFX_Decimal& val) const;
145 uint32_t m_uFlags; 144 uint32_t m_uFlags;
146 uint32_t m_uHi; 145 uint32_t m_uHi;
147 uint32_t m_uLo; 146 uint32_t m_uLo;
148 uint32_t m_uMid; 147 uint32_t m_uMid;
149 }; 148 };
150 149
151 #endif // XFA_FGAS_LOCALIZATION_FGAS_LOCALE_H_ 150 #endif // XFA_FGAS_LOCALIZATION_FGAS_LOCALE_H_
OLDNEW
« no previous file with comments | « no previous file | xfa/fxfa/parser/xfa_locale.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698