sync with master
[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(), dateTime.GetHour(), dateTime.GetMinute(), dateTime.GetSecond());
229 }
230
231 result
232 _CalendarImpl::SetTimeImpl(int year, int month, int day, int hour, int minute, int second)
233 {
234         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
235         return __pCalendar->SetTime(year, month, day, hour, minute, second);
236 }
237
238 result
239 _CalendarImpl::SetFirstDayOfWeekImpl(DayOfWeek dayOfWeek)
240 {
241         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
242         SysTryReturnResult(NID_LCL, ValidateDaysOfWeek(dayOfWeek), E_INVALID_ARG, "Invalid argument is used. Unknown day of week");
243
244         return __pCalendar->SetFirstDayOfWeek(dayOfWeek);
245 }
246
247 result
248 _CalendarImpl::SetLenientImpl(bool lenient)
249 {
250         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
251         return __pCalendar->SetLenient(lenient);
252 }
253
254 result
255 _CalendarImpl::SetMinDaysInFirstWeekImpl(short value)
256 {
257         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
258         return __pCalendar->SetMinDaysInFirstWeek(value);
259 }
260
261 result
262 _CalendarImpl::SetTimeZoneImpl(const TimeZone& timeZone)
263 {
264         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
265
266         _timeZone = timeZone;
267         __timezone = timeZone;
268         return __pCalendar->SetTimeZone(__timezone);
269 }
270
271 result
272 _CalendarImpl::ClearImpl(void)
273 {
274         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
275         return __pCalendar->Clear();
276 }
277
278 result
279 _CalendarImpl::ClearImpl(TimeField field)
280 {
281         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
282         SysTryReturnResult(NID_LCL, ValidateTimeField(field), E_INVALID_ARG,
283                                 "Invalid argument is used. Timefield is less than 0 or grater than time field count.");
284
285         return __pCalendar->Clear(field);
286 }
287
288 result
289 _CalendarImpl::AddTimeField(TimeField field, int amount)
290 {
291         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
292
293         result r = E_INVALID_ARG;
294
295         if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
296         {
297                 r = E_INVALID_STATE;
298         }
299
300         SysTryReturnResult(NID_LCL, ValidateTimeField(field), r,
301                                 "Invalid argument is used. Timefield is less than 0 or grater than time field count.");
302
303         return __pCalendar->AddTimeField(field, amount);
304 }
305
306 result
307 _CalendarImpl::Roll(TimeField field, int amount)
308 {
309         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
310
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::After(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::Before(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::Equals(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::GetHashCode(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
418         DateTime dateTime;
419         result r = dateTime.SetValue(year, month, date, hour, minute, second);
420         SysTryReturn(NID_LCL, r == E_SUCCESS, DateTime(), r, "[%s] Unable to set time in DateTime object", GetErrorMessage(r));
421
422         return dateTime;
423 }
424
425 int
426 _CalendarImpl::GetMinTimeField(TimeField field) const
427 {
428         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
429         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
430                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
431
432         return __pCalendar->GetMinTimeField(field);
433 }
434
435 int
436 _CalendarImpl::GetActualMinTimeField(TimeField field) const
437 {
438         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
439         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
440                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
441
442         return __pCalendar->GetActualMinTimeField(field);
443 }
444
445 int
446 _CalendarImpl::GetGreatestMinTimeField(TimeField field) const
447 {
448         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
449         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
450                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
451
452         return __pCalendar->GetGreatestMinTimeField(field);
453 }
454
455 int
456 _CalendarImpl::GetLeastMaxTimeField(TimeField field) const
457 {
458         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
459         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
460                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
461
462         return __pCalendar->GetLeastMaxTimeField(field);
463 }
464
465 int
466 _CalendarImpl::GetActualMaxTimeField(TimeField field) const
467 {
468         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
469         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
470                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
471
472         return __pCalendar->GetActualMaxTimeField(field);
473 }
474
475 int
476 _CalendarImpl::GetMaxTimeField(TimeField field) const
477 {
478         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
479         SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
480                                 "[%s] Invalid argument is used. Timefield is less than 0 or grater than time field count.", GetErrorMessage(E_INVALID_ARG));
481
482         return __pCalendar->GetMaxTimeField(field);
483 }
484
485 int
486 _CalendarImpl::GetFirstDayOfWeekImpl(void) const
487 {
488         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
489         return __pCalendar->GetFirstDayOfWeek();
490 }
491
492 int
493 _CalendarImpl::GetMinDaysInFirstWeekImpl(void) const
494 {
495         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
496         return __pCalendar->GetMinDaysInFirstWeek();
497 }
498
499 result
500 _CalendarImpl::IsInDst(bool& isInDst) const
501 {
502         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
503         return __pCalendar->IsInDst(isInDst);
504 }
505
506 bool
507 _CalendarImpl::IsLenientImpl(void) const
508 {
509         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
510         return __pCalendar->IsLenient();
511 }
512
513 bool
514 _CalendarImpl::IsSetImpl(TimeField field) const
515 {
516         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
517         return __pCalendar->IsSet(field);
518 }
519
520 TimeZone
521 _CalendarImpl::GetTimeZoneImpl(void) const
522 {
523         return __timezone;
524 }
525
526 bool
527 _CalendarImpl::IsLeapYear(int year) const
528 {
529         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
530         return __pCalendar->IsLeapYear(year);
531 }
532
533 result
534 _CalendarImpl::SetGregorianChange(long long change)
535 {
536         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
537         return __pCalendar->SetGregorianChange(change);
538 }
539
540 long long
541 _CalendarImpl::GetGregorianChange(void) const
542 {
543         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
544         return __pCalendar->GetGregorianChange();
545 }
546
547 result
548 _CalendarImpl::SetJulianDay(int julianDay)
549 {
550         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
551         return __pCalendar->SetJulianDay(julianDay);
552 }
553
554 int
555 _CalendarImpl::GetJulianDay(void) const
556 {
557         SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
558         return __pCalendar->GetJulianDay();
559 }
560
561 bool
562 _CalendarImpl::ValidateTimeField(TimeField field) const
563 {
564         if (field < 0 || field >= TIME_FIELD_FIELD_COUNT)
565         {
566                 return false;
567         }
568         return true;
569 }
570
571 bool
572 _CalendarImpl::ValidateTimeFieldValue(TimeField field, int value) const
573 {
574         if (IsLenientImpl() == false)
575         {
576                 if ((value < GetMinTimeField(field)) || (value > GetMaxTimeField(field)))
577                 {
578                         return false;
579                 }
580         }
581
582         return true;
583 }
584
585 bool
586 _CalendarImpl::ValidateDaysOfWeek(DayOfWeek dayOfWeek) const
587 {
588         if (dayOfWeek < SUNDAY || dayOfWeek > SATURDAY)
589         {
590                 return false;
591         }
592         return true;
593 }
594
595 // added for backward compatibility
596 result
597 _CalendarImpl::RollWithSingleUnit(TimeField field, bool up)
598 {
599         return E_UNSUPPORTED_OPERATION;
600 }
601
602 // added for backward compatibility
603 result
604 _CalendarImpl::ComputeTimeFields(void)
605 {
606         return E_UNSUPPORTED_OPERATION;
607 }
608
609 // added for backward compatibility
610 result
611 _CalendarImpl::ComputeTime(void)
612 {
613         return E_UNSUPPORTED_OPERATION;
614 }
615
616 // added for backward compatibility
617 int
618 _CalendarImpl::GetMonthLength(int extendedYear, int month) const
619 {
620         SetLastResult(E_UNSUPPORTED_OPERATION);
621         return -1;
622 }
623
624 // added for backward compatibility
625 int
626 _CalendarImpl::HandleGetLimit(TimeField field, CalendarLimitType limitType) const
627 {
628         SetLastResult(E_UNSUPPORTED_OPERATION);
629         return -1;
630 }
631
632 const _IcuCalendarImpl*
633 _CalendarImpl::GetImpl(const Calendar& calendar)
634 {
635         if (calendar._pCalendarImpl)
636         {
637                 return calendar._pCalendarImpl->__pCalendar;
638         }
639
640         return null;
641 }
642
643 };
644 };      // Tizen::Locales