Merge "Apply millisecond of DateTime for Calendar" 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::Roll(TimeField field, int amount)
309 {
310         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
311
312         result r = E_INVALID_ARG;
313         if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
314         {
315                 r = E_INVALID_STATE;
316         }
317
318         SysTryReturnResult(NID_LCL, ValidateTimeField(field), r,
319                                 "Invalid argument is used. Timefield is less than 0 or grater than time field count.");
320
321         return __pCalendar->Roll(field, amount);
322 }
323
324 result
325 _CalendarImpl::After(const _CalendarImpl& otherInstance, bool& after)
326 {
327         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
328
329         result r = E_INVALID_ARG;
330         if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
331         {
332                 r = E_INVALID_STATE;
333         }
334
335         SysTryReturnResult(NID_LCL, otherInstance.__pCalendar, r, "Invalid argument is used. otherCalendar instance is invalid");
336
337         return __pCalendar->After(*(otherInstance.__pCalendar), after);
338 }
339
340 result
341 _CalendarImpl::Before(const _CalendarImpl& otherInstance, bool& before)
342 {
343         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
344
345         result r = E_INVALID_ARG;
346         if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
347         {
348                 r = E_INVALID_STATE;
349         }
350
351         SysTryReturnResult(NID_LCL, otherInstance.__pCalendar, r, "Invalid argument is used. otherCalendar instance is invalid");
352
353         return __pCalendar->Before(*(otherInstance.__pCalendar), before);
354 }
355
356 bool
357 _CalendarImpl::Equals(const _CalendarImpl& otherInstance) const
358 {
359         if ((__pCalendar != null) && (otherInstance.__pCalendar != null))
360         {
361                 return __pCalendar->Equals(*(otherInstance.__pCalendar));
362         }
363         return (__pCalendar == otherInstance.__pCalendar);
364 }
365
366 int
367 _CalendarImpl::GetHashCode(void) const
368 {
369         Integer intValues = IsLenient() + GetFirstDayOfWeek() + GetMinDaysInFirstWeek();
370         int hashCode = intValues.GetHashCode();
371
372         long long myTicks = 0;
373         GetTimeInMillisec(myTicks);
374         hashCode = (hashCode << 5) - hashCode + LongLong(myTicks).GetHashCode()+__timezone.GetHashCode();
375
376         return hashCode;
377 }
378
379 CalendarType
380 _CalendarImpl::GetType(void) const
381 {
382         return __type;
383 }
384
385 int
386 _CalendarImpl::GetTimeFieldImpl(TimeField field) const
387 {
388         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
389         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
390                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
391
392         return __pCalendar->GetTimeField(field);
393 }
394
395 result
396 _CalendarImpl::GetTimeInMillisecImpl(long long& millisec) const
397 {
398         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
399         result r;
400         long long tempMillisec;
401
402         r =  __pCalendar->GetTimeInMillisec(tempMillisec);
403         SysTryReturnResult(NID_LCL, r == E_SUCCESS, r, "Unable to get time in milli sec");
404         millisec = tempMillisec + __timezone.GetRawOffset() * ONE_MINUTE_IN_MILLISEC;
405         return r;
406 }
407
408 DateTime
409 _CalendarImpl::GetTimeImpl(void) const
410 {
411         int year = __pCalendar->GetTimeField(TIME_FIELD_YEAR);
412         int month = __pCalendar->GetTimeField(TIME_FIELD_MONTH);
413         int date = __pCalendar->GetTimeField(TIME_FIELD_DAY_OF_MONTH);
414
415         int hour = __pCalendar->GetTimeField(TIME_FIELD_HOUR_OF_DAY);
416         int minute = __pCalendar->GetTimeField(TIME_FIELD_MINUTE);
417         int second = __pCalendar->GetTimeField(TIME_FIELD_SECOND);
418         int millisecond = __pCalendar->GetTimeField(TIME_FIELD_MILLISECOND);
419
420         DateTime dateTime;
421         result r = dateTime.SetValue(year, month, date, hour, minute, second, millisecond);
422         SysTryReturn(NID_LCL, r == E_SUCCESS, DateTime(), r, "[%s] Unable to set time in DateTime object", GetErrorMessage(r));
423
424         return dateTime;
425 }
426
427 int
428 _CalendarImpl::GetMinTimeField(TimeField field) const
429 {
430         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
431         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
432                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
433
434         return __pCalendar->GetMinTimeField(field);
435 }
436
437 int
438 _CalendarImpl::GetActualMinTimeField(TimeField field) const
439 {
440         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
441         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
442                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
443
444         return __pCalendar->GetActualMinTimeField(field);
445 }
446
447 int
448 _CalendarImpl::GetGreatestMinTimeField(TimeField field) const
449 {
450         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
451         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
452                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
453
454         return __pCalendar->GetGreatestMinTimeField(field);
455 }
456
457 int
458 _CalendarImpl::GetLeastMaxTimeField(TimeField field) const
459 {
460         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
461         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
462                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
463
464         return __pCalendar->GetLeastMaxTimeField(field);
465 }
466
467 int
468 _CalendarImpl::GetActualMaxTimeField(TimeField field) const
469 {
470         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
471         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
472                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
473
474         return __pCalendar->GetActualMaxTimeField(field);
475 }
476
477 int
478 _CalendarImpl::GetMaxTimeField(TimeField field) const
479 {
480         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
481         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
482                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
483
484         return __pCalendar->GetMaxTimeField(field);
485 }
486
487 int
488 _CalendarImpl::GetFirstDayOfWeekImpl(void) const
489 {
490         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
491         return __pCalendar->GetFirstDayOfWeek();
492 }
493
494 int
495 _CalendarImpl::GetMinDaysInFirstWeekImpl(void) const
496 {
497         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
498         return __pCalendar->GetMinDaysInFirstWeek();
499 }
500
501 result
502 _CalendarImpl::IsInDst(bool& isInDst) const
503 {
504         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
505         return __pCalendar->IsInDst(isInDst);
506 }
507
508 bool
509 _CalendarImpl::IsLenientImpl(void) const
510 {
511         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
512         return __pCalendar->IsLenient();
513 }
514
515 bool
516 _CalendarImpl::IsSetImpl(TimeField field) const
517 {
518         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
519         return __pCalendar->IsSet(field);
520 }
521
522 TimeZone
523 _CalendarImpl::GetTimeZoneImpl(void) const
524 {
525         return __timezone;
526 }
527
528 bool
529 _CalendarImpl::IsLeapYear(int year) const
530 {
531         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
532         return __pCalendar->IsLeapYear(year);
533 }
534
535 result
536 _CalendarImpl::SetGregorianChange(long long change)
537 {
538         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
539         return __pCalendar->SetGregorianChange(change);
540 }
541
542 long long
543 _CalendarImpl::GetGregorianChange(void) const
544 {
545         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
546         return __pCalendar->GetGregorianChange();
547 }
548
549 result
550 _CalendarImpl::SetJulianDay(int julianDay)
551 {
552         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
553         return __pCalendar->SetJulianDay(julianDay);
554 }
555
556 int
557 _CalendarImpl::GetJulianDay(void) const
558 {
559         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
560         return __pCalendar->GetJulianDay();
561 }
562
563 bool
564 _CalendarImpl::ValidateTimeField(TimeField field) const
565 {
566         if (field < 0 || field >= TIME_FIELD_FIELD_COUNT)
567         {
568                 return false;
569         }
570         return true;
571 }
572
573 bool
574 _CalendarImpl::ValidateTimeFieldValue(TimeField field, int value) const
575 {
576         if (IsLenientImpl() == false)
577         {
578                 if ((value < GetMinTimeField(field)) || (value > GetMaxTimeField(field)))
579                 {
580                         return false;
581                 }
582         }
583
584         return true;
585 }
586
587 bool
588 _CalendarImpl::ValidateDaysOfWeek(DayOfWeek dayOfWeek) const
589 {
590         if (dayOfWeek < SUNDAY || dayOfWeek > SATURDAY)
591         {
592                 return false;
593         }
594         return true;
595 }
596
597 // added for backward compatibility
598 result
599 _CalendarImpl::RollWithSingleUnit(TimeField field, bool up)
600 {
601         return E_UNSUPPORTED_OPERATION;
602 }
603
604 // added for backward compatibility
605 result
606 _CalendarImpl::ComputeTimeFields(void)
607 {
608         return E_UNSUPPORTED_OPERATION;
609 }
610
611 // added for backward compatibility
612 result
613 _CalendarImpl::ComputeTime(void)
614 {
615         return E_UNSUPPORTED_OPERATION;
616 }
617
618 // added for backward compatibility
619 int
620 _CalendarImpl::GetMonthLength(int extendedYear, int month) const
621 {
622         SetLastResult(E_UNSUPPORTED_OPERATION);
623         return -1;
624 }
625
626 // added for backward compatibility
627 int
628 _CalendarImpl::HandleGetLimit(TimeField field, CalendarLimitType limitType) const
629 {
630         SetLastResult(E_UNSUPPORTED_OPERATION);
631         return -1;
632 }
633
634 const _IcuCalendarImpl*
635 _CalendarImpl::GetImpl(const Calendar& calendar)
636 {
637         if (calendar._pCalendarImpl)
638         {
639                 return calendar._pCalendarImpl->__pCalendar;
640         }
641
642         return null;
643 }
644
645 };
646 };      // Tizen::Locales