2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FLcl_IcuCalendarImpl.h
19 * @brief This is the header file for the _IcuCalendarImpl class.
21 * This header file contains the declarations of the _IcuCalendarImpl class.
25 #ifndef _FLCL_INTERNAL_ICU_CALENDAR_IMPL_H_
26 #define _FLCL_INTERNAL_ICU_CALENDAR_IMPL_H_
28 #include <unicode/uversion.h>
30 namespace U_ICU_NAMESPACE
38 namespace Tizen { namespace Locales
41 class _IcuCalendarImpl
45 virtual ~_IcuCalendarImpl();
47 virtual result Construct(const TimeZone& timeZone, const Locale& locale, int calendarType);
48 virtual _IcuCalendarImpl* CloneN(void);
50 // Date & Time Clear/ Get/ Set methods
52 virtual result Clear(void);
53 virtual result Clear(int field);
55 virtual result AddTimeField(int field, int amount); // Affect all fields
56 virtual result Roll(int field, int amount); // Does not affect higher fields
57 virtual result SetTime(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0);
59 virtual int GetTimeField(int field) const;
60 virtual result SetTimeField(int field, int value);
62 virtual result GetTimeInMillisec(long long& millisec) const;
63 virtual result SetTimeInMillisec(long long millisec);
65 virtual int GetMaxTimeField(int field) const;
66 virtual int GetMinTimeField(int field) const;
69 virtual result After(const _IcuCalendarImpl& otherInstance, bool& after);
70 virtual result Before(const _IcuCalendarImpl& otherInstance, bool& before);
71 virtual bool Equals(const _IcuCalendarImpl& otherInstance);
73 // Methods to get properties
74 virtual int GetHashCode(void) const;
76 virtual int GetActualMinTimeField(int field) const;
77 virtual int GetGreatestMinTimeField(int field) const;
78 virtual int GetLeastMaxTimeField(int field) const;
79 virtual int GetActualMaxTimeField(int field) const;
81 virtual bool IsSet(int field) const;
82 virtual result IsInDst(bool& isInDst) const;
83 virtual bool IsLeapYear(int year) const; // defined for GregorianCalendar
85 virtual bool IsLenient(void) const;
86 virtual result SetLenient(bool lenient);
88 virtual result SetFirstDayOfWeek(int dayOfWeek);
89 virtual int GetFirstDayOfWeek(void) const;
91 virtual int GetMinDaysInFirstWeek(void) const;
92 virtual result SetMinDaysInFirstWeek(short value);
94 virtual result SetTimeZone(const TimeZone& timeZone);
95 // virtual TimeZone GetTimeZone(void) const;
97 // For Gregorian Calendar
98 virtual long long GetGregorianChange(void) const;
99 virtual result SetGregorianChange(long long change);
101 virtual int GetJulianDay(void) const;
102 virtual result SetJulianDay(int julianDay);
104 U_ICU_NAMESPACE::Calendar* GetIcuCalendarCloneN(void) const;
107 _IcuCalendarImpl(const _IcuCalendarImpl& orig);
108 _IcuCalendarImpl& operator =(const _IcuCalendarImpl& orig);
110 result GetOspException(U_ICU_NAMESPACE::ErrorCode icuException) const;
112 int GetIcuTimeField(int field) const;
113 int ConvertFromOspTimeFieldValue(int field, int value) const;
114 int ConvertToOspTimeFieldValue(int field, int value) const;
116 // UCalendarDaysOfWeek GetIcuDayOfWeek(DayOfWeek dayOfWeek) const;
117 // DayOfWeek GetOspDayOfWeek(UCalendarDaysOfWeek dayOfWeek) const;
119 U_ICU_NAMESPACE::Locale GetIcuLocale(const Locale& ospLocale, int type) const;
120 U_ICU_NAMESPACE::SimpleTimeZone* GetIcuTimeZone(const TimeZone& ospTimeZone) const;
122 void CheckInputFieldValueForOverFlow(int field, int value);
123 result ValidateFieldsForOverFlow(void) const;
126 class U_ICU_NAMESPACE::Calendar* __pIcuCalendar;
128 bool __isEraFieldOverFlowed;
133 #endif // _FLCL_INTERNAL_ICU_CALENDAR_IMPL_H_