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 <FBaseDateTime.h>
24 #include <FBaseColArrayList.h>
25 #include <FSysSystemTime.h>
26 #include <FSclTypes.h>
27 #include <FSclRecord.h>
28 #include <FSclCalTodo.h>
29 #include <FSclReminder.h>
30 #include <FSclRecurrence.h>
31 #include <FBaseSysLog.h>
32 #include <FApp_AppInfo.h>
33 #include <FBase_StringConverter.h>
34 #include "FScl_CalTodoImpl.h"
35 #include "FScl_RecordImpl.h"
36 #include "FScl_CalendarbookImpl.h"
37 #include "FScl_CalendarbookDbConnector.h"
39 using namespace Tizen::Base;
40 using namespace Tizen::Base::Collection;
41 using namespace Tizen::App;
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 int errorCode = CALENDAR_ERROR_NONE;
57 calendar_record_h todoHandle = null;
59 result r = _CalendarbookDbConnector::Connect();
60 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
62 errorCode = calendar_record_create(_calendar_todo._uri, &todoHandle);
63 SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
65 if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
69 // Set start date to current date
70 Tizen::System::SystemTime::GetCurrentTime(tmpDateTime);
71 if (IsFailed(GetLastResult()))
73 tmpDateTime = _CalendarbookImpl::GetMinDateTime();
76 tmpDateTime.SetValue(tmpDateTime.GetYear(), tmpDateTime.GetMonth(), tmpDateTime.GetDay(), 0, 0, 0);
78 calendar_time_s convertedCalendarTime;
80 convertedCalendarTime.type = CALENDAR_TIME_UTIME;
81 convertedCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(tmpDateTime);
83 calendar_record_set_caltime(todoHandle, _calendar_todo.start_time, convertedCalendarTime);
84 calendar_record_set_caltime(todoHandle, _calendar_todo.due_time, convertedCalendarTime);
88 calendar_time_s convertedStartTime;
89 convertedStartTime.type = CALENDAR_TIME_UTIME;
90 convertedStartTime.time.utime = _CALENDAR_TODO_NO_START_DATE;
92 calendar_time_s convertedDueTime;
93 convertedDueTime.type = CALENDAR_TIME_UTIME;
94 convertedDueTime.time.utime = _CALENDAR_TODO_NO_DUE_DATE;
96 calendar_record_set_caltime(todoHandle, _calendar_todo.start_time, convertedStartTime);
97 calendar_record_set_caltime(todoHandle, _calendar_todo.due_time, convertedDueTime);
101 calendar_record_set_int(todoHandle, _calendar_todo.todo_status, CALENDAR_TODO_STATUS_NONE);
102 calendar_record_set_int(todoHandle, _calendar_todo.priority, CALENDAR_TODO_PRIORITY_NORMAL);
103 calendar_record_set_int(todoHandle, _calendar_todo.sensitivity, CALENDAR_SENSITIVITY_PUBLIC);
105 __todoRecord.ResetHandle(todoHandle);
107 r = __reminderList.Construct();
108 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
111 _CalTodoImpl::_CalTodoImpl(const _CalTodoImpl& rhs)
112 : __reminderListUpdated(false)
114 int errorCode = CALENDAR_ERROR_NONE;
115 calendar_record_h todoHandle = null;
117 result r = _CalendarbookDbConnector::Connect();
118 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
120 errorCode = calendar_record_clone(rhs.__todoRecord.GetHandle(), &todoHandle);
121 SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
123 __todoRecord.ResetHandle(todoHandle);
125 r = __reminderList.Construct();
126 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
129 _CalTodoImpl::~_CalTodoImpl(void)
131 __reminderList.RemoveAll(true);
133 result r = _CalendarbookDbConnector::Disconnect();
134 SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
138 _CalTodoImpl::operator =(const _CalTodoImpl& rhs)
145 __reminderList.RemoveAll(true);
146 __reminderListUpdated = false;
148 int errorCode = CALENDAR_ERROR_NONE;
149 calendar_record_h todoHandle = null;
151 errorCode = calendar_record_clone(rhs.__todoRecord.GetHandle(), &todoHandle);
152 SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, *this, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
154 __todoRecord.ResetHandle(todoHandle);
160 _CalTodoImpl::GetSubject(void) const
162 char* pSubject = null;
164 calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.summary, &pSubject);
166 return String(pSubject);
170 _CalTodoImpl::GetDescription(void) const
172 char* pDescription = null;
174 calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.description, &pDescription);
176 return String(pDescription);
180 _CalTodoImpl::GetStartDate(void) const
184 calendar_time_s tmpCalendarTime;
186 calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, &tmpCalendarTime);
188 if (tmpCalendarTime.time.utime == _CALENDAR_TODO_NO_START_DATE)
190 SetLastResult(E_DATA_NOT_FOUND);
191 return DateTime::GetMinValue();
194 DateTime tmpDateTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(tmpCalendarTime.time.utime);
200 _CalTodoImpl::GetDueDate(void) const
204 calendar_time_s tmpCalendarTime;
206 calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, &tmpCalendarTime);
208 if (tmpCalendarTime.time.utime == _CALENDAR_TODO_NO_DUE_DATE)
210 SetLastResult(E_DATA_NOT_FOUND);
211 return DateTime::GetMinValue();
214 DateTime tmpDateTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(tmpCalendarTime.time.utime);
220 _CalTodoImpl::GetPriority(void) const
222 int srcPriority = CALENDAR_EVENT_PRIORITY_LOW;
224 TodoPriority priority = TODO_PRIORITY_NORMAL;
226 calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.priority, &srcPriority);
230 case CALENDAR_TODO_PRIORITY_LOW:
231 priority = TODO_PRIORITY_LOW;
233 case CALENDAR_TODO_PRIORITY_NONE:
235 case CALENDAR_TODO_PRIORITY_NORMAL:
236 priority = TODO_PRIORITY_NORMAL;
238 case CALENDAR_TODO_PRIORITY_HIGH:
239 priority = TODO_PRIORITY_HIGH;
242 SysLog(NID_SCL, "The priority value is invalid. priority = %d", srcPriority);
243 priority = TODO_PRIORITY_NORMAL;
251 _CalTodoImpl::GetStatus(void) const
253 int srcStatus = CALENDAR_EVENT_STATUS_NONE;
255 TodoStatus status = TODO_STATUS_NONE;
257 calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.todo_status, &srcStatus);
261 case CALENDAR_TODO_STATUS_NONE:
262 status = TODO_STATUS_NONE;
264 case CALENDAR_TODO_STATUS_NEEDS_ACTION:
265 status = TODO_STATUS_NEEDS_ACTION;
267 case CALENDAR_TODO_STATUS_COMPLETED:
268 status = TODO_STATUS_COMPLETED;
270 case CALENDAR_TODO_STATUS_IN_PROCESS:
271 status = TODO_STATUS_IN_PROCESS;
273 case CALENDAR_TODO_STATUS_CANCELED:
274 status = TODO_STATUS_CANCELLED;
277 SysLog(NID_SCL, "The status value is invalid. status = %d", srcStatus);
278 status = TODO_STATUS_NONE;
286 _CalTodoImpl::GetSensitivity(void) const
288 int srcSensitivity = CALENDAR_SENSITIVITY_PUBLIC;
289 RecordSensitivity sensitivity = SENSITIVITY_PUBLIC;
291 calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.sensitivity, &srcSensitivity);
293 switch (srcSensitivity)
295 case CALENDAR_SENSITIVITY_PUBLIC:
296 sensitivity = SENSITIVITY_PUBLIC;
298 case CALENDAR_SENSITIVITY_PRIVATE:
299 sensitivity = SENSITIVITY_PRIVATE;
301 case CALENDAR_SENSITIVITY_CONFIDENTIAL:
302 sensitivity = SENSITIVITY_CONFIDENTIAL;
305 SysLog(NID_SCL, "The sensitivity value is invalid. sensitivity = %d", srcSensitivity);
306 sensitivity = SENSITIVITY_PUBLIC;
314 _CalTodoImpl::GetLastRevisedTime(void) const
316 long long lastModifiedTime = 0;
317 DateTime tmpLastRevisedTime;
319 calendar_record_get_lli(__todoRecord.GetHandle(), _calendar_todo.last_modified_time, &lastModifiedTime);
321 tmpLastRevisedTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(lastModifiedTime);
323 return tmpLastRevisedTime;
327 _CalTodoImpl::SetSubject(const String& subject)
329 if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
331 SysTryReturnResult(NID_SCL, subject.GetLength() <= MAX_TODO_SUBJECT_LENGTH,
332 E_INVALID_ARG, "Invalid argument is used. The length of the subject exceeds MAX_TODO_SUBJECT_LENGTH.");
335 std::unique_ptr<char[]> pConvertedSubject(_StringConverter::CopyToCharArrayN(subject));
336 SysTryReturnResult(NID_SCL, pConvertedSubject != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
338 int errorCode = CALENDAR_ERROR_NONE;
339 errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.summary, pConvertedSubject.get());
340 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
346 _CalTodoImpl::SetDescription(const String& description)
348 if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
350 SysTryReturnResult(NID_SCL, description.GetLength() <= MAX_TODO_DESCRIPTION_LENGTH,
351 E_INVALID_ARG, "Invalid argument is used. The length of the description exceeds MAX_TODO_SUBJECT_LENGTH.");
354 std::unique_ptr<char[]> pConvertedDescription(_StringConverter::CopyToCharArrayN(description));
355 SysTryReturnResult(NID_SCL, pConvertedDescription != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
357 int errorCode = CALENDAR_ERROR_NONE;
358 errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.description, pConvertedDescription.get());
359 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
365 _CalTodoImpl::SetStartAndDueDate(const DateTime& startDate, const DateTime& dueDate)
367 SysTryReturnResult(NID_SCL, _CalendarbookUtil::CheckValidDateTime(startDate), E_INVALID_ARG, "Invalid argument is used. The start date is invalid.");
368 SysTryReturnResult(NID_SCL, _CalendarbookUtil::CheckValidDateTime(dueDate), E_INVALID_ARG, "Invalid argument is used. The end date is invalid.");
369 SysTryReturnResult(NID_SCL, startDate <= dueDate, E_INVALID_ARG, "Invalid argument is used. The end date is earlier than the start date.");
371 calendar_time_s convertedStartTime;
372 calendar_time_s convertedDueTime;
374 convertedStartTime.type = CALENDAR_TIME_UTIME;
375 convertedStartTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(startDate);
376 convertedDueTime.type = CALENDAR_TIME_UTIME;
377 convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(dueDate);
379 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
380 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
386 _CalTodoImpl::SetStartDate(const DateTime& startDate)
388 calendar_time_s convertedStartTime;
389 convertedStartTime.type = CALENDAR_TIME_UTIME;
391 if (startDate == DateTime::GetMinValue())
393 convertedStartTime.time.utime = _CALENDAR_TODO_NO_START_DATE;
395 else if (startDate < _CalendarbookImpl::GetMinDateTime() || startDate > _CalendarbookImpl::GetMaxDateTime())
397 SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The startDate is invalid.");
398 return E_INVALID_ARG;
402 calendar_time_s convertedDueTime;
403 calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, &convertedDueTime);
405 convertedStartTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(startDate);
407 if (convertedStartTime.time.utime > convertedDueTime.time.utime)
409 convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(DateTime::GetMinValue());
410 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
414 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
420 _CalTodoImpl::SetDueDate(const DateTime& dueDate)
422 calendar_time_s convertedDueTime;
423 convertedDueTime.type = CALENDAR_TIME_UTIME;
425 if (dueDate == DateTime::GetMinValue())
427 convertedDueTime.time.utime = _CALENDAR_TODO_NO_DUE_DATE;
429 else if (dueDate < _CalendarbookImpl::GetMinDateTime() || dueDate > _CalendarbookImpl::GetMaxDateTime())
431 SysLogException(NID_SCL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The dueDate is invalid.");
432 return E_INVALID_ARG;
436 calendar_time_s convertedStartTime;
437 calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, &convertedStartTime);
439 convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(dueDate);
441 if (convertedStartTime.time.utime > convertedDueTime.time.utime)
443 convertedStartTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(DateTime::GetMinValue());
444 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
448 calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
454 _CalTodoImpl::SetPriority(TodoPriority priority)
456 calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.priority, _CalendarbookUtil::ConvertTodoPriorityToCSTodoPriority(priority));
460 _CalTodoImpl::SetStatus(TodoStatus status)
462 calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.todo_status, _CalendarbookUtil::ConvertTodoStatusToCSTodoStatus(status));
466 _CalTodoImpl::SetSensitivity(RecordSensitivity sensitivity)
468 calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.sensitivity, _CalendarbookUtil::ConvertSensitivityToCSSensitivity(sensitivity));
472 _CalTodoImpl::SetLocation(const String& location)
474 std::unique_ptr<char[]> pConvertedLocation(_StringConverter::CopyToCharArrayN(location));
475 SysTryReturnVoidResult(NID_SCL, pConvertedLocation != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
477 int errorCode = CALENDAR_ERROR_NONE;
478 errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.location, pConvertedLocation.get());
479 SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
483 _CalTodoImpl::GetLocation(void) const
485 char* pLocation = null;
487 calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.location, &pLocation);
489 return String(pLocation);
493 _CalTodoImpl::SetCoordinates(double latitude, double longitude)
495 SysTryReturnResult(NID_SCL, latitude >= _MIN_LATITUDE && latitude <= _MAX_LATITUDE, E_INVALID_ARG, "Invalid argument is used. The latitude is out of range.");
496 SysTryReturnResult(NID_SCL, longitude >= _MIN_LONGITUDE && longitude <= _MAX_LONGITUDE, E_INVALID_ARG, "Invalid argument is used. The longitude is out of range.");
498 calendar_record_set_double(__todoRecord.GetHandle(), _calendar_todo.latitude, latitude);
499 calendar_record_set_double(__todoRecord.GetHandle(), _calendar_todo.longitude, longitude);
505 _CalTodoImpl::GetCoordinates(double& latitude, double& longitude) const
507 calendar_record_get_double(__todoRecord.GetHandle(), _calendar_todo.latitude, &latitude);
508 calendar_record_get_double(__todoRecord.GetHandle(), _calendar_todo.longitude, &longitude);
512 _CalTodoImpl::AddReminder(const Reminder& reminder)
514 int errorCode = CALENDAR_ERROR_NONE;
515 calendar_record_h tmpAlarmHandle = null;
517 std::unique_ptr<char[]> pTmpAlarmTone(_StringConverter::CopyToCharArrayN(reminder.GetSoundFile()));
518 SysTryReturnResult(NID_SCL, pTmpAlarmTone != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
520 errorCode = calendar_record_create(_calendar_alarm._uri, &tmpAlarmHandle);
521 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
523 int convertedTimeUnit = 0;
525 ReminderTimeUnit timeUnit = reminder.GetTimeUnit();
528 case REMINDER_TIME_UNIT_MINUTE:
529 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_MINUTE;
531 case REMINDER_TIME_UNIT_HOUR:
532 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_HOUR;
534 case REMINDER_TIME_UNIT_DAY:
535 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_DAY;
537 case REMINDER_TIME_UNIT_WEEK:
538 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_WEEK;
540 case REMINDER_TIME_UNIT_NONE:
541 convertedTimeUnit = CALENDAR_ALARM_TIME_UNIT_SPECIFIC;
547 calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
548 calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, reminder.GetTimeOffset());
549 errorCode = calendar_record_set_str(tmpAlarmHandle, _calendar_alarm.tone, pTmpAlarmTone.get());
550 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
552 if (convertedTimeUnit == CALENDAR_ALARM_TIME_UNIT_SPECIFIC)
554 calendar_record_set_lli(tmpAlarmHandle, _calendar_alarm.time, _CalendarbookUtil::ConvertDateTimeToEpochTime(reminder.GetAbsoluteTime()));
557 errorCode = calendar_record_add_child_record(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, tmpAlarmHandle);
558 SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
560 __reminderList.RemoveAll(true);
561 __reminderListUpdated = false;
567 _CalTodoImpl::RemoveReminderAt(int index)
569 int errorCode = CALENDAR_ERROR_NONE;
570 calendar_record_h tmpAlarmHandle = null;
572 errorCode = calendar_record_get_child_record_at_p(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, index, &tmpAlarmHandle);
573 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.");
575 calendar_record_remove_child_record(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, tmpAlarmHandle);
577 __reminderList.RemoveAll(true);
578 __reminderListUpdated = false;
584 _CalTodoImpl::GetAllReminders(void) const
588 if (__reminderListUpdated == false)
590 result r = _CalendarbookUtil::ConvertTodoAlarmsToReminderList(__todoRecord.GetHandle(), __reminderList);
591 SysTryReturn(NID_SCL, r == E_SUCCESS, __reminderList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
593 __reminderListUpdated = true;
596 return __reminderList;
600 _CalTodoImpl::GetCalendarId(void) const
602 int srcCalendarbookId = 0;
604 calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.calendar_book_id, &srcCalendarbookId);
606 return srcCalendarbookId;
610 _CalTodoImpl::SetRecordHandle(calendar_record_h todoHandle)
612 __todoRecord.ResetHandle(todoHandle);
616 _CalTodoImpl::GetRecordHandle(void) const
618 return __todoRecord.GetHandle();
622 _CalTodoImpl::CreateDefaultInstanceN(void)
624 return new (std::nothrow) CalTodo();
628 _CalTodoImpl::GetInstance(CalTodo& todo)
630 return todo.__pCalTodoImpl;
634 _CalTodoImpl::GetInstance(const CalTodo& todo)
636 return todo.__pCalTodoImpl;