• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_FXFA_PARSER_CXFA_XMLLOCALE_H_
8 #define XFA_FXFA_PARSER_CXFA_XMLLOCALE_H_
9 
10 #include <memory>
11 
12 #include "core/fxcrt/ifx_locale.h"
13 
14 class CXML_Element;
15 
16 class CXFA_XMLLocale : public IFX_Locale {
17  public:
18   explicit CXFA_XMLLocale(std::unique_ptr<CXML_Element> pLocaleData);
19   ~CXFA_XMLLocale() override;
20 
21   // IFX_Locale
22   WideString GetName() const override;
23   WideString GetNumbericSymbol(FX_LOCALENUMSYMBOL eType) const override;
24 
25   WideString GetDateTimeSymbols() const override;
26   WideString GetMonthName(int32_t nMonth, bool bAbbr) const override;
27   WideString GetDayName(int32_t nWeek, bool bAbbr) const override;
28   WideString GetMeridiemName(bool bAM) const override;
29   FX_TIMEZONE GetTimeZone() const override;
30   WideString GetEraName(bool bAD) const override;
31 
32   WideString GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType) const override;
33   WideString GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType) const override;
34   WideString GetNumPattern(FX_LOCALENUMSUBCATEGORY eType) const override;
35 
36  private:
37   WideString GetPattern(CXML_Element* pElement,
38                         const ByteStringView& bsTag,
39                         const WideStringView& wsName) const;
40   WideString GetCalendarSymbol(const ByteStringView& symbol,
41                                int index,
42                                bool bAbbr) const;
43 
44   std::unique_ptr<CXML_Element> m_pLocaleData;
45 };
46 
47 #endif  // XFA_FXFA_PARSER_CXFA_XMLLOCALE_H_
48