2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 * @file FScl_CalTodoImpl.cpp
18 * @brief This is the implementation for _CalTodoImpl class.
20 * This file contains definitions of @e CalTodoImpl class.
23 #include <FApp_AppInfo.h>
24 #include <FBaseColArrayList.h>
25 #include <FBaseDateTime.h>
26 #include <FBaseSysLog.h>
27 #include <FBase_StringConverter.h>
28 #include <FSclCalTodo.h>
29 #include <FSclRecord.h>
30 #include <FSclReminder.h>
31 #include <FSclRecurrence.h>
32 #include <FSysSystemTime.h>
33 #include <FSclTypes.h>
34 #include "FScl_CalendarbookDbConnector.h"
35 #include "FScl_CalendarbookImpl.h"
36 #include "FScl_CalTodoImpl.h"
37 #include "FScl_RecordImpl.h"
39 using namespace Tizen::App;
40 using namespace Tizen::Base;
41 using namespace Tizen::Base::Collection;
43 namespace Tizen { namespace Social
45 static const double _MIN_LATITUDE = -90.0;
46 static const double _MAX_LATITUDE = 90.0;
47 static const double _MIN_LONGITUDE = -180.0;
48 static const double _MAX_LONGITUDE = 180.0;
50 static const long long _CALENDAR_TODO_NO_START_DATE = -0x7fffffffffffffffLL;
51 static const long long _CALENDAR_TODO_NO_DUE_DATE = 0x7fffffffffffffffLL;
53 _CalTodoImpl::_CalTodoImpl(void)
54 : __reminderListUpdated(false)
56 calendar_record_h todoHandle = null;
58 result r = _CalendarbookDbConnector::Connect();
59 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
61 int errorCode = calendar_record_create(_calendar_todo._uri, &todoHandle);
62 SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
64 if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
68 // Set start date to current date
69 Tizen::System::SystemTime::GetCurrentTime(tmpDateTime);
70 if (IsFailed(GetLastResult()))
72 tmpDateTime = _CalendarbookImpl::GetMinDateTime();
75 tmpDateTime.SetValue(tmpDateTime.GetYear(), tmpDateTime.GetMonth(), tmpDateTime.GetDay(), 0, 0, 0);
77 calendar_time_s convertedCalendarTime;
79 convertedCalendarTime.type = CALENDAR_TIME_UTIME;
80 convertedCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(tmpDateTime);
82 calendar_record_set_caltime(todoHandle, _calendar_todo.start_time, convertedCalendarTime);
83 calendar_record_set_caltime(todoHandle, _calendar_todo.due_time, convertedCalendarTime);
87 calendar_time_s convertedStartTime;
88 convertedStartTime.type = CALENDAR_TIME_UTIME;
89 convertedStartTime.time.utime = _CALENDAR_TODO_NO_START_DATE;
91 calendar_time_s convertedDueTime;
92 convertedDueTime.type = CALENDAR_TIME_UTIME;
93 convertedDueTime.time.utime = _CALENDAR_TODO_NO_DUE_DATE;
95 calendar_record_set_caltime(todoHandle, _calendar_todo.start_time, convertedStartTime);
96 calendar_record_set_caltime(todoHandle, _calendar_todo.due_time, convertedDueTime);
100 calendar_record_set_int(todoHandle, _calendar_todo.todo_status, CALENDAR_TODO_STATUS_NONE);
101 calendar_record_set_int(todoHandle, _calendar_todo.priority, CALENDAR_TODO_PRIORITY_NORMAL);
102 calendar_record_set_int(todoHandle, _calendar_todo.sensitivity, CALENDAR_SENSITIVITY_PUBLIC);
103 calendar_record_set_int(todoHandle, _calendar_todo.calendar_book_id, INVALID_RECORD_ID);
105 __todoRecord.ResetHandle(todoHandle);
107 r = __reminderList.Construct();
108 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
111 _CalTodoImpl::_CalTodoImpl(const _CalTodoImpl& rhs)
112 : __reminderListUpdated(false)
114 calendar_record_h todoHandle = null;
116 result r = _CalendarbookDbConnector::Connect();
117 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
119 int errorCode = calendar_record_clone(rhs.__todoRecord.GetHandle(), &todoHandle);
120 SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
122 __todoRecord.ResetHandle(todoHandle);
124 r = __reminderList.Construct();
125 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
128 _CalTodoImpl::~_CalTodoImpl(void)
130 __reminderList.RemoveAll(true);
132 result r = _CalendarbookDbConnector::Disconnect();
133 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
137 _CalTodoImpl::operator =(const _CalTodoImpl& rhs)
144 __reminderList.RemoveAll(true);
145 __reminderListUpdated = false;
147 calendar_record_h todoHandle = null;
149 int errorCode = calendar_record_clone(rhs.__todoRecord.GetHandle(), &todoHandle);
150 SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, *this, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
152 __todoRecord.ResetHandle(todoHandle);
158 _CalTodoImpl::GetSubject(void) const
160 char* pSubject = null;
162 calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.summary, &pSubject);
164 return String(pSubject);
168 _CalTodoImpl::GetDescription(void) const
170 char* pDescription = null;
172 calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.description, &pDescription);
174 return String(pDescription);
178 _CalTodoImpl::GetStartDate(void) const
182 calendar_time_s tmpCalendarTime;
184 calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, &tmpCalendarTime);
186 if (tmpCalendarTime.time.utime == _CALENDAR_TODO_NO_START_DATE)
188 SetLastResult(E_DATA_NOT_FOUND);
189 return DateTime::GetMinValue();
192 DateTime tmpDateTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(tmpCalendarTime.time.utime);
198 _CalTodoImpl::GetDueDate(void) const
202 calendar_time_s tmpCalendarTime;
204 calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, &tmpCalendarTime);
206 if (tmpCalendarTime.time.utime == _CALENDAR_TODO_NO_DUE_DATE)
208 SetLastResult(E_DATA_NOT_FOUND);
209 return DateTime::GetMinValue();
212 DateTime tmpDateTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(tmpCalendarTime.time.utime);
218 _CalTodoImpl::GetPriority(void) const
220 int srcPriority = CALENDAR_EVENT_PRIORITY_LOW;
222 TodoPriority priority = TODO_PRIORITY_NORMAL;
224 calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.priority, &srcPriority);
228 case CALENDAR_TODO_PRIORITY_LOW:
229 priority = TODO_PRIORITY_LOW;
232 case CALENDAR_TODO_PRIORITY_NONE:
234 case CALENDAR_TODO_PRIORITY_NORMAL:
235 priority = TODO_PRIORITY_NORMAL;
238 case CALENDAR_TODO_PRIORITY_HIGH:
239 priority = TODO_PRIORITY_HIGH;
243 SysLog(NID_SCL, "The priority value is invalid. priority = %d", srcPriority);
244 priority = TODO_PRIORITY_NORMAL;
252 _CalTodoImpl::GetStatus(void) const
254 int srcStatus = CALENDAR_EVENT_STATUS_NONE;
256 TodoStatus status = TODO_STATUS_NONE;
258 calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.todo_status, &srcStatus);
262 case CALENDAR_TODO_STATUS_NONE:
263 status = TODO_STATUS_NONE;
266 case CALENDAR_TODO_STATUS_NEEDS_ACTION:
267 status = TODO_STATUS_NEEDS_ACTION;
270 case CALENDAR_TODO_STATUS_COMPLETED:
271 status = TODO_STATUS_COMPLETED;
274 case CALENDAR_TODO_STATUS_IN_PROCESS:
275 status = TODO_STATUS_IN_PROCESS;
278 case CALENDAR_TODO_STATUS_CANCELED:
279 status = TODO_STATUS_CANCELLED;
283 SysLog(NID_SCL, "The status value is invalid. status = %d", srcStatus);
284 status = TODO_STATUS_NONE;
292 _CalTodoImpl::GetSensitivity(void) const
294 int srcSensitivity = CALENDAR_SENSITIVITY_PUBLIC;
295 RecordSensitivity sensitivity = SENSITIVITY_PUBLIC;
297 calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.sensitivity, &srcSensitivity);
299 switch (srcSensitivity)
301 case CALENDAR_SENSITIVITY_PUBLIC:
302 sensitivity = SENSITIVITY_PUBLIC;
305 case CALENDAR_SENSITIVITY_PRIVATE:
306 sensitivity = SENSITIVITY_PRIVATE;
309 case CALENDAR_SENSITIVITY_CONFIDENTIAL:
310 sensitivity = SENSITIVITY_CONFIDENTIAL;
314 SysLog(NID_SCL, "The sensitivity value is invalid. sensitivity = %d", srcSensitivity);
315 sensitivity = SENSITIVITY_PUBLIC;
323 _CalTodoImpl::GetLastRevisedTime(void) const
325 long long lastModifiedTime = 0;
327 calendar_record_get_lli(__todoRecord.GetHandle(), _calendar_todo.last_modified_time, &lastModifiedTime);
329 return _CalendarbookUtil::ConvertEpochTimeToDateTime(lastModifiedTime);
333 _CalTodoImpl::SetSubject(const String& subject)
335 if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
337 SysTryReturnResult(NID_SCL, subject.GetLength() <= MAX_TODO_SUBJECT_LENGTH,
338 E_INVALID_ARG, "Invalid argument is used. The length of the subject exceeds MAX_TODO_SUBJECT_LENGTH.");
341 std::unique_ptr<char[]> pConvertedSubject(_StringConverter::CopyToCharArrayN(subject));
342 SysTryReturnResult(NID_SCL, pConvertedSubject != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
344 int errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.summary, pConvertedSubject.get());
345 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
351 _CalTodoImpl::SetDescription(const String& description)
353 if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
355 SysTryReturnResult(NID_SCL, description.GetLength() <= MAX_TODO_DESCRIPTION_LENGTH,
356 E_INVALID_ARG, "Invalid argument is used. The length of the description exceeds MAX_TODO_SUBJECT_LENGTH.");
359 std::unique_ptr<char[]> pConvertedDescription(_StringConverter::CopyToCharArrayN(description));
360 SysTryReturnResult(NID_SCL, pConvertedDescription != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
362 int errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.description, pConvertedDescription.get());
363 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
369 _CalTodoImpl::SetStartAndDueDate(const DateTime& startDate, const DateTime& dueDate)
371 SysTryReturnResult(NID_SCL, _CalendarbookUtil::CheckValidDateTime(startDate), E_INVALID_ARG, "Invalid argument is used. The start date is invalid.");
372 SysTryReturnResult(NID_SCL, _CalendarbookUtil::CheckValidDateTime(dueDate), E_INVALID_ARG, "Invalid argument is used. The end date is invalid.");
373 SysTryReturnResult(NID_SCL, startDate <= dueDate, E_INVALID_ARG, "Invalid argument is used. The end date is earlier than the start date.");
375 calendar_time_s convertedStartTime;
376 calendar_time_s convertedDueTime;
378 convertedStartTime.type = CALENDAR_TIME_UTIME;
379 convertedStartTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(startDate);
380 convertedDueTime.type = CALENDAR_TIME_UTIME;
381 convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(dueDate);
383 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
384 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
390 _CalTodoImpl::SetStartDate(const DateTime& startDate)
392 calendar_time_s convertedStartTime;
393 convertedStartTime.type = CALENDAR_TIME_UTIME;
395 if (startDate == DateTime::GetMinValue())
397 convertedStartTime.time.utime = _CALENDAR_TODO_NO_START_DATE;
399 else if (startDate < _CalendarbookImpl::GetMinDateTime() || startDate > _CalendarbookImpl::GetMaxDateTime())
401 SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. The startDate is invalid.", GetErrorMessage(E_INVALID_ARG));
402 return E_INVALID_ARG;
406 calendar_time_s convertedDueTime;
407 calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, &convertedDueTime);
409 convertedStartTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(startDate);
411 if (convertedStartTime.time.utime > convertedDueTime.time.utime)
413 convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(DateTime::GetMinValue());
414 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
418 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
424 _CalTodoImpl::SetDueDate(const DateTime& dueDate)
426 calendar_time_s convertedDueTime;
427 convertedDueTime.type = CALENDAR_TIME_UTIME;
429 if (dueDate == DateTime::GetMinValue())
431 convertedDueTime.time.utime = _CALENDAR_TODO_NO_DUE_DATE;
433 else if (dueDate < _CalendarbookImpl::GetMinDateTime() || dueDate > _CalendarbookImpl::GetMaxDateTime())
435 SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. The dueDate is invalid.", GetErrorMessage(E_INVALID_ARG));
436 return E_INVALID_ARG;
440 calendar_time_s convertedStartTime;
441 calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, &convertedStartTime);
443 convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(dueDate);
445 if (convertedStartTime.time.utime > convertedDueTime.time.utime)
447 convertedStartTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(DateTime::GetMinValue());
448 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
452 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
458 _CalTodoImpl::SetPriority(TodoPriority priority)
460 calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.priority, _CalendarbookUtil::ConvertTodoPriorityToCSTodoPriority(priority));
464 _CalTodoImpl::SetStatus(TodoStatus status)
466 calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.todo_status, _CalendarbookUtil::ConvertTodoStatusToCSTodoStatus(status));
470 _CalTodoImpl::SetSensitivity(RecordSensitivity sensitivity)
472 calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.sensitivity, _CalendarbookUtil::ConvertSensitivityToCSSensitivity(sensitivity));
476 _CalTodoImpl::SetLocation(const String& location)
478 std::unique_ptr<char[]> pConvertedLocation(_StringConverter::CopyToCharArrayN(location));
479 SysTryReturnVoidResult(NID_SCL, pConvertedLocation != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
481 int errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.location, pConvertedLocation.get());
482 SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
486 _CalTodoImpl::GetLocation(void) const
488 char* pLocation = null;
490 calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.location, &pLocation);
492 return String(pLocation);
496 _CalTodoImpl::SetCoordinates(double latitude, double longitude)
498 SysTryReturnResult(NID_SCL, latitude >= _MIN_LATITUDE && latitude <= _MAX_LATITUDE, E_INVALID_ARG, "Invalid argument is used. The latitude is out of range.");
499 SysTryReturnResult(NID_SCL, longitude >= _MIN_LONGITUDE && longitude <= _MAX_LONGITUDE, E_INVALID_ARG, "Invalid argument is used. The longitude is out of range.");
501 calendar_record_set_double(__todoRecord.GetHandle(), _calendar_todo.latitude, latitude);
502 calendar_record_set_double(__todoRecord.GetHandle(), _calendar_todo.longitude, longitude);
508 _CalTodoImpl::GetCoordinates(double& latitude, double& longitude) const
510 calendar_record_get_double(__todoRecord.GetHandle(), _calendar_todo.latitude, &latitude);
511 calendar_record_get_double(__todoRecord.GetHandle(), _calendar_todo.longitude, &longitude);
515 _CalTodoImpl::AddReminder(const Reminder& reminder)
517 calendar_record_h tmpAlarmHandle = null;
519 std::unique_ptr<char[]> pTmpAlarmTone(_StringConverter::CopyToCharArrayN(reminder.GetSoundFile()));
520 SysTryReturnResult(NID_SCL, pTmpAlarmTone != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
522 int errorCode = calendar_record_create(_calendar_alarm._uri, &tmpAlarmHandle);
523 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
525 int convertedTimeUnit = 0;
527 ReminderTimeUnit timeUnit = reminder.GetTimeUnit();
530 case REMINDER_TIME_UNIT_MINUTE:
531 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_MINUTE;
534 case REMINDER_TIME_UNIT_HOUR:
535 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_HOUR;
538 case REMINDER_TIME_UNIT_DAY:
539 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_DAY;
542 case REMINDER_TIME_UNIT_WEEK:
543 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_WEEK;
546 case REMINDER_TIME_UNIT_NONE:
547 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_SPECIFIC;
554 calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
555 calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, reminder.GetTimeOffset());
556 errorCode = calendar_record_set_str(tmpAlarmHandle, _calendar_alarm.tone, pTmpAlarmTone.get());
557 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
559 if (convertedTimeUnit == CALENDAR_ALARM_TIME_UNIT_SPECIFIC)
561 calendar_record_set_lli(tmpAlarmHandle, _calendar_alarm.time, _CalendarbookUtil::ConvertDateTimeToEpochTime(reminder.GetAbsoluteTime()));
564 errorCode = calendar_record_add_child_record(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, tmpAlarmHandle);
565 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
567 __reminderList.RemoveAll(true);
568 __reminderListUpdated = false;
574 _CalTodoImpl::RemoveReminderAt(int index)
576 calendar_record_h tmpAlarmHandle = null;
578 calendar_record_get_child_record_at_p(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, index, &tmpAlarmHandle);
579 SysTryReturnResult(NID_SCL, tmpAlarmHandle != null, E_OUT_OF_RANGE, "The index is either equal to or greater than the number of reminders or less than 0.");
581 calendar_record_remove_child_record(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, tmpAlarmHandle);
583 __reminderList.RemoveAll(true);
584 __reminderListUpdated = false;
590 _CalTodoImpl::GetAllReminders(void) const
594 if (__reminderListUpdated == false)
596 result r = _CalendarbookUtil::ConvertTodoAlarmsToReminderList(__todoRecord.GetHandle(), __reminderList);
597 SysTryReturn(NID_SCL, r == E_SUCCESS, __reminderList, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
599 __reminderListUpdated = true;
602 return __reminderList;
606 _CalTodoImpl::GetCalendarId(void) const
608 int srcCalendarbookId = 0;
610 calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.calendar_book_id, &srcCalendarbookId);
612 return srcCalendarbookId;
616 _CalTodoImpl::SetRecordHandle(calendar_record_h todoHandle)
618 __todoRecord.ResetHandle(todoHandle);
622 _CalTodoImpl::GetRecordHandle(void) const
624 return __todoRecord.GetHandle();
628 _CalTodoImpl::CreateDefaultInstanceN(void)
630 return new (std::nothrow) CalTodo();
634 _CalTodoImpl::GetInstance(CalTodo& todo)
636 return todo.__pCalTodoImpl;
640 _CalTodoImpl::GetInstance(const CalTodo& todo)
642 return todo.__pCalTodoImpl;