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