OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 // We should use this class only for LocalizedNumberICU.cpp, LocalizedDateICU.cp
p, | 45 // We should use this class only for LocalizedNumberICU.cpp, LocalizedDateICU.cp
p, |
46 // and LocalizedNumberICUTest.cpp. | 46 // and LocalizedNumberICUTest.cpp. |
47 class PLATFORM_EXPORT LocaleICU : public Locale { | 47 class PLATFORM_EXPORT LocaleICU : public Locale { |
48 public: | 48 public: |
49 static PassOwnPtr<LocaleICU> create(const char* localeString); | 49 static PassOwnPtr<LocaleICU> create(const char* localeString); |
50 virtual ~LocaleICU(); | 50 virtual ~LocaleICU(); |
51 | 51 |
52 #if ENABLE(CALENDAR_PICKER) | |
53 virtual const Vector<String>& weekDayShortLabels() OVERRIDE; | 52 virtual const Vector<String>& weekDayShortLabels() OVERRIDE; |
54 virtual unsigned firstDayOfWeek() OVERRIDE; | 53 virtual unsigned firstDayOfWeek() OVERRIDE; |
55 virtual bool isRTL() OVERRIDE; | 54 virtual bool isRTL() OVERRIDE; |
56 #endif | |
57 virtual String dateFormat() OVERRIDE; | 55 virtual String dateFormat() OVERRIDE; |
58 virtual String monthFormat() OVERRIDE; | 56 virtual String monthFormat() OVERRIDE; |
59 virtual String shortMonthFormat() OVERRIDE; | 57 virtual String shortMonthFormat() OVERRIDE; |
60 virtual String timeFormat() OVERRIDE; | 58 virtual String timeFormat() OVERRIDE; |
61 virtual String shortTimeFormat() OVERRIDE; | 59 virtual String shortTimeFormat() OVERRIDE; |
62 virtual String dateTimeFormatWithSeconds() OVERRIDE; | 60 virtual String dateTimeFormatWithSeconds() OVERRIDE; |
63 virtual String dateTimeFormatWithoutSeconds() OVERRIDE; | 61 virtual String dateTimeFormatWithoutSeconds() OVERRIDE; |
64 virtual const Vector<String>& monthLabels() OVERRIDE; | 62 virtual const Vector<String>& monthLabels() OVERRIDE; |
65 virtual const Vector<String>& shortMonthLabels() OVERRIDE; | 63 virtual const Vector<String>& shortMonthLabels() OVERRIDE; |
66 virtual const Vector<String>& standAloneMonthLabels() OVERRIDE; | 64 virtual const Vector<String>& standAloneMonthLabels() OVERRIDE; |
67 virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE; | 65 virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE; |
68 virtual const Vector<String>& timeAMPMLabels() OVERRIDE; | 66 virtual const Vector<String>& timeAMPMLabels() OVERRIDE; |
69 | 67 |
70 private: | 68 private: |
71 explicit LocaleICU(const char*); | 69 explicit LocaleICU(const char*); |
72 String decimalSymbol(UNumberFormatSymbol); | 70 String decimalSymbol(UNumberFormatSymbol); |
73 String decimalTextAttribute(UNumberFormatTextAttribute); | 71 String decimalTextAttribute(UNumberFormatTextAttribute); |
74 virtual void initializeLocaleData() OVERRIDE; | 72 virtual void initializeLocaleData() OVERRIDE; |
75 | 73 |
76 bool detectSignAndGetDigitRange(const String& input, bool& isNegative, unsig
ned& startIndex, unsigned& endIndex); | 74 bool detectSignAndGetDigitRange(const String& input, bool& isNegative, unsig
ned& startIndex, unsigned& endIndex); |
77 unsigned matchedDecimalSymbolIndex(const String& input, unsigned& position); | 75 unsigned matchedDecimalSymbolIndex(const String& input, unsigned& position); |
78 | 76 |
79 bool initializeShortDateFormat(); | 77 bool initializeShortDateFormat(); |
80 UDateFormat* openDateFormat(UDateFormatStyle timeStyle, UDateFormatStyle dat
eStyle) const; | 78 UDateFormat* openDateFormat(UDateFormatStyle timeStyle, UDateFormatStyle dat
eStyle) const; |
81 | 79 |
82 #if ENABLE(CALENDAR_PICKER) | |
83 void initializeCalendar(); | 80 void initializeCalendar(); |
84 #endif | |
85 | 81 |
86 PassOwnPtr<Vector<String> > createLabelVector(const UDateFormat*, UDateForma
tSymbolType, int32_t startIndex, int32_t size); | 82 PassOwnPtr<Vector<String> > createLabelVector(const UDateFormat*, UDateForma
tSymbolType, int32_t startIndex, int32_t size); |
87 void initializeDateTimeFormat(); | 83 void initializeDateTimeFormat(); |
88 | 84 |
89 CString m_locale; | 85 CString m_locale; |
90 UNumberFormat* m_numberFormat; | 86 UNumberFormat* m_numberFormat; |
91 UDateFormat* m_shortDateFormat; | 87 UDateFormat* m_shortDateFormat; |
92 bool m_didCreateDecimalFormat; | 88 bool m_didCreateDecimalFormat; |
93 bool m_didCreateShortDateFormat; | 89 bool m_didCreateShortDateFormat; |
94 | 90 |
95 #if ENABLE(CALENDAR_PICKER) | |
96 OwnPtr<Vector<String> > m_weekDayShortLabels; | 91 OwnPtr<Vector<String> > m_weekDayShortLabels; |
97 unsigned m_firstDayOfWeek; | 92 unsigned m_firstDayOfWeek; |
98 #endif | |
99 OwnPtr<Vector<String> > m_monthLabels; | 93 OwnPtr<Vector<String> > m_monthLabels; |
100 String m_dateFormat; | 94 String m_dateFormat; |
101 String m_monthFormat; | 95 String m_monthFormat; |
102 String m_shortMonthFormat; | 96 String m_shortMonthFormat; |
103 String m_timeFormatWithSeconds; | 97 String m_timeFormatWithSeconds; |
104 String m_timeFormatWithoutSeconds; | 98 String m_timeFormatWithoutSeconds; |
105 String m_dateTimeFormatWithSeconds; | 99 String m_dateTimeFormatWithSeconds; |
106 String m_dateTimeFormatWithoutSeconds; | 100 String m_dateTimeFormatWithoutSeconds; |
107 UDateFormat* m_mediumTimeFormat; | 101 UDateFormat* m_mediumTimeFormat; |
108 UDateFormat* m_shortTimeFormat; | 102 UDateFormat* m_shortTimeFormat; |
109 Vector<String> m_shortMonthLabels; | 103 Vector<String> m_shortMonthLabels; |
110 Vector<String> m_standAloneMonthLabels; | 104 Vector<String> m_standAloneMonthLabels; |
111 Vector<String> m_shortStandAloneMonthLabels; | 105 Vector<String> m_shortStandAloneMonthLabels; |
112 Vector<String> m_timeAMPMLabels; | 106 Vector<String> m_timeAMPMLabels; |
113 bool m_didCreateTimeFormat; | 107 bool m_didCreateTimeFormat; |
114 }; | 108 }; |
115 | 109 |
116 } // namespace WebCore | 110 } // namespace WebCore |
117 #endif | 111 #endif |
OLD | NEW |