• 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 CORE_FXCRT_IFX_LOCALE_H_
8 #define CORE_FXCRT_IFX_LOCALE_H_
9 
10 #include "core/fxcrt/cfx_datetime.h"
11 #include "core/fxcrt/fx_string.h"
12 
13 enum FX_LOCALENUMSYMBOL {
14   FX_LOCALENUMSYMBOL_Decimal,
15   FX_LOCALENUMSYMBOL_Grouping,
16   FX_LOCALENUMSYMBOL_Percent,
17   FX_LOCALENUMSYMBOL_Minus,
18   FX_LOCALENUMSYMBOL_Zero,
19   FX_LOCALENUMSYMBOL_CurrencySymbol,
20   FX_LOCALENUMSYMBOL_CurrencyName,
21 };
22 
23 enum FX_LOCALEDATETIMESUBCATEGORY {
24   FX_LOCALEDATETIMESUBCATEGORY_Default,
25   FX_LOCALEDATETIMESUBCATEGORY_Short,
26   FX_LOCALEDATETIMESUBCATEGORY_Medium,
27   FX_LOCALEDATETIMESUBCATEGORY_Full,
28   FX_LOCALEDATETIMESUBCATEGORY_Long,
29 };
30 
31 enum FX_LOCALENUMSUBCATEGORY {
32   FX_LOCALENUMPATTERN_Percent,
33   FX_LOCALENUMPATTERN_Currency,
34   FX_LOCALENUMPATTERN_Decimal,
35   FX_LOCALENUMPATTERN_Integer,
36 };
37 
38 enum FX_LOCALECATEGORY {
39   FX_LOCALECATEGORY_Unknown,
40   FX_LOCALECATEGORY_Date,
41   FX_LOCALECATEGORY_Time,
42   FX_LOCALECATEGORY_DateTime,
43   FX_LOCALECATEGORY_Num,
44   FX_LOCALECATEGORY_Text,
45   FX_LOCALECATEGORY_Zero,
46   FX_LOCALECATEGORY_Null,
47 };
48 
49 enum FX_DATETIMETYPE {
50   FX_DATETIMETYPE_Unknown,
51   FX_DATETIMETYPE_Date,
52   FX_DATETIMETYPE_Time,
53   FX_DATETIMETYPE_DateTime,
54   FX_DATETIMETYPE_TimeDate,
55 };
56 
57 class IFX_Locale {
58  public:
~IFX_Locale()59   virtual ~IFX_Locale() {}
60 
61   virtual WideString GetName() const = 0;
62   virtual WideString GetNumbericSymbol(FX_LOCALENUMSYMBOL eType) const = 0;
63   virtual WideString GetDateTimeSymbols() const = 0;
64   virtual WideString GetMonthName(int32_t nMonth, bool bAbbr) const = 0;
65   virtual WideString GetDayName(int32_t nWeek, bool bAbbr) const = 0;
66   virtual WideString GetMeridiemName(bool bAM) const = 0;
67   virtual FX_TIMEZONE GetTimeZone() const = 0;
68   virtual WideString GetEraName(bool bAD) const = 0;
69   virtual WideString GetDatePattern(
70       FX_LOCALEDATETIMESUBCATEGORY eType) const = 0;
71   virtual WideString GetTimePattern(
72       FX_LOCALEDATETIMESUBCATEGORY eType) const = 0;
73   virtual WideString GetNumPattern(FX_LOCALENUMSUBCATEGORY eType) const = 0;
74 };
75 
76 #endif  // CORE_FXCRT_IFX_LOCALE_H_
77