Merge "Change the way to conver Mbs to Wcs and vice versa" into tizen_2.1
[platform/framework/native/appfw.git] / src / locales / FLcl_CalendarImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file     FLcl_CalendarImpl.cpp
20  * @brief    This is the implementation file for _CalendarImpl class.
21  */
22
23 #include <new>
24 #include <unique_ptr.h>
25
26 #include <FBaseDateTime.h>
27 #include <FBaseSysLog.h>
28 #include <FApp_AppInfo.h>
29 #include <FLclGregorianCalendar.h>
30
31 #include "FLcl_CalendarImpl.h"
32 #include "FLcl_IcuCalendarImpl.h"
33 #include "FLcl_LocaleData.h"
34 #include "FLcl_LocaleImpl.h"
35 #include "FLcl_LocaleManagerImpl.h"
36
37 using namespace Tizen::Base;
38
39 namespace Tizen { namespace Locales
40 {
41
42 static const int ONE_MINUTE_IN_MILLISEC = 60000;
43
44 _CalendarImpl::_CalendarImpl()
45         : __type(CALENDAR_GREGORIAN)
46         , __locale(LANGUAGE_INVALID, COUNTRY_INVALID)
47         , __timezone()
48         , __pCalendar(null)
49 {
50 }
51
52 _CalendarImpl::~_CalendarImpl()
53 {
54         delete __pCalendar;
55         __pCalendar = null;
56 }
57
58
59 Calendar*
60 _CalendarImpl::CreateCalendarInstanceN(CalendarType calendarType)
61 {
62         return CreateInstanceN(TimeZone::GetGmtTimeZone(), calendarType);
63 }
64
65 Calendar*
66 _CalendarImpl::CreateCalendarInstanceN(const TimeZone& timeZone, CalendarType calendarType)
67 {
68         return CreateInstanceN(timeZone, _LocaleManagerImpl::GetSystemLocale(), calendarType);
69 }
70
71 Calendar*
72 _CalendarImpl::CreateCalendarInstanceN(const Locale& locale, CalendarType calendarType)
73 {
74         // Create calendar using system time zone and given locale and calendar type
75         return CreateInstanceN(TimeZone::GetGmtTimeZone(), locale, calendarType);
76 }
77
78 Calendar*
79 _CalendarImpl::CreateCalendarInstanceN(const TimeZone& timeZone, const Locale& locale, CalendarType calendarType)
80 {
81         ClearLastResult();
82         result r = E_SYSTEM;
83         switch (calendarType)
84         {
85         case CALENDAR_GREGORIAN:
86         {
87                 std::unique_ptr< GregorianCalendar > pGregCalendar(new (std::nothrow) GregorianCalendar);
88                 SysTryReturn(NID_LCL, pGregCalendar != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
89
90                 r = pGregCalendar->Construct(timeZone, locale);
91                 SysTryReturn(NID_LCL, !IsFailed(r), null, r, "[%s] Unable to construct calendar", GetErrorMessage(r));
92
93                 return pGregCalendar.release();
94         }
95
96         default:
97                 break;
98         }
99
100         std::unique_ptr< _CalendarImpl > pCalendar(new (std::nothrow) _CalendarImpl);
101         SysTryReturn(NID_LCL, pCalendar != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
102
103         r = pCalendar->Construct(timeZone, locale, calendarType);
104         SetLastResult(r);
105         SysTryReturn(NID_LCL, !IsFailed(r), null, r, "[%s] Unable to construct calendar", GetErrorMessage(r));
106         return pCalendar.release();
107 }
108
109 Calendar*
110 _CalendarImpl::CloneN(void) const
111 {
112         std::unique_ptr< _CalendarImpl > pCalendar(new (std::nothrow) _CalendarImpl());
113         SysTryReturn(NID_LCL, pCalendar != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
114
115         if (__pCalendar != null)
116         {
117                 pCalendar->__pCalendar = __pCalendar->CloneN();
118                 if (pCalendar->__pCalendar != null)
119                 {
120                         pCalendar->__type = __type;
121                         pCalendar->__locale = __locale;
122                         pCalendar->__timezone = __timezone;
123
124                         pCalendar->_pCalendarImpl = pCalendar.get();
125                 }
126         }
127
128         return pCalendar.release();
129 }
130
131 result
132 _CalendarImpl::Construct(CalendarType calendarType)
133 {
134         Locale defaultLocale = _LocaleManagerImpl::GetSystemLocale();
135         return Construct( TimeZone::GetGmtTimeZone(), defaultLocale, calendarType);
136 }
137
138 result
139 _CalendarImpl::Construct(const TimeZone& timezone, CalendarType calendarType)
140 {
141         Locale defaultLocale = _LocaleManagerImpl::GetSystemLocale();
142         return Construct(timezone, defaultLocale, calendarType);
143 }
144
145 result
146 _CalendarImpl::Construct(const Locale& locale, CalendarType calendarType)
147 {
148         TimeZone defaultTimeZone = TimeZone::GetGmtTimeZone();
149         return Construct(defaultTimeZone, locale, calendarType);
150 }
151
152 result
153 _CalendarImpl::Construct(const TimeZone& timeZone, const Locale& locale, CalendarType calendarType)
154 {
155         // Object is not allowed to construct twice
156         SysAssertf(__pCalendar == null,
157                            "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class");
158
159         SysTryReturnResult(NID_LCL, _LocaleImpl::IsSupported(locale), E_INVALID_ARG, "Given locale is not supported");
160
161         std::unique_ptr< _IcuCalendarImpl > pCalendar(new (std::nothrow) _IcuCalendarImpl);
162         SysTryReturnResult(NID_LCL, pCalendar != null, E_OUT_OF_MEMORY, "Memory allocation failed");
163
164         result r = pCalendar->Construct(timeZone, locale, calendarType);
165         if (!IsFailed(r))
166         {
167                 __pCalendar = pCalendar.release();
168                 __type = calendarType;
169                 __locale = locale;
170                 __timezone = timeZone;
171
172                 _pCalendarImpl = this;
173                 return E_SUCCESS;
174         }
175
176         return E_SYSTEM;
177 }
178
179 result
180 _CalendarImpl::Construct(const Calendar& otherCalendar)
181 {
182         // Object is not allowed to construct twice
183         SysAssertf(__pCalendar == null,
184                            "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class");
185
186         result r = E_SYSTEM;
187         const _CalendarImpl* pOtherCalendar = dynamic_cast< const _CalendarImpl* >(&otherCalendar);
188         if ((pOtherCalendar != null) && (pOtherCalendar->__pCalendar != null))
189         {
190                 delete __pCalendar;
191
192                 __pCalendar = pOtherCalendar->__pCalendar->CloneN();
193                 if (__pCalendar != null)
194                 {
195                         __type = pOtherCalendar->__type;
196                         __locale = pOtherCalendar->__locale;
197                         __timezone = pOtherCalendar->__timezone;
198
199                         _pCalendarImpl = pOtherCalendar->_pCalendarImpl;
200                         return E_SUCCESS;
201                 }
202                 r = GetLastResult();
203         }
204         return r;
205 }
206
207 result
208 _CalendarImpl::SetTimeFieldImpl(TimeField field, int value)
209 {
210         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
211         SysTryReturnResult(NID_LCL, ValidateTimeField(field),
212                         E_INVALID_ARG, "Invalid argument is used. Timefield is less than 0 or grater than time field count.");
213         SysTryReturnResult(NID_LCL, ValidateTimeFieldValue(field, value), E_OUT_OF_RANGE, "value(%d) is out of range.", value);
214
215         return __pCalendar->SetTimeField(field, value);
216 }
217
218 result
219 _CalendarImpl::SetTimeInMillisecImpl(long long millisec)
220 {
221         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
222         return __pCalendar->SetTimeInMillisec(millisec - __timezone.GetRawOffset() * ONE_MINUTE_IN_MILLISEC);
223 }
224
225 result
226 _CalendarImpl::SetTimeImpl(const DateTime& dateTime)
227 {
228         return SetTimeImpl(dateTime.GetYear(), dateTime.GetMonth(), dateTime.GetDay(),
229                          dateTime.GetHour(), dateTime.GetMinute(), dateTime.GetSecond(), dateTime.GetMillisecond());
230 }
231
232 result
233 _CalendarImpl::SetTimeImpl(int year, int month, int day, int hour, int minute, int second, int millisecond)
234 {
235         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
236         return __pCalendar->SetTime(year, month, day, hour, minute, second, millisecond);
237 }
238
239 result
240 _CalendarImpl::SetFirstDayOfWeekImpl(DayOfWeek dayOfWeek)
241 {
242         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
243         SysTryReturnResult(NID_LCL, ValidateDaysOfWeek(dayOfWeek), E_INVALID_ARG, "Invalid argument is used. Unknown day of week");
244
245         return __pCalendar->SetFirstDayOfWeek(dayOfWeek);
246 }
247
248 result
249 _CalendarImpl::SetLenientImpl(bool lenient)
250 {
251         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
252         return __pCalendar->SetLenient(lenient);
253 }
254
255 result
256 _CalendarImpl::SetMinDaysInFirstWeekImpl(short value)
257 {
258         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
259         return __pCalendar->SetMinDaysInFirstWeek(value);
260 }
261
262 result
263 _CalendarImpl::SetTimeZoneImpl(const TimeZone& timeZone)
264 {
265         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
266
267         _timeZone = timeZone;
268         __timezone = timeZone;
269         return __pCalendar->SetTimeZone(__timezone);
270 }
271
272 result
273 _CalendarImpl::ClearImpl(void)
274 {
275         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
276         return __pCalendar->Clear();
277 }
278
279 result
280 _CalendarImpl::ClearImpl(TimeField field)
281 {
282         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
283         SysTryReturnResult(NID_LCL, ValidateTimeField(field), E_INVALID_ARG,
284                                 "Invalid argument is used. Timefield is less than 0 or grater than time field count.");
285
286         return __pCalendar->Clear(field);
287 }
288
289 result
290 _CalendarImpl::AddTimeField(TimeField field, int amount)
291 {
292         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
293
294         result r = E_INVALID_ARG;
295
296         if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
297         {
298                 r = E_INVALID_STATE;
299         }
300
301         SysTryReturnResult(NID_LCL, ValidateTimeField(field), r,
302                                 "Invalid argument is used. Timefield is less than 0 or grater than time field count.");
303
304         return __pCalendar->AddTimeField(field, amount);
305 }
306
307 result
308 _CalendarImpl::RollImpl(TimeField field, int amount)
309 {
310         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
311         result r = E_INVALID_ARG;
312         if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
313         {
314                 r = E_INVALID_STATE;
315         }
316
317         SysTryReturnResult(NID_LCL, ValidateTimeField(field), r,
318                                 "Invalid argument is used. Timefield is less than 0 or grater than time field count.");
319
320         return __pCalendar->Roll(field, amount);
321 }
322
323 result
324 _CalendarImpl::AfterImpl(const _CalendarImpl& otherInstance, bool& after)
325 {
326         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
327
328         result r = E_INVALID_ARG;
329         if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
330         {
331                 r = E_INVALID_STATE;
332         }
333
334         SysTryReturnResult(NID_LCL, otherInstance.__pCalendar, r, "Invalid argument is used. otherCalendar instance is invalid");
335
336         return __pCalendar->After(*(otherInstance.__pCalendar), after);
337 }
338
339 result
340 _CalendarImpl::BeforeImpl(const _CalendarImpl& otherInstance, bool& before)
341 {
342         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
343
344         result r = E_INVALID_ARG;
345         if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
346         {
347                 r = E_INVALID_STATE;
348         }
349
350         SysTryReturnResult(NID_LCL, otherInstance.__pCalendar, r, "Invalid argument is used. otherCalendar instance is invalid");
351
352         return __pCalendar->Before(*(otherInstance.__pCalendar), before);
353 }
354
355 bool
356 _CalendarImpl::EqualsImpl(const _CalendarImpl& otherInstance) const
357 {
358         if ((__pCalendar != null) && (otherInstance.__pCalendar != null))
359         {
360                 return __pCalendar->Equals(*(otherInstance.__pCalendar));
361         }
362         return (__pCalendar == otherInstance.__pCalendar);
363 }
364
365 int
366 _CalendarImpl::GetHashCodeImpl(void) const
367 {
368         Integer intValues = IsLenient() + GetFirstDayOfWeek() + GetMinDaysInFirstWeek();
369         int hashCode = intValues.GetHashCode();
370
371         long long myTicks = 0;
372         GetTimeInMillisec(myTicks);
373         hashCode = (hashCode << 5) - hashCode + LongLong(myTicks).GetHashCode()+__timezone.GetHashCode();
374
375         return hashCode;
376 }
377
378 CalendarType
379 _CalendarImpl::GetType(void) const
380 {
381         return __type;
382 }
383
384 int
385 _CalendarImpl::GetTimeFieldImpl(TimeField field) const
386 {
387         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
388         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
389                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
390
391         return __pCalendar->GetTimeField(field);
392 }
393
394 result
395 _CalendarImpl::GetTimeInMillisecImpl(long long& millisec) const
396 {
397         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
398         result r;
399         long long tempMillisec;
400
401         r =  __pCalendar->GetTimeInMillisec(tempMillisec);
402         SysTryReturnResult(NID_LCL, r == E_SUCCESS, r, "Unable to get time in milli sec");
403         millisec = tempMillisec + __timezone.GetRawOffset() * ONE_MINUTE_IN_MILLISEC;
404         return r;
405 }
406
407 DateTime
408 _CalendarImpl::GetTimeImpl(void) const
409 {
410         int year = __pCalendar->GetTimeField(TIME_FIELD_YEAR);
411         int month = __pCalendar->GetTimeField(TIME_FIELD_MONTH);
412         int date = __pCalendar->GetTimeField(TIME_FIELD_DAY_OF_MONTH);
413
414         int hour = __pCalendar->GetTimeField(TIME_FIELD_HOUR_OF_DAY);
415         int minute = __pCalendar->GetTimeField(TIME_FIELD_MINUTE);
416         int second = __pCalendar->GetTimeField(TIME_FIELD_SECOND);
417         int millisecond = __pCalendar->GetTimeField(TIME_FIELD_MILLISECOND);
418
419         DateTime dateTime;
420         result r = dateTime.SetValue(year, month, date, hour, minute, second, millisecond);
421         SysTryReturn(NID_LCL, r == E_SUCCESS, DateTime(), r, "[%s] Unable to set time in DateTime object", GetErrorMessage(r));
422
423         return dateTime;
424 }
425
426 int
427 _CalendarImpl::GetMinTimeFieldImpl(TimeField field) const
428 {
429         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
430         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
431                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
432
433         return __pCalendar->GetMinTimeField(field);
434 }
435
436 int
437 _CalendarImpl::GetActualMinTimeFieldImpl(TimeField field) const
438 {
439         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
440         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
441                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
442
443         return __pCalendar->GetActualMinTimeField(field);
444 }
445
446 int
447 _CalendarImpl::GetGreatestMinTimeFieldImpl(TimeField field) const
448 {
449         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
450         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
451                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
452
453         return __pCalendar->GetGreatestMinTimeField(field);
454 }
455
456 int
457 _CalendarImpl::GetLeastMaxTimeFieldImpl(TimeField field) const
458 {
459         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
460         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
461                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
462
463         return __pCalendar->GetLeastMaxTimeField(field);
464 }
465
466 int
467 _CalendarImpl::GetActualMaxTimeFieldImpl(TimeField field) const
468 {
469         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
470         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
471                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
472
473         return __pCalendar->GetActualMaxTimeField(field);
474 }
475
476 int
477 _CalendarImpl::GetMaxTimeFieldImpl(TimeField field) const
478 {
479         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
480         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
481                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
482
483         return __pCalendar->GetMaxTimeField(field);
484 }
485
486 int
487 _CalendarImpl::GetFirstDayOfWeekImpl(void) const
488 {
489         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
490         return __pCalendar->GetFirstDayOfWeek();
491 }
492
493 int
494 _CalendarImpl::GetMinDaysInFirstWeekImpl(void) const
495 {
496         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
497         return __pCalendar->GetMinDaysInFirstWeek();
498 }
499
500 result
501 _CalendarImpl::IsInDst(bool& isInDst) const
502 {
503         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
504         return __pCalendar->IsInDst(isInDst);
505 }
506
507 bool
508 _CalendarImpl::IsLenientImpl(void) const
509 {
510         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
511         return __pCalendar->IsLenient();
512 }
513
514 bool
515 _CalendarImpl::IsSetImpl(TimeField field) const
516 {
517         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
518         return __pCalendar->IsSet(field);
519 }
520
521 TimeZone
522 _CalendarImpl::GetTimeZoneImpl(void) const
523 {
524         return __timezone;
525 }
526
527 bool
528 _CalendarImpl::IsLeapYear(int year) const
529 {
530         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
531         return __pCalendar->IsLeapYear(year);
532 }
533
534 result
535 _CalendarImpl::SetGregorianChange(long long change)
536 {
537         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
538         return __pCalendar->SetGregorianChange(change);
539 }
540
541 long long
542 _CalendarImpl::GetGregorianChange(void) const
543 {
544         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
545         return __pCalendar->GetGregorianChange();
546 }
547
548 result
549 _CalendarImpl::SetJulianDay(int julianDay)
550 {
551         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
552         return __pCalendar->SetJulianDay(julianDay);
553 }
554
555 int
556 _CalendarImpl::GetJulianDay(void) const
557 {
558         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
559         return __pCalendar->GetJulianDay();
560 }
561
562 bool
563 _CalendarImpl::ValidateTimeField(TimeField field) const
564 {
565         if (field < 0 || field >= TIME_FIELD_FIELD_COUNT)
566         {
567                 return false;
568         }
569         return true;
570 }
571
572 bool
573 _CalendarImpl::ValidateTimeFieldValue(TimeField field, int value) const
574 {
575         if (IsLenientImpl() == false)
576         {
577                 if ((value < GetMinTimeField(field)) || (value > GetMaxTimeField(field)))
578                 {
579                         return false;
580                 }
581         }
582
583         return true;
584 }
585
586 bool
587 _CalendarImpl::ValidateDaysOfWeek(DayOfWeek dayOfWeek) const
588 {
589         if (dayOfWeek < SUNDAY || dayOfWeek > SATURDAY)
590         {
591                 return false;
592         }
593         return true;
594 }
595
596 // added for backward compatibility
597 result
598 _CalendarImpl::RollWithSingleUnit(TimeField field, bool up)
599 {
600         return E_UNSUPPORTED_OPERATION;
601 }
602
603 // added for backward compatibility
604 result
605 _CalendarImpl::ComputeTimeFields(void)
606 {
607         return E_UNSUPPORTED_OPERATION;
608 }
609
610 // added for backward compatibility
611 result
612 _CalendarImpl::ComputeTime(void)
613 {
614         return E_UNSUPPORTED_OPERATION;
615 }
616
617 // added for backward compatibility
618 int
619 _CalendarImpl::GetMonthLength(int extendedYear, int month) const
620 {
621         SetLastResult(E_UNSUPPORTED_OPERATION);
622         return -1;
623 }
624
625 // added for backward compatibility
626 int
627 _CalendarImpl::HandleGetLimit(TimeField field, CalendarLimitType limitType) const
628 {
629         SetLastResult(E_UNSUPPORTED_OPERATION);
630         return -1;
631 }
632
633 const _IcuCalendarImpl*
634 _CalendarImpl::GetImpl(const Calendar& calendar)
635 {
636         if (calendar._pCalendarImpl)
637         {
638                 return calendar._pCalendarImpl->__pCalendar;
639         }
640
641         return null;
642 }
643
644 };
645 };      // Tizen::Locales