N_SE-53194 : fix AppControl::Stop() without listener
[platform/framework/native/appfw.git] / src / locales / FLcl_DateTimeSymbolsImpl.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FLcl_DateTimeSymbolsImpl.h
19  * @brief       This is the header file for the _DateTimeSymbolsImpl class.
20  *
21  * This header file contains the declarations of the _DateTimeSymbolsImpl class.
22  *
23  */
24 #ifndef _FLCL_INTERNAL_DATE_TIME_SYMBOLS_IMPL_H_
25 #define _FLCL_INTERNAL_DATE_TIME_SYMBOLS_IMPL_H_
26
27
28 // Includes
29 #include <unicode/dtfmtsym.h>
30
31 #include <FBaseColArrayList.h>
32 #include <FBaseColHashMap.h>
33 #include <FLclLocale.h>
34 #include <FLclCalendar.h>
35
36 namespace U_ICU_NAMESPACE
37 {
38         class UnicodeString;
39         class DateFormatSymbols;
40 }
41
42 namespace Tizen { namespace Locales
43 {
44
45 class DateTimeSymbols;
46
47 enum DateFormatSymbolsAttributes
48 {
49         DATE_FORMAT_SYM_ERA_LIST,
50         DATE_FORMAT_SYM_MONTH_LIST,
51         DATE_FORMAT_SYM_SHORT_MONTH_LIST,
52         DATE_FORMAT_SYM_WEEKDAY_LIST,
53         DATE_FORMAT_SYM_SHORT_WEEKDAY_LIST,
54         DATE_FORMAT_SYM_AM_PM_LIST,
55         DATE_FORMAT_SYM_TIMEZONE_MAP,
56
57         DATE_FORMAT_SYM_INVALID
58 };
59
60 class _DateTimeSymbolsImpl
61         : public Tizen::Base::Object
62 {
63
64 public:
65         _DateTimeSymbolsImpl(void);
66         virtual ~_DateTimeSymbolsImpl(void);
67
68         result Initialize(CalendarType calendarType = CALENDAR_GREGORIAN);
69         result Initialize(const Locale& locale, CalendarType calendarType = CALENDAR_GREGORIAN);
70         void Set(const _DateTimeSymbolsImpl* other);
71
72
73         result AddTimeZoneName(const Tizen::Base::String& timeZoneId, const Tizen::Base::String& concatenatedTimeZoneName, bool isOverwrite = false);
74
75         const Tizen::Base::Collection::IList* GetEras(void) const;
76         result SetEras(const Tizen::Base::String& eras);
77         const Tizen::Base::Collection::IList* GetMonths(void) const;
78         result SetMonths(const Tizen::Base::String& months);
79         const Tizen::Base::Collection::IList* GetShortMonths(void) const;
80         result SetShortMonths(const Tizen::Base::String& shortMonths);
81         const Tizen::Base::Collection::IList* GetWeekdays(void) const;
82         result SetWeekdays(const Tizen::Base::String& weekdays);
83         const Tizen::Base::Collection::IList* GetShortWeekdays(void) const;
84         result SetShortWeekdays(const Tizen::Base::String& shortWeekdays);
85         const Tizen::Base::Collection::IList* GetAmPm(void) const;
86         result SetAmPm(const Tizen::Base::String& amPm);
87
88         Tizen::Base::String GetTimeZoneName(Tizen::Base::String& timeZoneId, int timeZoneStyle = 0);
89         result SetTimeZoneName(const Tizen::Base::String& timeZoneId, const Tizen::Base::String& concatenatedTimeZoneName);
90
91         Tizen::Base::Collection::IList* CloneArrayListN(const Tizen::Base::Collection::IList* pList) const;
92         Tizen::Base::Collection::IMultiMap* CloneMultiHashMapN(const Tizen::Base::Collection::IMultiMap* pMap) const;
93         result SetList(Tizen::Base::Collection::ArrayList* pArraylist, int tokenCount, const Tizen::Base::String& stringWillBeTokenized);
94
95         void ReleaseList(Tizen::Base::Collection::IList* pList);
96         void ReleaseAll();
97
98         U_ICU_NAMESPACE::DateFormatSymbols* GetIcuSymbols(void);
99         static _DateTimeSymbolsImpl* GetDateTimeSymbolsImpl(DateTimeSymbols* pDateTimeSymbols);
100
101 private:
102         _DateTimeSymbolsImpl(const _DateTimeSymbolsImpl& dateTimeSymbolsImpl);
103         _DateTimeSymbolsImpl& operator =(const _DateTimeSymbolsImpl& dateTimeSymbolsImpl);
104
105         Tizen::Base::Collection::IList* GetSymbolAttributeArrayN(DateFormatSymbolsAttributes attributeName);
106
107 private:
108         Tizen::Base::Collection::IList* __pErasList;
109         Tizen::Base::Collection::IList* __pMonthsList;
110         Tizen::Base::Collection::IList* __pShortMonthsList;
111         Tizen::Base::Collection::IList* __pWeekdaysList;
112         Tizen::Base::Collection::IList* __pShortWeekdaysList;
113         Tizen::Base::Collection::IList* __pAmPmList;
114         Tizen::Base::Collection::IMultiMap* __pTimeZonesMap;
115         U_ICU_NAMESPACE::DateFormatSymbols* __pIcuDateFormatSymbols;
116
117         CalendarType __CalendarType;
118
119         friend class DateTimeSymbols;
120         friend class DateTimeFormatter;
121         friend class _LocaleData;
122 }; // _DateTimeSymbolsImpl
123
124 }} // Tizen::Locales
125
126 #endif //_FLCL_INTERNAL_DATE_TIME_SYMBOLS_IMPL_H_
127